Switching site locations

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Meztel33
Forum Newbie
Posts: 1
Joined: Tue Mar 24, 2009 3:59 pm

Switching site locations

Post by Meztel33 »

I'm switching our web site from current location to our dedicated server. None of the current php on the site seems to work on the new server, although basic testing shows php and mysql in place. Finally built a basic form for testing. Works perfectly on old location, doesn't recognize anything being inserted into fields on new server. Always get the error message for both name and email, no matter if one, both or neither are filled out. Any help would be greatly appreciated. Thanks!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>T3</title>
<?php

// Checking if name is inserted
if(!$Name){
$error .= "You forgot to enter your name. Please go back and fill out the entire form. <br>";
}
// Checking if email is inserted
if(!$Email){
$error .= "You forgot to enter your email. Please go back and fill out the entire form. <br>";
}
// End T3 validation
if($error){
echo("Error : $error <br>");
echo('<a href="javascript:history.back(1)">Back to support page</a> <br>');
exit;
}

?>
<tr bgcolor="#12499B">
<td width="100%" height="95" bgcolor="#FFFFFF"><p align="center" class="style2">&nbsp;</p>
<p align="center" class="style2">Thank you for contacting T3 support.</p>
<p align="center" class="style2">We have received your question, and a T3 representative will contact you shortly.&nbsp;
In the meantime, we encourage you to read through the FAQ's below.&nbsp;
It's likely you will find your answer right there. </p>
<p align="center" class="style2">&nbsp; </p></td>
</tr>


</body>
</html>
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Switching site locations

Post by requinix »

The $Name and $Email variables won't be created automatically. You have to do it yourself.

Code: Select all

$Name = $_POST["Name"];
$Email = $_POST["Email"];
Or use $_GET, depending what the form's method was.

See also: this.
Post Reply