Jump to content

sirusx69

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sirusx69's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Could you explain some of how you did this to me?
  2. Removing or changing $cheat had zero effect.
  3. Lol im just copying pasting what you give me and then comparing and attempting to figure it out....if its still there cause you did it too haha <3 akay now just copypaste above :-D Well happy to say that everything is working again, except its back to just displaying "You have been granted" so its still not pulling that form data >.< why is this?
  4. Lol im just copying pasting what you give me and then comparing and attempting to figure it out....if its still there cause you did it too haha <3
  5. GNU nano 2.2.3 File: testcode.php <html> <body> <?php if(isset($_POST['submitxyz'])) { $code=$_POST["fcheat"]; function checkcheat() { if ($code=="rockon87") { $cheat=="Godmode"; $check==1; $invalid==0; display(); } else { $cheat==" "; $check==0; $invalid==1; display(); } } function display() { if (invalid==0) { echo "You have been granted " . $cheat; } else { echo "That is not a valid cheat code"; } } $code=$_POST["fcheat"]; checkcheat(); } else { ?> <form action="cheatcode.php" name="submitxyz" method="postt"> Cheat: <input name="fcheat" type="text" /> <input type="submit" /> </form> </body> </html> I did what you suggested and now its screaming at me Parse error: syntax error, unexpected ';', expecting '{' in /home2/lawshzco/public_html/techyme/trey/testcode.php on line 7
  6. Still having an issue with it. I threw it up live so you could see whats going on. http://techy.me/trey/test.html
  7. i get Parse error: syntax error, unexpected '<' in /home2/lawshzco/public_html/techyme/trey/testcode.php on line 39 when i attempted your code?
  8. heh heh...oops....well at least I fixed the problem and it still doesn't work. I just get "you have been granted " and thats it whereas the expected output would be "you have been granted Godmode" hm...so it has something to do with the if statements now....>.<
  9. Hello there, just started learning PHP and I can't exactly figure out why this doesn't work. After about 3 hours I'm seeking help lol... Form Code: <form action="cheatcode.php" method="postt"> Cheat: <input name="fcheat" type="text" /> <input type="submit" /> </form> PHP Code: function checkcheat() { if ($code=="rockon87") { $cheat=="Godmode"; $check==1; $invalid==0; display(); } else { $cheat==" "; $check==0; $invalid==1; display(); } } function display() { if (invalid==0) { echo "You have been granted " . $cheat; } else { echo "That is not a valid cheat code"; } } $code=$_POST["fcheat"]; checkcheat(); I'm just trying to learn php..atm on functions and forms. Thanks for any help and/or suggestions. EDIT: From what I can see, the code: $code=$_POST["fcheat"]; is not pulling the data...and because of that the if statements bug out and the script just returns a blank page. trying to follow the tutorials on W3schools but in my own way. Not working out to well.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.