469,575 Members | 1,668 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,575 developers. It's quick & easy.

Undefined index

i have two file with jobapp.html calling jobapp_action.php
<HTML>
<!-- jobapp.html -->
<BODY>
<H1>Phop's Bicycles Job Application</H1>
<P>Are you looking for an exciting career in the world of cyclery?
Look no further!
</P>
<FORM NAME='frmJobApp' METHOD=post ACTION="jobapp_action.php">
Please enter your name:
<INPUT NAME="applicant" TYPE="text"><BR>
<INPUT NAME="enter" TYPE="submit" VALUE="Enter">
</FORM>
</BODY>
</HTML>
<HTML>
<!-- jobapp_action.php -->
<BODY>
<P>Welcome <?php echo ($_GET[applicant]); ?>!</P>
</BODY>
</HTML>

but it return

Welcome
Notice: Undefined index: applicant in c:\inetpub\wwwroot\jobapp_action.php on line 4
!
Jul 16 '05 #1
2 105969
You're using the 'post' method to post to frmJobApp, so you need to use
$_POST[applicant] rather than $_GET (or use method="get" rather than
method="post").

MK.

sky2070 wrote:
i have two file with jobapp.html calling jobapp_action.php
<HTML>
<!-- jobapp.html -->
<BODY>
<H1>Phop's Bicycles Job Application</H1>
<P>Are you looking for an exciting career in the world of cyclery?
Look no further!
</P>
<FORM NAME='frmJobApp' METHOD=post ACTION="jobapp_action.php">
Please enter your name:
<INPUT NAME="applicant" TYPE="text"><BR>
<INPUT NAME="enter" TYPE="submit" VALUE="Enter">
</FORM>
</BODY>
</HTML>
<HTML>
<!-- jobapp_action.php -->
<BODY>
<P>Welcome <?php echo ($_GET[applicant]); ?>!</P>
</BODY>
</HTML>

but it return

Welcome
Notice: Undefined index: applicant in c:\inetpub\wwwroot\jobapp_action.php on line 4
!


--
MeerKat

Jul 16 '05 #2
sk***********@hotmail.com (sky2070) schrieb:
[File 1]
<FORM NAME='frmJobApp' METHOD=post ACTION="jobapp_action.php">
Please enter your name:
<INPUT NAME="applicant" TYPE="text"><BR>
<INPUT NAME="enter" TYPE="submit" VALUE="Enter">
</FORM>
[File 2]
<P>Welcome <?php echo ($_GET[applicant]); ?>!</P>

Welcome Notice: Undefined index: applicant in c:\inetpub\wwwroot\jobapp_action.php on line 4 !


You're using POST, not GET. So the data should be in $_POST["applicant"]
(and not in $_GET["applicant"] or $_POST[applicant]).

Matthias
Jul 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by lawrence | last post: by
5 posts views Thread by news.bigpond.com | last post: by
4 posts views Thread by John Oliver | last post: by
3 posts views Thread by number1yan | last post: by
3 posts views Thread by razvanel442 | last post: by
3 posts views Thread by mediator | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.