-
January 29th, 2009, 08:59 PM
#1
[RESOLVED] Problem with Registration Form
Okay, So I have an HTML form like this.
Code:
<HTML>
<HEAD>
<title>Simple reg Test</title>
</HEAD>
<BODY>
<h1>Register below!</h1>
<p/>
<p/>
<form action="registration.php" method="POST">
Name: <input type="text" name="UNAME" />
EMail: <input type="text" name="EMail" />
Choose your character type:
<select name="CType">
<option value="Warrior">Warrior</option>
<option value="Mage">Mage</option>
<option value="Rogue">Rogue</option>
</select>
If you were referred to this game, input their name below:
<input type="text" name="Ref" />
<input type="submit" />
</form>
</BODY>
</HTML>
Then I have that script, the registration.php one.
Code:
<? php
$link = mssql_connect ('DCL','TMS','TMSMonkey');
if( !$link )
{
echo 'Something went wrong with SQL Server Connection.';
}
else
{
echo 'We\'d be registering someone right now with these credentials.';
echo $_GET["UNAME"];
echo $_GET["EMail"];
echo $_GET["CType"];
echo $_GET["Ref"];
}
mssql_close($link)
?>
My problem is this. Neither POST or GET will display the variables right. When I try to echo something like this:
Code:
echo '<p>' . $_GET["UNAME"] . '</p>'
I get
Code:
$_GET["UNAME"].
</p>
as output. When I just try the individual POST and GET's they give me a blank page. Yet, as seen in the URL being sent, the values are there. What's up with this?
Code:
file:///D:/Server/Webhome/testing%20grounds/registration.php?UNAME=Coop&EMail=X%40aol.com&CType=Warrior&Ref=Alzan
Microsoft Visual Basic 2008 Express Edition
.NET Framwork 3.5 Beta SP1
-
January 29th, 2009, 11:17 PM
#2
Re: Problem with Registration Form
Dear ccubed,
Looking at the link you have posted at the bottom - file:///D:/Server/Webhome/testing%20grounds/registration.php?UNAME=Coop&EMail=X%40aol.com&CType=Warrior&Ref=Alzan - it seems you are not trying to run your PHP code within a webserver environment. Please check that.
Pramod S Nair
-
January 29th, 2009, 11:56 PM
#3
Re: Problem with Registration Form
Even when done in an HTTP environment it doesn't work.
Code:
http://dcl/registration.php?UNAME=Coop&EMail=X%40aol.com&CType=Warrior&Ref=Alzan
Not sure if it matters, but i'm using the latest PHP on Windows IIS 7.
Microsoft Visual Basic 2008 Express Edition
.NET Framwork 3.5 Beta SP1
-
January 30th, 2009, 08:31 AM
#4
Re: Problem with Registration Form
It sounds as though you don't have PHP installed right. Have you gotten other PHP code to work? You can test your PHP installation by using <?php phpinfo(); ?>.
Or, if your installation is working properly, you can try using print_r($_POST); to assess the variables being passed.
And a little advice...When working with sensitive information, you should use POST and not GET. That way, other machines won't be able to sniff what that information is.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
January 30th, 2009, 10:10 AM
#5
Re: Problem with Registration Form
Originally Posted by PeejAvery
It sounds as though you don't have PHP installed right. Have you gotten other PHP code to work? You can test your PHP installation by using <?php phpinfo(); ?>.
Or, if your installation is working properly, you can try using print_r($_POST); to assess the variables being passed.
And a little advice...When working with sensitive information, you should use POST and not GET. That way, other machines won't be able to sniff what that information is.
The basic phpinfo function works fine, I can post the output from that if you want. Also, I completely plan on using POST, but at the moment GET allows me to debug for this problem easier because I can see that information is being passed. I also tried that print_r($_POST) and a print_r($_GET). Both of them resulted in a blank page.
Microsoft Visual Basic 2008 Express Edition
.NET Framwork 3.5 Beta SP1
-
January 30th, 2009, 10:33 AM
#6
Re: Problem with Registration Form
Is the following in your source code for the registration.php page just a typo? There should be no space there.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
January 30th, 2009, 10:36 AM
#7
Re: Problem with Registration Form
Originally Posted by PeejAvery
Is the following in your source code for the registration.php page just a typo? There should be no space there.
Oh, yeah, it's a typo. However, even changing that doesn't fix the problem.
Microsoft Visual Basic 2008 Express Edition
.NET Framwork 3.5 Beta SP1
-
January 30th, 2009, 10:54 AM
#8
Re: Problem with Registration Form
Problem solved. Apparently, There's a difference in how information is sent via URLs in a web environment and just the files. After changing the <?php thing and putting it in my webserver to test it works. Thanks for you help.
Microsoft Visual Basic 2008 Express Edition
.NET Framwork 3.5 Beta SP1
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|