Welcome to WebmasterWorld Guest from

Forum Moderators: phranque

Message Too Old, No Replies

Generate Link using HTML form



4:26 pm on Oct 15, 2009 (gmt 0)

5+ Year Member

i'm looking for a way to make a form that a customer will enter a work order # into

EX. 123

and have the form direct them to

or even

i have tried using the "GET" method but i cant get it working

does it require a GCI script to process?

is there anyway around that

thanks for reading i look foward to a responce


6:22 pm on Oct 15, 2009 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Welcome aboard foxxchaser, there are probably a lot of ways to do this but here is how I would do it.

I would indeed use a dynamic scripting language like Perl or PHP. Enter 123, form posts to a script, the script creates "123.html" out of the input, first checks to make sure 123.html exists, if it exists, redirect to it. If it does not exist, re-output the form from within this script with the message that the resource doesn't exist, try again.

You could do the same thing with a bit of Javascript in which case no server side scripting is required, but the problem there is that it doesn't work if JS is disabled.

A third possibility is to manage the entire process within an .htaccess file using mod_rewrite directives and the same logic.

i have tried using the "GET" method

With what technology/language receiving it?

<form method="get" action="test.php">

Will capture $_REQUEST or $_GET input,

<form method="post" action="test.php">

Will capture $_REQUEST or $_POST input.


4:20 am on Oct 16, 2009 (gmt 0)

5+ Year Member

Thanks for the info i would like to go with the Php option because some of our users will be on computers that may have JS disabled.

the only problem is i don't know where to start

i have a server that will handel the processing at a diffrent domain

could you direct me to a place with some example php code so i can get started writing the processing script

Thanks for your quick reply

-Vincent Ellis


5:13 am on Oct 16, 2009 (gmt 0)

5+ Year Member

i've been messing around with the code

this is what i have come up with so far

<!-- PHP Processor -->
$WOnumber = check_input($_POST['WOnumber']);
<body>Please click the link below to view the progress of your repair<br>

<a href="http://www.mysite.com/<?php echo $WOnumber; .htm><br />
<br />

<!-- Form code -->
<form action="http://www.my-php-server/test.php" method="post">
<p>Workorder #: <input type="text" name="WOnumber" /><br />
<p><input type="submit" value="Submit"></p>

<!-- Error i keep getting -->

Parse error: syntax error, unexpected '.' in /mnt/Web/test.php on line 7

Well i kept messin with it and i got it to do this

Please click the link to see progress [mysite.com...]


if you ever need any computer help just contact me and i will help in any way i can

my e-mail address is help@elliscomputerdesign.com

<!-- This was the final code i used -->

PHP Processor

$workorder = check_input($_POST['workorder']);


<body>Please click the link to see progress [mysite.com...] echo $workorder; ?>.htm<br />

function check_input($data)
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;


<form action="http://www.mt-php-server/test.php" method="post">
<p>Please enter Workorder number<input type="text" name="workorder" /><br>

<p><input type="submit" value="Send it!"></p>


7:04 pm on Oct 16, 2009 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Wow, for someone who doesn't know where to start it looks like you just about got it! Just create a link, like this

<p>Please click the link to see progress: <a href="http://www.mysite.com/<?php echo $workorder;?>.htm"><?php echo $workorder;?>.htm</a></p>


Featured Threads

Hot Threads This Week

Hot Threads This Month