HTML Form question
- Started
- Last post
- 12 Responses
- hubb7designs
I have created a form that people will fill out before they can download a PDF whitepaper.
The form is within a lightbox, and I want them to fill out the form in the lightbox, and then when they click submit, I want them to go to a new page to see the PDF.
Right now my redirect is like this:
<input type="hidden" name="redirect" value="documentation/Best Practices for Incoming Call Recovery v. 1.0.pdf" />
But when they hit submit, they go to the PDF in the lightbox and it's REALLY small.
Any way to have the redirect go to a new page?
- SteveJobs0
window.location?
- welded0
http://www.htmlcodetutorial.com/…
Using target="_blank" should work.
- Worked perfectly.
Thank you
hubb7designs - loll..... wow.d_rek
- Worked perfectly.
- hubb7designs0
Part 2 of my question:
So now I'm trying to have this form in a lightbox collect my user's name and email address.
After the user enters in this information, I would like the form to redirect the user to a different website of one of my vendors.
Here is the form code:
<form action="/gdform.php" method="post" target="_blank" onsubmit="return validate_form(this);">
<input type="hidden" name="subject" value="Linked to Telecom Recovery" />
<input type="hidden" name="redirect" value="http://www.telecomrecovery.com/" />
<p><small>Name:</small> <input type="text" name="name" id="name" /></p>
<p><small>Email Address:</small> <input type="text" name="email" id="email" /></p>
<input type="submit" name="submit" id="submit" value="Link to Telecom Recovery" />
</form>But instead of the user going to http://www.telecomrecovery.com/ the form is sending them to:
http://www.MYWEBSITE.net/http://…
How can I have the redirect NOT include my website's url?
- hubb7designs0
bump.... please help.
- acescence0
you need to edit whatever script is processing your form
- sherm0
whats to stop a saavy person from just viewin ur source instead of allowing u to collect their info?
- hubb7designs0
Most people aren't so savy... if they are, then I would think they've earned it.
- hubb7designs0
I'm using GoDaddy's gdfrom.php:
<?php session_start(); ?>
<?php
$request_method = $_SERVER["REQUEST_METHOD"];
if($request_method == "GET"){
$query_vars = $_GET;
} elseif ($request_method == "POST"){
$query_vars = $_POST;
}
reset($query_vars);
$t = date("U");$file = $_SERVER['DOCUMENT_ROOT'] . "/../data/gdform_" . $t;
$fp = fopen($file,"w");
while (list ($key, $val) = each ($query_vars)) {
fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\n");
fputs($fp,"$val\n");
fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\n");
if ($key == "redirect") { $landing_page = $val;}
}
fclose($fp);
if ($landing_page != ""){
header("Location: http://".$_SERVER["HTT…...
} else {
header("Location: http://".$_SERVER["HTT…...
}
include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';$securimage = new Securimage();
if ($securimage->check($_POST['capt... == false) {
// the code was incorrect
// handle the error accordingly with your other error checking// or you can do something really basic like this
die('The code you entered was incorrect. Go back and try again.');
}
?>
- BattleAxe0
remove the http://".$_SERVER part from the header redirect and just leave http://thewebsiteurlyouwant.com
- BattleAxe0
should look like this
Header ( "location: http://website.com " );
- acescence0
header("Location:$landing_page...
if you want it to read the redirect field and be useful beyond this particular application
- hubb7designs0
@acescence
You are 100% correct. This worked exactly as I needed. Thank you!
I really do appreciate everyone taking some time away from the iPhone 4G thread to help :0