Jump to content
Larry Ullman's Book Forums

Recommended Posts

The book won't get here until sometime tomorrow but I was able to get through chapter one via Kindle without a problem.  I created a PHP file with the following HTML form in the beginning:

<h3>Committee Volunteer Application</h3>
<h4>Enter your Faculty ID</h4>
<form method="post">
ID: <input name="soarid" type = "text" />
<input type = "submit" value "Go" />
</form>

 

This was followed by PHP code that is to act upon the submitted value.  However, the script does not wait for the form to be submitted but continues to execute.  How do I make it wait for the submit button?

 

BTW, separating this code into its own HTML file, it will run a separate PHP file when called by the form.

Share this post


Link to post
Share on other sites

Hello! I'm not quite following what you mean about the script not waiting for the for to be submitted. Could you explain in more detail or provide more code? Thanks!

Share this post


Link to post
Share on other sites

I created a PHP file that requests a login name with an HTML form that uses the POST action.  Immediately following this form, I open a database and select that name within a PHP section.  The form doesn't wait for an entry & a "submit" click to serve up that name to the PHP select.  It runs the select code immediately and then reruns it after the submit click.

 

BTW, I loved chapter one via Kindle.  The hard copy is coming today.

Share this post


Link to post
Share on other sites

Good question! Generally you want to specify an action value but if you don't the form will be submitted back to the same page.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...