Forum Moderators: phranque
EX. 123
and have the form direct them to
www.mysite.com/123.html
or even
www.mysite.com/123/index.html
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
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.
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
this is what i have come up with so far
<!-- PHP Processor -->
<?php
$WOnumber = check_input($_POST['WOnumber']);
?><html>
<body>Please click the link below to view the progress of your repair<br>
<br>
<a href="http://www.mysite.com/<?php echo $WOnumber; .htm><br />
<br />
</body>
</html>
<!-- Form code -->
<html>
<body>
<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>
</form></body>
</html>
<!-- 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...]
THANKS SOOOOOO MUCH YOU JUST SAVED MY JOB
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
<?php
$workorder = check_input($_POST['workorder']);
?>
<html>
<body>Please click the link to see progress [mysite.com...] echo $workorder; ?>.htm<br />
</body>
</html>
<?php
function check_input($data)
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
HTML Form
<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>
</form>