-
Posts
2,527 -
Joined
-
Last visited
Everything posted by DeanWhitehouse
-
Contact Form Redirect to seperate Sites
DeanWhitehouse replied to cow1787's topic in PHP Coding Help
ahh yer soz, forgot one add this } before ?> -
Contact Form Redirect to seperate Sites
DeanWhitehouse replied to cow1787's topic in PHP Coding Help
ok, so now this is the correct code <? $name = $_POST['name']; $email = $_POST['email']; $subject = $_POST['subject']; $message=$_POST['message']; $send = $_POST['Send']; if ($send == "Yes") { //Mail the comment /* Specify your SMTP Server, Port and Valid From Address */ ini_set("SMTP","mail.marklemmons.com"); ini_set("smtp_port","25"); ini_set("sendmail_from", "mark@marklemmons.com"); //Specify where you want them email to be sent $to = 'mark@marklemmons.com'; $message = "Name: ".$name."\n Email: ".$email."\n Subject:".$subject."\n Message: ".$message; $headers = 'From: '.$email. "\r\n" . 'Reply-To: '.$email. "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); if($_SERVER['HTTP_HOST'] == "www.marklemmons.com"); { //code here header("Location: http://www.marklemmomns.com"); } if($_SERVER['HTTP_HOST'] == "www.mobile.marklemmons.com"); { //code here header("Location: http://mobile.marklemmons.com"); } ?> -
Contact Form Redirect to seperate Sites
DeanWhitehouse replied to cow1787's topic in PHP Coding Help
lol ,ok , now i see add a } just before ?> -
Contact Form Redirect to seperate Sites
DeanWhitehouse replied to cow1787's topic in PHP Coding Help
remove the else { } statment -
Contact Form Redirect to seperate Sites
DeanWhitehouse replied to cow1787's topic in PHP Coding Help
any where in the php, then run the php and tell me what it says -
Contact Form Redirect to seperate Sites
DeanWhitehouse replied to cow1787's topic in PHP Coding Help
no sorry like this echo $_SERVER['HTTP_HOST']; this will tell you what the host is, then we will go from there -
Contact Form Redirect to seperate Sites
DeanWhitehouse replied to cow1787's topic in PHP Coding Help
echo $_SERVER['HTTP_HOST']; -
hmm, ok, thanks for the help , i know someone who is setting up a linux server soon and he said i can install postfix on it, and i can use my current host to host the site.
-
Contact Form Redirect to seperate Sites
DeanWhitehouse replied to cow1787's topic in PHP Coding Help
echo out the host and see what it says on each one -
Will i need to host the site on the server aswell or can i have it on a seperate server.
-
Contact Form Redirect to seperate Sites
DeanWhitehouse replied to cow1787's topic in PHP Coding Help
yes the link should be in "site link" soz should of said -
designer needs help - will design in return ...
DeanWhitehouse replied to NOOB-DUDE's topic in PHP Coding Help
just a side note, i am pretty sure you did not design the site as i have seen that CSS template before, so i wouldn't offer designing work when you just use free internet code. -
Contact Form Redirect to seperate Sites
DeanWhitehouse replied to cow1787's topic in PHP Coding Help
put a ; at the end of the header -
Ok, from what i know i will need to have a server where i can store all the emails and download them and store all the email addresses. But that about all i know. I have an old comp , but it wouldn't read of disk, and my internet is not good enough to run a server, but how would i set up and smtp server?
-
Ok, i am making a mailing site a bit like hotmail, a few things i need to know. First how would i go about people setting up email accounts ?? I assume i would need my own server? Also how would i go about recieving email, what would i need to do this? So far all i have is a way to send email , using SMTP settings so they can be sent by anyone. Any help would be greatly apprieciated. Thanks, Blade
-
Contact Form Redirect to seperate Sites
DeanWhitehouse replied to cow1787's topic in PHP Coding Help
if($_SERVER['HTTP_HOST'] == http://usersite.com) { //code here header("Location:wherever") } if($_SERVER['HTTP_HOST'] == http://mobile.usersite.com) { //code here header("Location:wherever") } -
Ajax to always pull and display data??
DeanWhitehouse replied to DeanWhitehouse's topic in Javascript Help
Ok, thanks for the help and the example code. I have decided to go with an open source chat room. Ajax Chat. -
Contact Form Redirect to seperate Sites
DeanWhitehouse replied to cow1787's topic in PHP Coding Help
you could detect the host and then send based on that. the host would be mobile.site.com for the mobile one. to detect the host do $_SERVER['HTTP_HOST']; -
Well there is alot of code (i am coding). This is the code that is checking for the session <?php if(isset($_SESSION['logchat'])) { ?> <a href="?logout" id="nav">Logout</a> <?php } else { ?> <a href="login" id="log" onClick="return dropdownmenu(this, event, menu2, '70px')" onMouseout="delayhidemenu()">Login</a> <a id="log" href="">Register</a> <?php } ?> and the session is set by ajax (i think) and there is alot of code, but the session is there and is called logchat.
-
Ajax to always pull and display data??
DeanWhitehouse replied to DeanWhitehouse's topic in Javascript Help
will this always be updating though?? Or will they have to refresh the page? -
I have just started to learn AJAX and i am making a chatroom the problem i am having is on how to pull data from the php file and display the data inside another page, and how to show current data, as it will continuosly be changing. Any one know how to do this, the most i have been able to do so far is display data inside a input field from a php file.
-
to protect from XSS (i think) use htmlspecialchars or htmlentities can't remeber which.soz.
-
mysql_real_escape_string
-
I think you should change this <?php error_reporting(E_ALL); //session name grab and page auth session_start(); $usernamesession = $_SESSION['Username']; if(!session_is_registered(myusername)){ header("location:index.html"); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Members Page</title> <style type="text/css"> <!-- body { background-color: #666666; } --> </style></head> <body> <p> <?php //Includes include 'Libary/opendb.php'; //Main query for user info $query = "SELECT Username, Age, Sex, Location, Picture FROM usersinfo WHERE Username ='$usernamesession'"; $result = mysql_query($query) or die(mysql_error()); //Place query data into variables $row = mysql_fetch_assoc($result) or die(mysql_error()); //changed// extract($row, EXTR_PREFIX_SAME, "prefix123"); ?> </p> <table width="257" border="1"> <tr> <td colspan="2"><img src="<?php echo $Picture; ?>"/></td> </tr> <tr> <td width="133">Username</td> <td width="108"><?php echo $row['Username']; ?> </td><!-- This should echo out like this, and not a variable like before as the variable wasn't set--> </tr> <tr> <td>Age:</td> <td><?php echo $Age; ?> </td> </tr> <tr> <td>Sex:</td> <td><?php echo $Sex; ?> </td> </tr> <tr> <td>Location:</td> <td><?php echo $Location; ?> </td> </tr> </table> <?php include 'Libary/closedb.php'; ?> <p> </p> </body> </html>