Jump to content

Generate URL from form input


Icarus050

Recommended Posts

Hello, I'm sure this is a simple enough request, but my noob flag is flapping all over the place so I have no idea how to implement the scripts I've found :)

 

I want to have people be able to modify two aspects of an existing search string via a web based form.

 

The gist of the URL I'm looking to generate is:

/Search/Results.html?Query=Queue = 'My Queue' AND Status != 'resolved' AND Content LIKE 'smith' AND Subject LIKE 'application' &Rows=50

 

I want the 'application' part to be able to be changed via a dropdown with three options (application, configuration and task) and the 'smith' to be based off a text entry.

 

I don't have a great deal of access to the back end so I'm really looking for something in page to complete the task.

 

Cheers.

Ic.

Link to comment
https://forums.phpfreaks.com/topic/99479-generate-url-from-form-input/
Share on other sites

<form mode=get action=/Search/Results.html>
  <input type=checkbox name=Status>
  <input type=hidden name=Queue value="My Queue">
  <select name=task>
    <option value="application">Application</option>
    <option value="configuration">Configuration</option>
    <option value="task">Task</option>
  </select>
  <input type=text name="Content">
  <input type=text name="Subject">
  <input type=submit name=submit>
  <input type=reset name="reset">
</form>

 

Here's a form--try it and see what kind of URL it generates.

 

To retrieve the values, use the $_GET array:

 

$subject = $_GET['Subject'];

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.