+ Reply to Thread
Results 1 to 3 of 3

Thread: Unsure of this error...

  1. #1
    salukigirl is offline x10Hosting Member salukigirl is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    78

    Unsure of this error...

    I'm using this script...
    PHP Code:
    <?php
    session_start
    ();
    $buyapet $_POST['buyapet'];
    $add $_POST['add'];
    $delete $_POST['delete'];
    $error 0

    $petname $_POST['petname'];
    $petcolor $_POST['petcolor'];
    $petbreed $_POST['petbreed'];
    $petgender $_POST['petgender']; // 1 is male, 0 is female

    $cash $my_cash;
    $petyear date("Y");
    $petday date("j");
    $petmonth date("n");
    srand(time());
    $pethunger rand(0,100);
    $petthirst rand(0,100);
    $petgrooming rand(0,100);
    $pethappiness rand(0,100);
    if(
    $cash 3000){echo "<br>You don't have enough cash. Sorry!<br><br>";
    }else{
    $petmonth petmonth 1;
    $result = @mysql_query("SELECT petbreed, breed_ID FROM breeds WHERE breed_ID='$petbreed' LIMIT 1")or die("Cannot find breed! " . @mysql_error());
    $row = @mysql_fetch_array($result);
    $petbreed_check $row['petbreed'];
    if(!
    $petbreed_check){echo "petbreed: $petbreed; petbreed_check: $petbreed_check<center><font color=red>Invalid breed!";include('footer.php');exit;}
    $sql = @mysql_query("INSERT
    INTO petbreed (petname, petbreed, petowner, petgender, petyear, petday, petmonth,
    petcolor,pethist1, pethappiness, dhunger, dthrist, dgrooming) VALUES
    ('
    $petname','$petbreed','$id','$petgender','$petyear','$petday','$petmonth','$petcolor','Bought on $petmonth/$petdday/$petyear','$pethappiness','$pethunger','$petthirst','$petgrooming')") or die ( 'error' . @mysql_error());
    $dogsuccess 1;

    $result = @mysql_query("UPDATE members SET cash=cash-3000 WHERE id='$id'") or die ('could not update pets name');
    echo 
    "<br>Animal Created!<BR><BR>";
    }

    ?>
    <?php
    if($buyapet){ echo <<<HTML 
    <form name="form1" method="post" action="petstore.php">
    Registered Name:
    <
    br>
    <
    input name="$petnametype="text"
    Rabbit Breed:
    <
    select breed="$petbreed"
    <option value="American Chinchilla">American Chinchilla</option>
    <
    option value"American Fuzzy Lop">American Fuzzy Lop</option>
    <
    option value"American Sable">American Sable</option>
    <
    option value"Belgian Hare">Belgian Hare</option>
    <
    option value"Brittania Petite">Brittania Petite</option>
    <
    option value"Californian">Californian</option>
    <
    option value"Champagne D'Argent"Champagne D'Argent </option>
    <option value"Checkered Giant">Checkered Giant</option>
    <option value"Cinnamon">Cinnamon</option>
    <option value"Creme D'
    Argent">Creme D'Argent</option>
    <option value"
    Dutch">Dutch</option>
    <option value"
    Dwarf Hotot">Dwarf Hotot</option>
    <option value"
    English Angora">English Angora</option>
    <option value"
    English Spot">English Spot</option>
    <option value"
    Flemish Giant">Flemish Giant</option>
    <option value"
    Florida White ">Florida White </option>
    <option value"
    Giant Angora">Giant Angora</option>
    <option value"
    Giant Chinchilla ">Giant Chinchilla </option>
    <option value"
    French Angora">French Angora</option>
    <option value"
    Harlequin">Harlequin</option>
    <option value"
    Havana">Havana</option>
    <option value"
    Himalayan">Himalayan</option>
    <option value"
    Holland Lop">Holland Lop</option>
    <option value"
    Hotot">Hotot</option>
    <option value"
    Mini Rex">Mini Rex</option>
    <option value"
    Rex">Rex</option>
    <option value"
    Satin Angora">Satin Angora</option>
    <option value"
    Standard Chinchilla ">Standard Chinchilla </option>
    <br>
    pet gender:
    <select name"
    $petgender">
    <option value"
    male">Male</option>
    <option value"
    female">Female</option>
    <br>
    Pet Color:
    <select name"
    $petcolor">
    <option value"
    white">White</option>
    <option value"
    black">Black</option>
    <option value"
    gray">Gray</option>
    <br>
    </select>
    <input type="
    submit" name="submit" value="But It!">
    </form>
    }
     }
     
     ?>
    And get this error
    Parse error: syntax error, unexpected T_SL in /home/star/public_html/bunnygame/petstore.php on line 41

    I've checked line 41 a bunch of times but I can't find the error... =(

  2. #2
    Synkc's Avatar
    Synkc is offline Lord Of The Keys Synkc is an unknown quantity at this point
    Join Date
    Jun 2007
    Location
    Hervey Bay, Australia
    Posts
    1,765

    Re: Unsure of this error...

    Try replacing everything with:

    PHP Code:
    <?php
    session_start
    ();
    $buyapet $_POST['buyapet'];
    $add $_POST['add'];
    $delete $_POST['delete'];
    $error 0

    $petname $_POST['petname'];
    $petcolor $_POST['petcolor'];
    $petbreed $_POST['petbreed'];
    $petgender $_POST['petgender']; // 1 is male, 0 is female

    $cash $my_cash;
    $petyear date("Y");
    $petday date("j");
    $petmonth date("n");
    srand(time());
    $pethunger rand(0,100);
    $petthirst rand(0,100);
    $petgrooming rand(0,100);
    $pethappiness rand(0,100);

    if(
    $cash 3000){
        echo 
    "<br>You don't have enough cash. Sorry!<br><br>";
    }
    else{
        
    $petmonth petmonth 1;
        
    $result = @mysql_query("SELECT petbreed, breed_ID FROM breeds WHERE breed_ID='$petbreed' LIMIT 1")or die("Cannot find breed! " . @mysql_error());
        
    $row = @mysql_fetch_array($result);
        
    $petbreed_check $row['petbreed'];
        if(!
    $petbreed_check){
            echo 
    "petbreed: $petbreed; petbreed_check: $petbreed_check<center><font color=red>Invalid breed!";
            include(
    'footer.php');exit;
        }
        
    $sql = @mysql_query("INSERT INTO petbreed (petname, petbreed, petowner, petgender, petyear, petday, petmonth, petcolor,pethist1, pethappiness, dhunger, dthrist, dgrooming) VALUES ('$petname','$petbreed','$id','$petgender','$petyear','$petday','$petmonth','$petcolor','Bought on $petmonth/$petdday/$petyear','$pethappiness','$pethunger','$petthirst','$petgrooming')") or die ( 'error' . @mysql_error());
        
    $dogsuccess 1;
        
    $result = @mysql_query("UPDATE members SET cash=cash-3000 WHERE id='$id'") or die ('could not update pets name');
        echo 
    "<br>Animal Created!<BR><BR>";
    }
    if(
    $buyapet){ 
    echo
    "<form name='form1' method='post' action='petstore.php'>
    Registered Name:
    <br>
    <input name='
    $petname' type='text'
    Rabbit Breed:
    <select breed='
    $petbreed'
    <option value='American Chinchilla'>American Chinchilla</option>
    <option value'American Fuzzy Lop'>American Fuzzy Lop</option>
    <option value'American Sable'>American Sable</option>
    <option value'Belgian Hare'>Belgian Hare</option>
    <option value'Brittania Petite'>Brittania Petite</option>
    <option value'Californian'>Californian</option>
    <option value'Champagne D'Argent'> Champagne D'Argent </option>
    <option value'Checkered Giant'>Checkered Giant</option>
    <option value'Cinnamon'>Cinnamon</option>
    <option value'Creme D'Argent'>Creme D'Argent</option>
    <option value'Dutch'>Dutch</option>
    <option value'Dwarf Hotot'>Dwarf Hotot</option>
    <option value'English Angora'>English Angora</option>
    <option value'English Spot'>English Spot</option>
    <option value'Flemish Giant'>Flemish Giant</option>
    <option value'Florida White '>Florida White </option>
    <option value'Giant Angora'>Giant Angora</option>
    <option value'Giant Chinchilla '>Giant Chinchilla </option>
    <option value'French Angora'>French Angora</option>
    <option value'Harlequin'>Harlequin</option>
    <option value'Havana'>Havana</option>
    <option value'Himalayan'>Himalayan</option>
    <option value'Holland Lop'>Holland Lop</option>
    <option value'Hotot'>Hotot</option>
    <option value'Mini Rex'>Mini Rex</option>
    <option value'Rex'>Rex</option>
    <option value'Satin Angora'>Satin Angora</option>
    <option value'Standard Chinchilla '>Standard Chinchilla </option>
    <br>
    pet gender:
    <select name'
    $petgender'>
    <option value'male'>Male</option>
    <option value'female'>Female</option>
    <br>
    Pet Color:
    <select name'
    $petcolor'>
    <option value'white'>White</option>
    <option value'black'>Black</option>
    <option value'gray'>Gray</option>
    <br>
    </select>
    <input type='submit' name='submit' value='But It!'>
    </form>"
    ;
    }
    ?>
    Hope this helps you.
    Last edited by Synkc; 11-16-2007 at 08:41 PM.
    E-mail: synkc[at]x10hosting[dot]com
    Hirokima.com

  3. #3
    Sohail's Avatar
    Sohail is offline x10 Spammer Sohail is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    London, UK
    Posts
    3,052

    Re: Unsure of this error...

    Maybe you need to upgrade your PHP.

+ Reply to Thread

Similar Threads

  1. Error en mi host
    By roonline in forum Soporte
    Replies: 17
    Last Post: 11-14-2007, 03:28 PM
  2. 500 Internal Server Error (PHP Error?)
    By aniklaus in forum Free Hosting
    Replies: 3
    Last Post: 11-12-2007, 11:47 AM
  3. Error
    By Makke in forum Free Hosting
    Replies: 1
    Last Post: 11-02-2007, 04:41 PM
  4. {req} Banners
    By SEŅOR in forum The Marketplace
    Replies: 23
    Last Post: 01-05-2006, 03:15 PM
  5. Internal Sever Error
    By Gun Mac in forum Free Hosting
    Replies: 0
    Last Post: 09-19-2005, 03:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers