Emuforums.com

Go Back   Emuforums.com > General Discussion > Web development / Programming
Home Register Downloads FAQ Members List Calendar Arcade Mark Forums Read

WON'T YOU JOIN US?
You are not a registered member and
are viewing this site as a guest.
Registration is simple and FREE.
Join this CrowdGather community today.
Registration offers the following perks:

» Less advertising throughout
» Post and participate in discussions
» Network with other forum members
» Free private messaging

join

Reply
 
Thread Tools Display Modes
Old November 25th, 2003, 12:09   #1
Janus
Memories are all I have..
 
Janus's Avatar
 
Join Date: Apr 2001
Location: In my memories...
Posts: 423
Need some Php help

Hey guys. I keep getting an error when i run this php script. But i checked and it looks fine. Can anyone help?

Quote:
<html>
<head>
<title>Learning Php</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php

if ($HTTP_POST_VARS['action'] == 'submitted') {
print '<pre>';

print_r($HTTP_POST_VARS);
print '<a href="'. $HTTP_POST_VARS['PHP_SELF'].'">Please try again</a>';
print '</pre>';
} else {
?>
<form action="<?php echo $HTTP_SERVER_VARS['PHP_SELF']; ?>" method="post">
Name: <input type="text" name="personal[name]"><br>
Email: <input type="text" name="personal[email]"><br>
Beer:<br>
<select multiple name="beer[]">
<option value="warthog">Warthog</option>
<option value="guinness">Guinness</option>
<option value="stuttgarter">Stuttgarter Schwabenbrau</option>
</select><br>
<input type="hidden" name="action" value="submitted">
<input type="submit" name="submit" value="submit me!">
</form>
<?php
}
?>


</body>
</html>
__________________
When the pages of the book of my life ends. You'll be the most colourful chapter i ever had. If it'll be open again, i'll start with the moment i knew you.
[sig=390]
Janus is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old November 25th, 2003, 15:36   #2
scottlc
Registered User
 
scottlc's Avatar
 
Join Date: Sep 2002
Location: St Andrews, Scotland
Posts: 1,577
Re: Need some Php help

Here is your problem:
Code:
} else {
?&gt;
__________________
Computer: White MacBook (late 2008) - OS: Mac OS X 10.5.7 - CPU: Intel Core 2 Duo 2.1GHz - Memory: 4GB DDR2 PC2-5300
scottlc is offline   Reply With Quote
Old November 26th, 2003, 03:38   #3
Janus
Memories are all I have..
 
Janus's Avatar
 
Join Date: Apr 2001
Location: In my memories...
Posts: 423
Re: Need some Php help

im sorry, but i dont get you. THe loop seems fine..
__________________
When the pages of the book of my life ends. You'll be the most colourful chapter i ever had. If it'll be open again, i'll start with the moment i knew you.
[sig=390]
Janus is offline   Reply With Quote
Old November 29th, 2003, 21:57   #4
SnakeBite
Translator
 
SnakeBite's Avatar
 
Join Date: Apr 2002
Location: Norway
Posts: 669
Re: Need some Php help

I went through your code, and I can't see anything wrong there. Could you be more specific about the error?
__________________
This is my new improved sig.
SnakeBite is offline   Reply With Quote
Old November 29th, 2003, 22:25   #5
RF
Canadian Spaceman
 
RF's Avatar
 
Join Date: May 2002
Location: Canada
Posts: 8,767
Re: Need some Php help

Dont use the QUOTE tags, use the CODE tags so the code isnt parsed, and the full source is shown.
__________________
CPU: Core i7 920 \ MB: EVGA X58 \ RAM: 12GB OCZ DDR3-1600 \ GPU: ATi 5870

HDD: 2x 150GB VelociRaptor R0 / PSU: Enermax Galaxy 850w / OS: Windows 7 x64
RF is offline   Reply With Quote
Old November 29th, 2003, 23:42   #6
scottlc
Registered User
 
scottlc's Avatar
 
Join Date: Sep 2002
Location: St Andrews, Scotland
Posts: 1,577
Re: Need some Php help

Or just attach it as a seperate file.
__________________
Computer: White MacBook (late 2008) - OS: Mac OS X 10.5.7 - CPU: Intel Core 2 Duo 2.1GHz - Memory: 4GB DDR2 PC2-5300
scottlc is offline   Reply With Quote
Old November 30th, 2003, 05:47   #7
RamsusX
Ramsus K
 
Join Date: Mar 2003
Location: Oklahoma
Posts: 461
Re: Need some Php help

Quote:
Originally Posted by Reichfuher
Dont use the QUOTE tags, use the CODE tags so the code isnt parsed, and the full source is shown.
CODE tags don't work in preventing tags from being rendered, because it isn't &lt;pre&gt; formatted for some reason. Of course, you can write &amp;lt; and &amp;gt; in your posts, but it's just easier to attach the source code.
RamsusX is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 08:58.

© 2006 - 2012 Emu Forums | About Emu Forums | Advertisers | Investors | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.