This is one page one
Code: Select all
<form action="SendArticle2.php" method="post" name="alice">
<input type="SUBMIT" value="Submit">
<script language="JavaScript">var theSpot=document.URL; document.write("<input type='hidden' name='place' value='"+theSpot+"'>"); document.write(theSpot);</script>
</form>(I tried using "REFERER" on page two but I couldn't get it to work. But that's another story. If your interested I'll tell you about it)
Okay so "the Spot" is passed on to page two like this :
Code: Select all
<?php
/* validation.php */
require_once ('functions.php');
$valid = TRUE;
$whatEver = $_POST['place'];
$monkey = $whatEver;
echo "$monkey";Code: Select all
if (isset ($_POST['submit']) {
foreach($_POST as $key=>$value) {
$$key = $value;
}
$valid = $rn = checkLength($rname, 1, 30);
$rem = checkEmail($remail);
$valid = $valid && $rem;
$sn = checkLength($sname, 1, 30);
$valid = $valid && $sn;
$sem = checkEmail($semail);
$valid = $valid && $sem;
if ($valid) {
sendArticle();
}
} else {
$rn = $sn = $sem = $rem = TRUE;
$rname = $sname = $semail = $remail;
}Code: Select all
function sendArticle(){
global $whatEver, $monkey, $rname, $remail, $sname, $semail, $comment;
$origin=$_SERVER["HTTP_REFERER"];
$Message = "Hello,\n$sname, thought you would be interested in this article at rwyouth.com \n\n $monkey \n\n Comment: $comment";
$ToSubject = "$rname, I found this great article at RWYouth.com.";
echo "<span class="boldblack">Your Email Was Sent! $monkey <br> Send Another?</span>";
echo "$monkey";
mail($rname." <".$remail.">",$ToSubject, $Message, "From: ".$sname." <".$semail.">");
}