Jump to content

Self submittal without using forms


saritor

Recommended Posts

Hi there, I am somewhat new to php and sadly Google is not being helpful at the moment. So here goes my question: Is it possible to submit or call a php page on itself via a URL without having to use any forms or submit buttons, or at least the buttons?

 

Essentially what I am trying to do with my page is have a menu listing of directories that you can browse via a browser, and want to give the user the option of either clicking a link to redirect them to that particular folder (yes only doable in IE, I know =p) or to click a second link which will call the page on itself using a mysql query to find the subdirectories of that folder. Its sort of a confusing situation if so I need to clarify more I can.

Link to comment
Share on other sites

Sure, to submit a form like this:

 

<form id="custForm" name="custForm" method="post" action="formpage.php">
First Name:
<input type="text" name="firstName" value="" />
<br><br>
Last Name:
<input type="text" name="lastName" value="" />
<br><br>
<input type="hidden" name="custForm" value="submit" /><input name="submit" type="submit" id="submit" value="Search" /></td>
</form>

 

You would just do:

http://yourdomain.com/formpage.php?custForm=submit

 

If you want to fill in fields in the form above, you would use:

http://yourdomain.com/formpage.php?custForm=submit&firstName=john&lastName=smith

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.