Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 3643 | Replies: 4
![]() |
•
•
Join Date: Jan 2005
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
hi
i've just started learning PHP.
i have downloaded phptriad 4.1 so that i can use php without uploading it to server.
For my feedback html file, i put:
<html>
<head>
<title>TAEKWONDO WEBSITE - Membership Form</title>
</head>
<body>
<font face="arial" size="4">
<p align="center"><big>Membership Form</big></p>
Please Fill In Your Details And Click Submit:
<br />
<fieldset><legend align="center">Personal Information</legend>
<form action="membership_form2.php" method="get">
First Name:<input type="text" name="name" size="10"/>
</fieldset>
</form>
</body>
</html>
FOR MY PHP FILE I PUT:
<html>
<head>
<title>TAEKWONDO WEBSITE - Membership Form</title>
</head>
<body>
<?php
ini_set ('display_errors',1);
register_globals
print "{$HTTP_GET_VARS['name']}";
?>
</body>
</html>
SAVED PHP AS membership_form2.php & put all in same directory.
When i test it by filling in form & submit, Nothing appears its just a blank page?????????
any ideas?
mark
:eek:
i've just started learning PHP.
i have downloaded phptriad 4.1 so that i can use php without uploading it to server.
For my feedback html file, i put:
<html>
<head>
<title>TAEKWONDO WEBSITE - Membership Form</title>
</head>
<body>
<font face="arial" size="4">
<p align="center"><big>Membership Form</big></p>
Please Fill In Your Details And Click Submit:
<br />
<fieldset><legend align="center">Personal Information</legend>
<form action="membership_form2.php" method="get">
First Name:<input type="text" name="name" size="10"/>
</fieldset>
</form>
</body>
</html>
FOR MY PHP FILE I PUT:
<html>
<head>
<title>TAEKWONDO WEBSITE - Membership Form</title>
</head>
<body>
<?php
ini_set ('display_errors',1);
register_globals
print "{$HTTP_GET_VARS['name']}";
?>
</body>
</html>
SAVED PHP AS membership_form2.php & put all in same directory.
When i test it by filling in form & submit, Nothing appears its just a blank page?????????
any ideas?
mark
:eek:
•
•
Join Date: Oct 2004
Location: San Francisco, CA
Posts: 338
Reputation:
Rep Power: 5
Solved Threads: 2
maybe try this instead:
echo $_GET['name'];
instead of
depending on what version of php you are usign you may just be able to use $_GET instead of $HTTP_GET_VARS
i sure hope that works!
echo $_GET['name'];
instead of
<html>
<head>
<title>TAEKWONDO WEBSITE - Membership Form</title>
</head>
<body>
<?php
ini_set ('display_errors',1);
//globals are usually on by default
echo $_GET['name'];
?>
</body>
</html>depending on what version of php you are usign you may just be able to use $_GET instead of $HTTP_GET_VARS
i sure hope that works!
•
•
Join Date: Jan 2005
Location: "New York New York it's a hell of a town"
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
Crippz:
Obtaining POST and GET vars in PHP is pretty easy.
Try replacing:
ini_set ('display_errors',1);
register_globals
print "{$HTTP_GET_VARS['name']}";
with
print($GLOBALS['HTTP_GET_VARS']['name']);
If that does work, just for kicks, try this as well:
print($name);
Good luck!
Obtaining POST and GET vars in PHP is pretty easy.
Try replacing:
ini_set ('display_errors',1);
register_globals
print "{$HTTP_GET_VARS['name']}";
with
print($GLOBALS['HTTP_GET_VARS']['name']);
If that does work, just for kicks, try this as well:
print($name);
Good luck!
•
•
•
•
Originally Posted by crippz
hi
i've just started learning PHP.
i have downloaded phptriad 4.1 so that i can use php without uploading it to server.
For my feedback html file, i put:
<html>
<head>
<title>TAEKWONDO WEBSITE - Membership Form</title>
</head>
<body>
<font face="arial" size="4">
<p align="center"><big>Membership Form</big></p>
Please Fill In Your Details And Click Submit:
<br />
<fieldset><legend align="center">Personal Information</legend>
<form action="membership_form2.php" method="get">
First Name:<input type="text" name="name" size="10"/>
</fieldset>
</form>
</body>
</html>
FOR MY PHP FILE I PUT:
<html>
<head>
<title>TAEKWONDO WEBSITE - Membership Form</title>
</head>
<body>
<?php
ini_set ('display_errors',1);
register_globals
print "{$HTTP_GET_VARS['name']}";
?>
</body>
</html>
SAVED PHP AS membership_form2.php & put all in same directory.
When i test it by filling in form & submit, Nothing appears its just a blank page?????????
any ideas?
mark
:eek:
•
•
Join Date: Aug 2004
Location: North Carolina
Posts: 27
Reputation:
Rep Power: 5
Solved Threads: 2
Your Form Below:
[html]
<html>
<head>
<title>TAEKWONDO WEBSITE - Membership Form</title>
</head>
<body>
<font face="arial" size="4">
<p align="center"><big>Membership Form</big></p>
Please Fill In Your Details And Click Submit:
<br />
<fieldset><legend align="center">Personal Information</legend>
<form action="membership_form2.php" method="get">
First Name:<input type="text" name="name" size="10"/>
</fieldset>
<input type="submit" name ="submit" value="Send">
</form>
</body>
</html>
[/html]
membership_form2.php Below:
[php]
<html>
<head>
<title>TAEKWONDO WEBSITE - Membership Form</title>
</head>
<body>
<?php
error_reporting(1); // Error reporting set @ 1
/* I submitted a code snippet at this forum concerning register_globals = off >> You can read it at : http://www.daniweb.com/code/snippet484.html */
if (!ini_get('register_globals')) {
$superglobals = array($_SERVER, $_ENV,
$_FILES, $_COOKIE, $_POST, $_GET);
if (isset($_SESSION)) {
array_unshift($superglobals, $_SESSION);
}
foreach ($superglobals as $superglobal) {
extract($superglobal, EXTR_SKIP);
}
ini_set('register_globals', true);
}
print "$name";
?>
</body>
</html>
[/php]
[html]
<html>
<head>
<title>TAEKWONDO WEBSITE - Membership Form</title>
</head>
<body>
<font face="arial" size="4">
<p align="center"><big>Membership Form</big></p>
Please Fill In Your Details And Click Submit:
<br />
<fieldset><legend align="center">Personal Information</legend>
<form action="membership_form2.php" method="get">
First Name:<input type="text" name="name" size="10"/>
</fieldset>
<input type="submit" name ="submit" value="Send">
</form>
</body>
</html>
[/html]
membership_form2.php Below:
[php]
<html>
<head>
<title>TAEKWONDO WEBSITE - Membership Form</title>
</head>
<body>
<?php
error_reporting(1); // Error reporting set @ 1
/* I submitted a code snippet at this forum concerning register_globals = off >> You can read it at : http://www.daniweb.com/code/snippet484.html */
if (!ini_get('register_globals')) {
$superglobals = array($_SERVER, $_ENV,
$_FILES, $_COOKIE, $_POST, $_GET);
if (isset($_SESSION)) {
array_unshift($superglobals, $_SESSION);
}
foreach ($superglobals as $superglobal) {
extract($superglobal, EXTR_SKIP);
}
ini_set('register_globals', true);
}
print "$name";
?>
</body>
</html>
[/php]
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)





Linear Mode