LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 588 users online 221672 members 907 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
The Raven
Music: Beck Aesop Rock S
Mood: Pleased
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
4 online / 31 MPM
Fresh Topics
  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic

PHP basic help.
Replies: 5Last Post Aug. 14, 2007 2:31pm by RossTheHoss69
Welcome to LiveWire!
We're Stronger Together.
Join the Community
Single page for this topic Email Print Favorite
( RossTheHoss69 )


The Goddamn Batman.

Patron
Tech Support Leader
Reply
Okay, here's the first code:
Code:

<html>
<body>
<form action="yoo.php" method="get">
<input type="radio" name="color" value="1">Red Style.
<input type="radio" name="color" value="2">Blue Style.
<input type="radio" name="color" value="3">Yellow Style.
<input type="submit" value="submit." />
</form>
</body>
</html>

and here's the action page:
Code:

<html>
<body>
<?php
echo $_GET['color'].value;
if ($_GET['color'].value="1") then
$gar="red";

elseif ($_GET['color'].value="2") then
$gar="blue";

else
$gar="yellow";

echo $gar;
?>

WTF is wrong with this?
Anytime I run the first page,
I get:
Code:

Parse error: syntax error, unexpected '=' in C:\xampp\htdocs\yoo.php on line 5

Help?

EDIT: Fixed.

Post edited at 7:14 pm on Aug. 13, 2007 by RossTheHoss69

-------
I'm not changing this line until I get a girlfriend. [7-08-07; 1:26 a.m.]
Shït. Piss. Fück. Cünt. Cocksucker. Motherfücker. And Tits.
R.I.P George Carlin.


7:06 pm on Aug. 13, 2007 | Joined: Dec. 2005 | Days Active: 959
Join to learn more about RossTheHoss69 Texas, United States | Male | Posts: 5,607 | Points: 30,482
LiveWire Humor
The Dalai Lama


Soothsayer

Patron
Reply
Code:

<html>  
<body>  
<?php  
echo $_GET['color'].value;  
if ($_GET['color'].value == "1") {
$gar="red";
}

elseif ($_GET['color'].value == "2") {  
$gar="blue";  
}
else
{  
$gar="yellow";  
}
echo $gar;  
?>

Okay, I've edited twice.  This time should do it.

Post edited at 7:11 pm on Aug. 13, 2007 by The Dalai Lama


7:09 pm on Aug. 13, 2007 | Joined: Oct. 2006 | Days Active: 488
Join to learn more about The Dalai Lama Ontario, Canada | Straight Male | Posts: 8,781 | Points: 12,189
( RossTheHoss69 )


The Goddamn Batman.

Patron
Tech Support Leader
Reply
Quote: from The Dalai Lama at 9:09 pm on Aug. 13, 2007

Code:

<html>  
<body>  
<?php  
echo $_GET['color'].value;  
if ($_GET['color'].value == "1") {
$gar="red";
}

elseif ($_GET['color'].value == "2") {  
$gar="blue";  
}
else
{  
$gar="yellow";  
}
echo $gar;  
?>

Okay, I've edited twice.  This time should do it.



Yeah.
Once I got to thinking,
I forgot to add the extra "=".
I always get confused with PHP and TI-Basic.

-------
I'm not changing this line until I get a girlfriend. [7-08-07; 1:26 a.m.]
Shït. Piss. Fück. Cünt. Cocksucker. Motherfücker. And Tits.
R.I.P George Carlin.

7:13 pm on Aug. 13, 2007 | Joined: Dec. 2005 | Days Active: 959
Join to learn more about RossTheHoss69 Texas, United States | Male | Posts: 5,607 | Points: 30,482
The Dalai Lama


Soothsayer

Patron
Reply
Yeah, plus you forget the { } for the If command.

7:14 pm on Aug. 13, 2007 | Joined: Oct. 2006 | Days Active: 488
Join to learn more about The Dalai Lama Ontario, Canada | Straight Male | Posts: 8,781 | Points: 12,189
Macropiper


Like a Ninja!

Patron
Tech Support Leader
Reply
Whats up the the $_GET['color'].value bit? PHP is not Javascript, all you need is $_GET['color']

1:59 pm on Aug. 14, 2007 | Joined: Oct. 2002 | Days Active: 2,390
Join to learn more about Macropiper New Zealand | Straight Male | Posts: 8,995 | Points: 43,076
( RossTheHoss69 )


The Goddamn Batman.

Patron
Tech Support Leader
Reply
Quote: from Tangaroa at 3:59 pm on Aug. 14, 2007

Whats up the the $_GET['color'].value bit? PHP is not Javascript, all you need is $_GET['color']

I know.
I got a little confused when I was going fast...
I was in a rush to show someone something,
and I had to save my work.

-------
I'm not changing this line until I get a girlfriend. [7-08-07; 1:26 a.m.]
Shït. Piss. Fück. Cünt. Cocksucker. Motherfücker. And Tits.
R.I.P George Carlin.

2:31 pm on Aug. 14, 2007 | Joined: Dec. 2005 | Days Active: 959
Join to learn more about RossTheHoss69 Texas, United States | Male | Posts: 5,607 | Points: 30,482
Single page for this topic Email Print Favorite

Quick Reply

You are signed in as our guest.

Looking for something else?
 

  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic