Suchy Posted June 17, 2007 Share Posted June 17, 2007 Since the mail function is not working on my main server I am trying to pull-off something like this to send sms: Function on server where the website is <?php if($_POST) { $to = mysql_real_escape_string ($_POST['to']) . "@_______" ; $text = mysql_real_escape_string ($_POST['text']); $from = mysql_real_escape_string($_POST['from']) . " writes: "; // add info to db - THIS WORKS $query = "INSERT INTO sms ....." ; $result = .....; $entriesResults = ...; $_SESSION['sms_to'] = $to; $_SESSION['sms_text'] = $text; $_SESSION['sms_from'] = $from; ?> <iframe src ="http://www.____/sms.php" width="1" height="1" > </iframe> <?php } ?> Page sms.php on a different server <?php session_start; $sms_to = $_SESSION['sms_to']; $sms_from = $_SESSION['sms_from']; $sms_text = $_SESSION['sms_text']; mail($sms_to, $sms_from, $sms_text, "From: J <a@abc.com>"); ?> But this is not working. How can I fix this so that the info is passed to the server with the sms.php page Quote Link to comment https://forums.phpfreaks.com/topic/55892-sessions-on-different-servers/ Share on other sites More sharing options...
wildteen88 Posted June 17, 2007 Share Posted June 17, 2007 You cannot use sessions on different servers. When you use an iframe that is a sperate instance of PHP. The PHP code is parsed on the site the iframe is serving. Not the site that has the iframe on it. You will probably want to look in cURL for what you are trying to do. Quote Link to comment https://forums.phpfreaks.com/topic/55892-sessions-on-different-servers/#findComment-276228 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.