Php Error-where To Put "?>"

free web hosting
Free Web Hosting > Computers & Tech > Programming > Scripting > PHP

Php Error-where To Put "?>"

Eggie
lol....lately i have many problems in writing my scripts and i dont know if i should create post only for purpose so ppl can help me or should i create many post like i am doing right now...i am NOT making this to get many credits...i am doing it because i need help and many people here help me!

CODE
if ($_GET['action']!='race'){
<form name="form2" method="get" action="race.php?action=race">
<tr><td>Who do you wanna race?</td><td>
    <select size=5 name="bike">
    <option value="Derbi Senda 50">Derbi Senda 50</option>
    <option value="Honda NS 50 R">Honda NS 50 R</option>
    <option value="Suzuki ZR 50">Suzuki ZR 50</option>
    <option value="Yamaha DT 50 MX">Yamaha DT 50 MX</option>
    <option value="Aprilia RS 50">Aprilia RS 50</option>
    </select>-<a href="java script:launchClasses()">?</a>
    <input type=submit value=Register>  
</td>
</tr>
</form>
}

i have this code...if i put <?php before it and ?> after it i get
QUOTE
Parse error: syntax error, unexpected '<' in C:\wamp\www\race.php on line 27
if i put ?> directly after if clause like this
CODE
<?php if ($_GET['action']!='race')?>{//codes}

the brackets are printed out and it doesnt help...
and if i put it after like this:
CODE
<?php if ($_GET['action']!='race'){?>//codes}

i get this
QUOTE
Parse error: syntax error, unexpected $end in C:\wamp\www\race.php on line 41

i hope my problem is understandable and you can help me....thnx

 

 

 


Reply

vujsa
Try this:
CODE
if ($_GET['action']!='race'){?>
<form name="form2" method="get" action="race.php?action=race">
<tr><td>Who do you wanna race?</td><td>
    <select size=5 name="bike">
    <option value="Derbi Senda 50">Derbi Senda 50</option>
    <option value="Honda NS 50 R">Honda NS 50 R</option>
    <option value="Suzuki ZR 50">Suzuki ZR 50</option>
    <option value="Yamaha DT 50 MX">Yamaha DT 50 MX</option>
    <option value="Aprilia RS 50">Aprilia RS 50</option>
    </select>-<a href="java script:launchClasses()">?</a>
    <input type=submit value=Register>  
</td>
</tr>
</form>
<?php}?>


This is one of the nicest features available in PHP but can be very confusing at times if you forget what is an isn't going to be shown when.

By the way, don't worry about the multiple topics... As long as each is different, you can have a million topics! In fact, it is easier for later users to find information and discussion they want to participate in if the topics are separate. Not that you care, but from an SEO point of view, separate topics would score higher.

Hope this helps.

vujsa

 

 

 


Reply

Eggie
SOLVED
thanx vujsa..
as i said i like this forum cause many people are willing to help and they get credits for it so thats great way for doing it...
when i complete my game i hope my hosting will be approved at last tongue.gif
cya later with more questions to come...

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

Recent Queries:-
  1. how to put select from at php - 10.17 hr back. (2)
  2. how do get check database value and select option value both are equal php - 65.57 hr back. (1)
  3. where to put code in mysql - 103.22 hr back. (1)
  4. php error - 103.96 hr back. (1)
  5. how to put error in php - 140.73 hr back. (1)
  6. php $_get put - 154.25 hr back. (1)
  7. html php => error - 339.10 hr back. (1)
  8. mysql_num_rows php error checking - 406.39 hr back. (1)
  9. where to put php - 443.06 hr back. (1)
  10. how to overcome parse error in php syntax - 519.69 hr back. (1)
  11. put html php - 579.49 hr back. (1)
  12. put php code in html page - 586.03 hr back. (1)
Similar Topics

Keywords : php, error, put,

  1. Php Configuration Error?
    (6)
  2. Cant Find The Error
    (2)
    In this code I want to retrieve the energy and max energy of a players account, then add 8% to
    energy of maxenergy, hen if energy is bigger than maxenergy, energy is then made equal to maxenergy.
    Then the database is updated. I don't understand why it's not working.
    $query=mysql_query("SELECT MAX(id) as maxid FROM `accounts` LIMIT 1"); $row =
    mysql_fetch_assoc($query); $id = $row ; $query = "SELECT * FROM `accounts`";
    $result=mysql_query($query); while ($row=mysql_fetch_assoc($result)) { $energy = $row ; $maxenergy
    = $row ; } for($i=1; $i $query = "SELECT....
  3. Warning: Mysql_num_rows()
    What is the error :S (1)
    Hey! I've made a register script.. Some time ago it worked. And I ain't sure if I changed
    something since then.. The error I am getting is this: Warning: mysql_num_rows(): supplied argument
    is not a valid MySQL result resource in /home/feelay/public_html/regcheck.php on line 31 Here is
    the code on theese lines: CODE $sqlCheckForDuplicate = "SELECT username FROM user WHERE username
    = '". $username ."'";                 if( mysql_num_rows( mysql_query(
    $sqlCheckForDuplicate ) ) == 0 )         {             $sqlRegUser =     "INSERT INTO            ....
  4. Php Math Error
    (4)
    I cant get php to do simple math. Anyway
    I need to run a math problem from the mysql database (dont ask why). So lets say I have an entrie: 5
    +5. I get it from my db then eval it but nothing happens? How could I make it so that it runs the 5+
    5 rather then just displaying it? Thanks, Sparkx Also: I have no clue if it is just my browser or
    what but my post breaks to boarder for some odd reason?....
  5. Unexpected Error
    Undefined variable??? (2)
    Is this script correct? index.php : CODE     if (isset($_COOKIE ))           $_GET =
    $_COOKIE ;     else         setcookie("disp_name", Anonymous, date()+99); ?>              
    Display Name - DZN                                                                   
                    Dislpay Name: name="name" />                                                
         proccess.php : CODE      Proccessing Request...           Please wait...
        setcookie("disp_name", $_GET , date()+99); ?> main.php : CODE     function customErr....
  6. Error On Submit Page
    (10)
    I am writing a new submit page for one of my sites and am doing a few things to stretch my
    experience. I am getting an error (naturally.) Here is part pf the page where the error might be:
    CODE //Check to see if the web page called itself     if (strtoupper($action) == "CHECK") {
            //The web page called itself, so run the error checking code         //Declare a variable to
    hold the error messages     $error = '';      // variable names:    name, cat, sub_cat, url,
    date, status, email, other, area_code, city          $name = $_POST ;     $cat = $_P....
  7. Got A Wee Error - Can You Help?
    (13)
    I'm taking a PHP course at college and am working on an assignment. There's no database
    involved. I've declared my variables from a submit form on another page, and on the page
    I'm working on I'm trying to bring them up in a table. But my start-table command is
    outputting an error. Here's the code relating to where the error is: CODE //Get First
    Item     if (isset($_GET )) {                 $item_1_product = $_GET ;     } else {
            $item_1_product = ""; //Default value if data missing     }          if (isset($_GET ))
    {            ....
  8. E-mail List Error
    (4)
    I just coded this e-mail list, it works well for entering data into database, but if user leaves
    the field blank or adds an already exist e-mail it gives him the error message and stops loading the
    rest of the page. CODE // Connects to your Database mysql_connect("localhost", "my_username",
    "mypassword") or die(mysql_error()); mysql_select_db("Database name") or die(mysql_error()); //This
    code runs if the form has been submitted if (isset($_POST )) { //This makes sure they did not leave
    any fields blank if (!$_POST ) {die(' No e-mail added '); } ....
  9. In Php, How To Not Display Mysql Connection Error?
    Don't want mysql_connect() message (4)
    In PHP, if the mysql database server cannot be connected, for example database server is handed or
    turned off, an error message will be displayed: Warning: mysql_connect(): Unknown MySQL Server Host
    "mysql.example.com" ... My question is how to not display this warning message? or can I customise
    the error message? if so, how? Thank you.....
  10. Php Problem Error Message
    I'm working from a book (9)
    I get this error message when I try to view a small webpage. QUOTE Parse error: parse error,
    unexpected T_STRING, expecting ',' or ';' in
    /home/nilsc/public_html/bobs/processorder.php on line 27 Line 27 is in this php part: CODE
    echo ' Order processed. '; echo $tireqty. ' tires '; echo $oilqty. ' bottles
    of oil '; echo $sparkqty. ' spark plugs '; $totalqty = 0; $totalqty = $tireqty +
    $oilqty + $spakqty; echo 'Items ordered: ' .$totalqty.' ; $totalamount = 0.00;
    define('TIREPRICE....
  11. PHP paFileDB error
    an error relating to admin login (0)
    does any body know how to over come an error in paFileDB which says Warning: Cannot modify header
    information - headers already sent by (output started at
    /home/paltalkh/public_html/pafiledb/includes/mysql.php:86) in
    /home/paltalkh/public_html/pafiledb/includes/admin/login.php on line 36 Warning: Cannot modify
    header information - headers already sent by (output started at
    /home/paltalkh/public_html/pafiledb/includes/mysql.php:86) in
    /home/paltalkh/public_html/pafiledb/includes/admin/login.php on line 38 i have downloaded the php
    from phparena.net directly. Any hel....
  12. PHP paFileDB error
    an error relating to admin login. (2)
    does any body know how to over come an error in paFileDB which says Warning: Cannot modify header
    information - headers already sent by (output started at
    /home/paltalkh/public_html/pafiledb/includes/mysql.php:86) in
    /home/paltalkh/public_html/pafiledb/includes/admin/login.php on line 36 Warning: Cannot modify
    header information - headers already sent by (output started at
    /home/paltalkh/public_html/pafiledb/includes/mysql.php:86) in
    /home/paltalkh/public_html/pafiledb/includes/admin/login.php on line 38 i have downloaded the php
    from phparena.net directly. Any he....

    1. Looking for php, error, put,






*SIMILAR VIDEOS*
Searching Video's for php, error, put,
advertisement




Php Error-where To Put "?>"