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
https://forums.phpfreaks.com/topic/64659-self-submittal-without-using-forms/
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.