PHP - Send Variables
sorry there is so much code, but how can I make it so that the flash upload piece of this will be able to send variables, such as file name, to upload-file.php.....so that things can go into my database. does this make sense? if you need a working example, tell me and I will send you a PM with the address (don't want too many people knowing where this happens at......
Code: [Select] <!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=utf-8" /> <title>Multiple File Upload With Progress Bar - Web Developer Plus Demos</title> <script type="text/javascript" src="js/jquery-1.3.2.js"></script> <script type="text/javascript" src="js/swfupload/swfupload.js"></script> <script type="text/javascript" src="js/jquery.swfupload.js"></script> <script type="text/javascript"> $(function(){ $('#swfupload-control').swfupload({ upload_url: "upload-file.php", file_post_name: 'uploadfile', file_size_limit : "9000000000000000000000000000", file_types : "*", file_types_description : "Image files", file_upload_limit : 1000, flash_url : "js/swfupload/swfupload.swf", button_image_url : 'js/swfupload/wdp_buttons_upload_114x29.png', button_width : 114, button_height : 29, button_placeholder : $('#button')[0], debug: false }) .bind('fileQueued', function(event, file){ var listitem='<li id="'+file.id+'" >'+ 'File: <em>'+file.name+'</em> ('+Math.round(file.size/1024)+' KB) <span class="progressvalue" ></span>'+ '<div class="progressbar" ><div class="progress" ></div></div>'+ '<p class="status" >Pending</p>'+ '<span class="cancel" > </span>'+ '</li>'; $('#log').append(listitem); $('li#'+file.id+' .cancel').bind('click', function(){ var swfu = $.swfupload.getInstance('#swfupload-control'); swfu.cancelUpload(file.id); $('li#'+file.id).slideUp('fast'); }); // start the upload since it's queued $(this).swfupload('startUpload'); }) .bind('fileQueueError', function(event, file, errorCode, message){ alert('Size of the file '+file.name+' is greater than limit'); }) .bind('fileDialogComplete', function(event, numFilesSelected, numFilesQueued){ $('#queuestatus').text('Files Selected: '+numFilesSelected+' / Queued Files: '+numFilesQueued); }) .bind('uploadStart', function(event, file){ $('#log li#'+file.id).find('p.status').text('Uploading...'); $('#log li#'+file.id).find('span.progressvalue').text('0%'); $('#log li#'+file.id).find('span.cancel').hide(); }) .bind('uploadProgress', function(event, file, bytesLoaded){ //Show Progress var percentage=Math.round((bytesLoaded/file.size)*100); $('#log li#'+file.id).find('div.progress').css('width', percentage+'%'); $('#log li#'+file.id).find('span.progressvalue').text(percentage+'%'); }) .bind('uploadSuccess', function(event, file, serverData){ var item=$('#log li#'+file.id); item.find('div.progress').css('width', '100%'); item.find('span.progressvalue').text('100%'); var pathtofile='<a href="uploads/'+file.name+'" target="_blank" >view »</a>'; item.addClass('success').find('p.status').html('Done!!! | '+pathtofile); }) .bind('uploadComplete', function(event, file){ // upload has completed, try the next one in the queue $(this).swfupload('startUpload'); }) }); </script> <style type="text/css" > #swfupload-control p{ margin:10px 5px; font-size:0.9em; } #log{ margin:0; padding:0; width:500px;} #log li{ list-style-position:inside; margin:2px; border:1px solid #ccc; padding:10px; font-size:12px; font-family:Arial, Helvetica, sans-serif; color:#333; background:#fff; position:relative;} #log li .progressbar{ border:1px solid #333; height:5px; background:#fff; } #log li .progress{ background:#999; width:0%; height:5px; } #log li p{ margin:0; line-height:18px; } #log li.success{ border:1px solid #339933; background:#ccf9b9; } #log li span.cancel{ position:absolute; top:5px; right:5px; width:20px; height:20px; background:url('js/swfupload/cancel.png') no-repeat; cursor:pointer; } </style> </head> <body> <h3>» Multiple File Upload With Progress Bar</h3> <div id="swfupload-control"> <p> </p> <input type="button" id="button" /> <p id="queuestatus" ></p> <ol id="log"></ol> </div> </body> </html> Similar TutorialsThis will only send 1 goggles information into the database but I have a "adding" page that can actually add more than 1 goggles at once. I have no idea how to go about saving multiple goggle's information using array or loop. $name= $_POST['goggles_name']; $price = $_POST['goggles_price']; $des = $_POST['goggles_description']; $file = $_FILES['goggles_image']['name']; $chkbox = $_POST['upload']; $id = $_POST['goggles_id']; $query = "UPDATE goggles SET goggles_name = '$name' , goggles_price = '$price' ,goggles_description = '$des' WHERE goggles_id ='".$id."' "; $result = mysqli_query($link, $query) or die(mysqli_error($link)); OK, I think this should belong on this board. I am trying to write something that does the following (simplified for ease of understanding): User has signed into my website and has a session variable with their user id in it. There is a table in the mySQL databse that contains details about the user. (this part is already working) User wants to pay for a trip, so clicks a customised Paypal button that takes him to the Paypal site. The item has an trip id associated with it. Once the transaction has been completed, I want to feed information back to my website, and insert the 'item id' and 'user id' into a field in a table in the database. Any idea how I might do this!? Whilst I have a basic script that will insert a row into my table, it relies on variables being sent from the page it is on, thus will not work when the user is redirected to Paypal, as I cannot find a way to send variables to paypal about the item, and then have them send it back to me once the transaction is complete. My PHP is self-taught so sorry if this way of doing things seems a bit scrappy. As the topic sais i have a problem trying to send variables to a javascript popup window, i think the problem is on line 38. I would very much appreciate some help Code: [Select] <html> <head> <script type="text/javascript"> function newPopup(url) { popupWindow = window.open(url,'popUpWindow','height=700,width=400,left=10,top=10,resizable=no,scrollbars=no,toolbar=yes,menubar=no,location=no,directories=no,status=yes') } </script> </head> <?php error_reporting(E_ALL); require_once 'GameQ.php'; $servers = array( 'server 1' => array('cs', 'd2o.warzone.nu', '27015'), 'server 2' => array('cs', 'd2o.warzone.nu', '27017'), 'server 3' => array('cs', 'wc3.warzone.nu', '27017'), 'server 4' => array('cs', 'aim.warzone.nu', '27015'), 'server 5' => array('cs', '83.255.249.204', '27025'), 'server 6' => array('tf2', 'tf2.warzone.nu', '27015'), 'server 7' => array('tf2', '83.255.249.200', '27015'), 'server 9' => array('cssource', 'css.warzone.nu', '27015'), 'server 10' => array('cssource', 'css.warzone.nu', '27017') ); $gq = new GameQ(); $gq->addServers($servers); $gq->setOption('timeout', 200); $gq->setFilter('normalise'); $gq->setFilter('sortplayers', 'gq_ping'); $results = $gq->requestData(); echo "<a href='steam://connect/d2o.warzone.nu:27015'>" . $results["server 1"]['gq_hostname'] . "</a><p>"; echo $results["server 1"]['gq_mapname'] . "<br>"; echo $results["server 1"]['gq_numplayers'] . "/" . $results["server 1"]['gq_maxplayers']; ?> // I think the problem is the line below this one <a href='JavaScript:newPopup("players.php?address=<?php echo="$results['server 1']['gq_address']"; ?>&port=<?php echo="$results['server 1']['gq_port']"; ?>");'> players online </a>"; <?php echo "<p><p>"; echo "<a href='steam://connect/d2o.warzone.nu:27017'>" . $results["server 2"]['gq_hostname'] . "</a><p>"; echo $results["server 2"]['gq_mapname'] . "<br>"; echo $results["server 2"]['gq_numplayers'] . "/" . $results["server 2"]['gq_maxplayers'] . " players online <p>"; echo "<p><p>"; echo "<a href='steam://connect/wc3.warzone.nu:27017'>" . $results["server 3"]['gq_hostname'] . "</a><p>"; echo $results["server 3"]['gq_mapname'] . "<br>"; echo $results["server 3"]['gq_numplayers'] . "/" . $results["server 3"]['gq_maxplayers'] . " players online <p>"; echo "<p><p>"; echo "<a href='steam://connect/aim.warzone.nu:27015'>" . $results["server 4"]['gq_hostname'] . "</a><p>"; echo $results["server 4"]['gq_mapname'] . "<br>"; echo $results["server 4"]['gq_numplayers'] . "/" . $results["server 4"]['gq_maxplayers'] . " players online <p>"; echo "<p><p>"; echo "<a href='steam://connect/83.255.249.204:27025'>" . $results["server 5"]['gq_hostname'] . "</a><p>"; echo $results["server 5"]['gq_mapname'] . "<br>"; echo $results["server 5"]['gq_numplayers'] . "/" . $results["server 5"]['gq_maxplayers'] . " players online <p>"; echo "<p><p>"; echo "<a href='steam://connect/tf2.warzone.nu:27015'>" . $results["server 6"]['gq_hostname'] . "</a><p>"; echo $results["server 6"]['gq_mapname'] . "<br>"; echo $results["server 6"]['gq_numplayers'] . "/" . $results["server 6"]['gq_maxplayers'] . " players online <p>"; echo "<p><p>"; echo "<a href='steam://connect/83.255.249.200:27015'>" . $results["server 7"]['gq_hostname'] . "</a><p>"; echo $results["server 7"]['gq_mapname'] . "<br>"; echo $results["server 7"]['gq_numplayers'] . "/" . $results["server 7"]['gq_maxplayers'] . " players online <p>"; echo "<p><p>"; echo "<a href='steam://connect/tf2.warzone.nu:27015'>" . $results["server 8"]['gq_hostname'] . "</a><p>"; echo $results["server 8"]['gq_mapname'] . "<br>"; echo $results["server 8"]['gq_numplayers'] . "/" . $results["server 8"]['gq_maxplayers'] . " players online <p>"; echo "<p><p>"; echo "<a href='steam://connect/css.warzone.nu:27015'>" . $results["server 9"]['gq_hostname'] . "</a><p>"; echo $results["server 9"]['gq_mapname'] . "<br>"; echo $results["server 9"]['gq_numplayers'] . "/" . $results["server 9"]['gq_maxplayers'] . " players online <p>"; echo "<p><p>"; echo "<a href='steam://connect/css.warzone.nu:27017'>" . $results["server 10"]['gq_hostname'] . "</a><p>"; echo $results["server 10"]['gq_mapname'] . "<br>"; echo $results["server 10"]['gq_numplayers'] . "/" . $results["server 10"]['gq_maxplayers'] . " players online <p>"; ?> </html> I am working on a phpmailer script that sends an order confirmation email to the customer AND the client at the same time. If I have the customer email and client email set both to the originating domain's email addresses (myname@myserver.com), then it sends fine. However, if I try to send to an outside mail server (eg. someone@gmail.com), I get the following errors: Code: [Select] SMTP -> FROM SERVER:220 myserver.com ESMTP Exim 4.63 Sat, 18 Sep 2010 15:08:21 -0700 SMTP -> FROM SERVER: 250 myserver.com Hello localhost [127.0.0.1] 250-SIZE 52428800 250-PIPELINING 250-AUTH LOGIN PLAIN 250-STARTTLS 250 HELP SMTP -> FROM SERVER:250 OK SMTP -> FROM SERVER:250 Accepted SMTP -> FROM SERVER: SMTP -> ERROR: RCPT not accepted from server: SMTP Error: The following recipients failed: someone@gmail.com Message could not be sent. Mailer Error: SMTP Error: The following recipients failed: someone@gmail.com SMTP server error: I'm not sure what's going on here. Any SMTP or phpmailer geniuses here that can shed some light on what needs to happen here for this to send to any address? Hi, I'm trying to setup a quick PHP script that will grab the email from the url (see below) and after inserting into MySQL db - which is working fine - the script will complete two additional tasks: 1. send that same captured email out to a external db as in shown via http://domain1.com/insert.php?email=$lead (example), but then send to a DIFFERENT source - the originator of the lead - a portback acknowledgement using Header (sending the status and email to http://domain2.com/check.php?e=$lead&s=$status for their records). See the code below: ------------------------- Code: [Select] $lead = $_REQUEST['e_mail']; // will grab email from posted url string and assign to local variable $result = mysql_query($command); // this is just to execute the MySQL insert which works just fine but included here to explain validation below // Create API Call string to insert lead into iContact folder $requestURL = "http://domain1.com/insert.php?email=$lead"; // Execute API Call to CAKE $xml = simplexml_load_file($requestURL) or die("feed not loading"); if ($result) { $status = 1; // mark lead as sucess // send postback on lead status header("Location: http://domain2.com/check.php?e=$lead&s=$status"); } -------- Problem: I'm getting all sorts of errors with the simplexml_load_file() function and can't figure out why it won't work. Any input appreciated as this the only way I know how to pass the lead onward and then inform/update the other party of receipt of information. thanks! does anyone know how to decode this XML variable value into string values? I also need to know the oposite way: creating variable values into xml. I've tried several code examples but they did filter the requested data. Code: [Select] $xml='<?xml version="1.0" encoding="utf-8"?> <elements> <text identifier="ed9cdd4c-ae8b-4ecb-bca7-e12a5153bc02"> <value/> </text> <textarea identifier="a77f06fc-1561-453c-a429-8dd05cdc29f5"> <value><![CDATA[<p style="text-align: justify;">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>]]></value> </textarea> <textarea identifier="1a85a7a6-2aba-4480-925b-6b97d311ee6c"> <value><![CDATA[<p style="text-align: justify;">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>]]></value> </textarea> <image identifier="ffcc1c50-8dbd-4115-b463-b43bdcd44a57"> <file><![CDATA[images/stories/red/cars/autobedrijf.png]]></file> <title/> <link/> <target/> <rel/> <lightbox_image/> <width><![CDATA[250]]></width> <height><![CDATA[187]]></height> </image> <text identifier="4339a108-f907-4661-9aab-d6f3f00e736e"> <value><![CDATA[Kramer 5]]></value> </text> <text identifier="ea0666d7-51e3-4e52-8617-25e3ad61f8b8"> <value><![CDATA[6000 RS]]></value> </text> <text identifier="90a18889-884b-4d53-a302-4e6e4595efa0"> <value><![CDATA[Eindhoven]]></value> </text> <text identifier="410d72e0-29b3-4a92-b7d7-f01e828b1586"> <value><![CDATA[APK Pick up and return]]></value> </text> <text identifier="45b86f23-e656-4a81-bb8f-84e5ea76f71f"> <value><![CDATA[15% korting op grote beurt]]></value> </text> <text identifier="3dbbe1c6-15d6-4375-9f2f-f0e7287e29f3"> <value><![CDATA[Gratis opslag zomerbanden]]></value> </text> <text identifier="2e878db0-605d-4d58-9806-8e75bced67a4"> <value><![CDATA[Gratis abonnement of grote beurt]]></value> </text> <text identifier="94e3e08f-e008-487b-9cbd-25d108a9705e"> <value/> </text> <text identifier="73e74b73-f509-4de7-91cf-e919d14bdb0b"> <value/> </text> <text identifier="b870164b-fe78-45b0-b840-8ebceb9b9cb6"> <value><![CDATA[040 123 45 67]]></value> </text> <text identifier="8a91aab2-7862-4a04-bd28-07f1ff4acce5"> <value/> </text> <email identifier="3f15b5e4-0dea-4114-a870-1106b85248de"> <value/> <text/> <subject/> <body/> </email> <link identifier="0b3d983e-b2fa-4728-afa0-a0b640fa34dc"> <value/> <text/> <target/> <custom_title/> <rel/> </link> <relateditems identifier="7056f1d2-5253-40b6-8efd-d289b10a8c69"/> <rating identifier="cf6dd846-5774-47aa-8ca7-c1623c06e130"> <votes><![CDATA[1]]></votes> <value><![CDATA[1.0000]]></value> </rating> <googlemaps identifier="160bd40a-3e0e-48de-b6cd-56cdcc9db892"> <location><![CDATA[50.895711,5.955427]]></location> </googlemaps> </elements>'; Hi. I have some code which needs to return a single variable from the function and stored as a variable within this page, so it can be echoed later on in the page. I couldn't get it to return as a variable, so i used "return compact();" to return the variable and "extract (myFunction());" to extract it to variables. However, when I turned on php's display errors and error reporting function, I got an error message saying "Warning: extract() [function.extract]: First argument should be an array in /my/web/site/index.php on line 6" (which is where my extract function is). This works fine with passing more than one variables through, is there another way pass one variable from a function to be stored as a variable on the page which called the function? Here is the function: Code: [Select] <?php //This is a list of numeric error codes against their text. this will return the error code as the variable $issue function checkLoginIssue() { //If there is an error code if (isset($_GET["issue"])) { //cycle through the list until the code is reached, return the text and break the switch switch ($_GET["issue"]) { case "1": $issue = '<p class="warning">Please log in to view this page</p>'; break; case "2": $issue = '<p class="warning">Wrong Username or Password</p>'; break; case "3": $issue = '<p class="warning">No user found with those details</p>'; break; } //return the variable in an array with a single value return compact('issue'); } } ?> And here is the code which calls the function: Code: [Select] <?php extract(checkLoginIssue()); ?> I am trying the following code to send SMS. <?php $gatewayURL = 'http://localhost:9333/ozeki?'; $request = 'login=admin'; $request .= '&password=abc123'; $request .= '&action=sendMessage'; $request .= '&messageType=SMS:TEXT'; $request .= '&recepient='.urlencode('+9898989898'); $request .= '&messageData='.urlencode("Hello World"); $url = $gatewayURL . $request; //Open the URL to send the message file($url); ?> But I am getting the following error message. Warning: file(http://localhost:9333/ozeki?login=ad...ta=Hello+World) [function.file]: failed to open stream: Connection refused in /home/vpe/public_html/_demo2/sms/sms2.php on line 13 Please help to rectify my code. Thanks a lot in advance. Hello i need the php send code for this html code if anyone can help me? website url: http://dclxvi.co.uk/htmlform.htm <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="en-GB" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="description" content="A site for contacting a dj to play at an event"/> <meta name="keywords" content="DJ, Decks, AI-disco, AI Disco, Disco"/> <meta name="author" content="Ashley Sargent"/> <link rel="stylesheet" href="stylee.css" type="text/css" /> <title>DCLXVI: Booking</title> </head> <body> <div id="container"> <div id="header"> </div> <div id="navigation"> <div id="navigation"> <ul class="menu"> <div class="left"> <a href="index.html"><img src="imagess/homet.gif" onmouseover="this.src='imagess/homet1.gif'" onmouseout="this.src='imagess/homet.gif'"> <a href="services.html"><img src="imagess/services.jpg" onmouseover="this.src='imagess/services1.jpg'" onmouseout="this.src='imagess/services.jpg'"> <a href="about.html"><img src="imagess/about.jpg" onmouseover="this.src='imagess/about1.jpg'" onmouseout="this.src='imagess/about.jpg'"> <a href="contact.html"><img src="imagess/contact.jpg" onmouseover="this.src='imagess/contact1.jpg'" onmouseout="this.src='imagess/contact.jpg'"> <a href="faq.html"><img src="imagess/faq.jpg" onmouseover="this.src='imagess/faq1.jpg'" onmouseout="this.src='imagess/faq.jpg'"> <a href="gallery.html"><img src="imagess/gallery1.jpg" onmouseover="this.src='imagess/gallery2.jpg'" onmouseout="this.src='imagess/gallery1.jpg'"> <a href="login.php"><img src="imagess/login.jpg" onmouseover="this.src='imagess/login1.jpg'" onmouseout="this.src='imagess/login.jpg'"> <a href=""></a> </div> </div> <br><br><br> <form name="htmlform" method="post" action="html_form_send.php"> <table border="1" bordercolor="0000FF" cellspacing="2" cellpadding="5"> </tr> <U><b>Personal Information:</b></U><BR><BR> <tr> <td valign="top"> <label for="Title">Title *</label> </td> <td valign="top"> <select> <option><selected>--Please Select--</option> <option>Mr</option> <option>Mrs</option> <option>Miss</option> <option>Dr</option> <option>Other</option></select>Other:<INPUT type="text" SIZE="20"> <tr> <td valign="top"> <label for="first_name">First Name *</label> </td> <td valign="top"> <input type="text" name="first_name" maxlength="50" size="30"> </td> </tr> </select> <tr> <td valign="top""> <label for="last_name">Last Name *</label> </td> <td valign="top"> <input type="text" name="last_name" maxlength="50" size="30"> </td> </tr> <tr> <td valign="top"> <label for="email">Email Address *</label> </td> <td valign="top"> <input type="text" name="email" maxlength="80" size="30"> </td> </tr> <tr> <td valign="top"> <label for="telephone">Telephone Number *</label> </td> <td valign="top"> <input type="text" name="telephone" maxlength="30" size="30"> </td> </tr> </tr> </table> <br><br> <table border="1" bordercolor="0000FF" cellspacing="2" cellpadding="5" width="460"> <u><b>Event Information:</b></u><br><br> <tr> <td valign="top"> <label for="occasion">Occasion</label> </td> <td valign="top"> <select> <option><selected>--Please Select--</option> <option>Birthday</option> <option>Wedding</option> <option>Anniversary</option> <option>Party</option> <option>Engagement</option> <option>Valentines</option> </select> <tr> <td valign="top"> <td valign="top"> <input type="checkbox" value="70's">70's<br> <input type="checkbox" value="80's">80's <input type="checkbox" value="90's">90's<br> <input type="checkbox" value="Cheese">Cheese <input type="checkbox" value="Mainstreem">Mainstreem R n B<br> <input type="checkbox" value="House">House <input type="checkbox" value="Dance">Dance<br> <input type="checkbox" value="Garage">Garage <input type="checkbox" value="hiphop">Hip-Hop<br> <input type="checkbox" value="Karaoke">Karaoke <input type="checkbox" value="Other">Other <INPUT type="text" SIZE="6"> </div> </td> </tr> </select> <tr> <td valign="top"> <label for="event_date">Event Date</label> </td> <td valign="top"> <input type="text" name="event_date" maxlength="50" size="30"> </td> </tr> <td valign="top"> <label for="length_of_party">Length of Party</label> </td> <td valign="top"> <select> <option><selected>--Please Select--</option> <option>1 Hour</option> <option>2 Hours</option> <option>3 Hours</option> <option>4 Hours</option> <option>5 Hours</option> <option>Other</option></select>Other:<INPUT type="text" SIZE="10"> </td> </tr> <tr> <td valign="top"> <label for="location">Location</label> </td> <td valign="top"> <input type="text" name="location" maxlength="30" size="30"> </td> </tr> <tr> <td valign="top"> <label for="comments">Comments</label> </td> <td valign="top"> <textarea name="comments" cols="29" rows="5"> Enter your comments here... </textarea> <center><input type="submit" value="Submit" /></center> </td> </tr> </table> i would like to send sms using AT Hayes command in php... is it possible? Hello, I have a registration page and when a user registers I want to send their email an activation code. To test I have the following code. <?php //Send activation Email $to = $Email_address; $subject = "www.WEBSITE.com/"; $message = "Welcome to my website!\r\rYou, or someone using your email address, has completed registration at WEBSITE. You can complete registration by clicking the following link:\rhttp://www.WEBSITE.com/register.php?action=verify&$activationKey\r\r If this is an error, ignore this email and you will be removed from our mailing list.\r\rRegards,\ "; $headers = 'From: noreply@abc.com' . "\r\n" . 'Reply-To: noreply@abc.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); if (mail($to, $subject, $message, $headers)) { echo 'Success'; } else { echo 'Error'; } ?> I have the last if else to see if it is sent to not. I do get a Success message, but I don't get an email at the address (I have checked the spam folder). I have checked the email address and it is correct. I have even waited a few hours and nothing. Why is the email not getting to my account? Guys, give me an idea of using a free or open sorce software for transferring messages over a local network between computers using MAC OS and Linux platforms.
Hi All, I have a simple question. I have built log in control panels and have always used session id to follow through getting the username and password from the database and then checking each page that the user and password match using session using the sessio id held in a temp database. I have been informed that this is not as secure as I once thought. I am looking at using cookies and have found the code for how to set up and delete a cookie. The simple question is this how to you pass the cookie to another page once you are loged in and retain it until you have loged out. If the user clicks on a button once loged in to a page where they need to insert new details or update some information and then return to the main control panel. Any help would be great and if not have a great day even if it is raining as it is in England # 1 Create an account with one of the SMS gateway providers, such as Clickatell, Ozeki NG and TM4B SMS Gateway (see Resources). The gateway provider will be in charge of sending your requests for SMS messages. As with sending text messages from cell phones, you will need a service provider in order to send SMS messages from your website. The gateway provider will provide you with a paid solution for sending SMS messages from your website. # 2 Start a new blank file in a web-authoring application, such as Dreamweaver, or a plain text-editing application like Notepad. Most web-authoring application uses a WSIWYG (What You See is What You Get) environment, in which you just add the visual elements to the document and the program will automatically generate the code. You want to type in your own code in this project, so switch to "Code" or "HTML" view of the program. Also, don't use a word processor as a text-editing program. Word processors, like Microsoft Word, add extra formatting code that will interfere with the PHP code. # 3 Create the web form that will work as the user interface for entering in the information for sending the text message. Visitors to your website will type in the information for the text message. You will then collect this information and send it in the request to the SMS gateway. "<html> <head> <body> <form action="<?php print $PHP_SELF?>" enctype="multipart/form-data" method="post"> Sender:<br /> <input type="text" name="sender" value="" /><br /> Receiver:<br /> <input type="text" name="receiver" value="" /><br /> Message: <p><textarea name="message" rows="20 cols="80"> Click in this box and type in your text message. # 4 Type in the PHP code to prepare the request to the messaging service's gateway. You have to send the gateway an HTTP request that passes along the details of the SMS message. The request should look like this: "<?php \\Takes the information from the form and save it to variables $sender = $_POST['sender']; $receiver = $_POST['receiver']; $message = $_POST['message']; \\Prepare the request $request = ""; $param["username"] = "username"; //the account username provided by gateway provider $param["password"] = "password"; //the account password provided by gateway provider $param["msg"] = $message; //the text message that will be sent $param["to"] = $receiver; //the recipient of the text message $param["from"] = $receiver; //the message sender $param["route"] = "frst"; //this means we are sending the message first class $param["sim"] = "yes"; foreach($param as $key=>$val){ $request.= $key."=".urlencode($val); $request.= "&"; } $request = substr($request, 0, strlen($request)-1); ?>" Change the param values above to meet your specific details. # 5 Type in the code to actually send the SMS message. PHP has a CURL library included that handles these types of things. "<?php $url = "{add the url to the gateway API}"; //the gateway's interface provided by the gateway provider $ch = curl_init; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); $response = curl_exec($ch); curl_close($ch); ?> </body> </head> </html>" Do not change any of the code above other than removing the quotation marks from the first and last line in the code and adding the URL to the SMS gateway provider's API interface. Check with the provider for this information. Save the document with the PHP file extension and upload it to your web server. Hi I have sms website and i have add one button to my all single post button is working but the problem is the send button is going on another page i have create this code <form action="http://uksmsserver.ismspoetry.com/" method="post"> <input name="go-content" type="hidden" value="<?php echo $new_content; ?>" /><div id="button"><input type="submit" value="Send this Sms to Mobile" /></div></form> but i want to do i Wanna send single sms to This Page I have add This Sender In Iframe And The Sender Scprit is showing on this page http://ismspoetry.co...united-kingdom/ so i want to do if someone click on send sms to mobile button the msg goes will be on this sender if some one know please let me know thanks Hi guys, i have a custom made php that collect all the info in admin page (long story short), there's a button called "Approve" I would like to send back an email to user who applied with picture, once Approved button is pressed, so here's the script: <?php session_start(); $user = '123'; $pass = '123'; $to = $data['email']; $subject = 'blablabla'; $message = 'test123'; if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_USER'] != $user || $_SERVER['PHP_AUTH_PW'] != $pass) { header('WWW-Authenticate: Basic realm="Enter password to access this page."'); header('HTTP/1.0 401 Unauthorized'); echo"You must be logged in to see this page."; exit; } ################## PROTECTED CONTENT ######################## require('./config.php'); ?> <!DOCTYPE HTML> <html> <head> <title>ADMIN PANEL</title> <style type="text/css"> body{width: 960px; margin: auto; margin-top: 20px; padding: 5px 20px; box-shadow: 0px 0px 2px #000000; border-radius: 5px;background:transparent url(images/bg_header.gif) top left repeat-x;} a:link,a:active,a:visited{color: inherit; text-decoration: none;} a:hover{text-decoration: underline;} .button{background:transparent url(images/grad.PNG) bottom left repeat-x; padding: 3px 5px; border-radius: 4px; border: 1px solid #cccccc;} .button:hover{border-color:orangered;text-decoration:none;} .approve .img{max-height: 200px; max-width: 200px; position: absolute; right: 5px; top: 5px;} .approve{display: block; height: 200px; overflow: hidden; box-shadow: 0px 0px 2px #000000; margin-top: 20px; padding: 20px; position: relative; font:13px verdana;} textarea,input{padding: 3px;font: 13px helvetica,verdana;border:1px solid rgb(51,151,251);border-radius: 4px;width: 300px; display: block; margin: 5px 0px;} input:hover,textarea:hover{border-color:orangered;cursor:pointer;} form{font:bold 13px verdana;} input[type='submit'],input[type='button']{width: auto;} </style> </head> <body> <?php echo" <div id='head'> <h1 align='center'>ADMIN PANEL</h1> <h4 align='center'><a href='index.php' class='button'>Homepage</a> <a class='button' href='admin.php'>Approval Queue</a> <a class='button' href='admin.php?edit'>Edit Image info.</a> <a class='button' href='?edit&view'>View Image Info.</a></h4> </div>"; if (isset($_GET['edit'])) { if (isset($_GET['pid'])) { $pic = mysql_query('SELECT * from `' . $table_name . '` WHERE pid = ' . intval($_GET['pid'])); if (mysql_num_rows($pic) == 1) { if (isset($_POST['submit'])) { $approved = isset($_POST['approved']) && $_POST['approved'] == '1' ? 1 : 0; mysql_query('UPDATE `' . $table_name . '` SET ' . 'first_name = "' . $_POST['first'] . '",' . 'last_name="' . $_POST['last'] . '",' . 'phone="' . $_POST['phone'] . '",' . 'email="' . $_POST['email'] . '",' . 'first_name="' . $_POST['first'] . '",' . 'approved=' . $approved . ',' . 'address="' . $_POST['addr'] . '",' . 'admin_desc="' . $_POST['admin_desc'] . '"' . ' WHERE pid = ' . intval($_GET['pid'])) or exit("Unable to edit" . mysql_error()); echo'<h3>EDITED</h3>'; $pic = mysql_query('SELECT * from `' . $table_name . '` WHERE pid = ' . intval($_GET['pid'])); } $data = mysql_fetch_array($pic); if (isset($_GET['view'])) { echo' <strong>Uploaded by </strong>' . $data['first_name'] . ' ' . $data['last_name'] . ' <br /> <img src="' . $default_dir . $data['image_name'] . '" style="max-width: 200px; max-height:200px; float: right;" /> <br /> <br /> <b>First_name :</b> ' . $data['first_name'] . ' <br /> <br /> <b>Last_name :</b> ' . $data['last_name'] . ' <br /> <br /> <b>Phone :</b> ' . $data['phone'] . ' <br /> <br /> <b>Email :</b> ' . $data['email'] . ' <br /> <br /> <b>Approved :</b> ' . ($data['approved'] == 1 ? 'Yes' : 'No') . ' <br /> <br /> <b>Address :</b> ' . $data['address'] . ' <br /> <br /> <b>Admin_description :</b> <br /> <br />' . $data['admin_desc'] . ' <br /> <br /> <a href="?edit&pid=' . $data['pid'] . '" class="button">Edit</a> <br /> <br /> '; } else { echo'<form method="POST" action="?edit&pid=' . intval($_GET['pid']) . '"> Editting photo: <a style="color:rgb(51,151,251);" href="' . $default_dir . $data['image_name'] . '">' . $data['image_name'] . '</a> uploaded by ' . $data['first_name'] . ' ' . $data['last_name'] . ' <br /> <img src="' . $default_dir . $data['image_name'] . '" style="max-width: 200px; max-height:200px; float: right;" /> <br /> First_name : <input type="text" name="first" value="' . $data['first_name'] . '" /> Last_name : <input type="text" name="last" value="' . $data['last_name'] . '" /> Phone : <input type="text" name="phone" value="' . $data['phone'] . '" /> Email : <input type="text" name="email" value="' . $data['email'] . '" /> Approved : <input type="text" name="approved" value="' . $data['approved'] . '" /> 0 or 1 Address : <textarea name="addr">' . $data['address'] . '</textarea> Admin_description : <textarea name="admin_desc">' . $data['admin_desc'] . '</textarea> <input type="submit" name="submit" value="Edit" /> </form>'; } } else { echo"NO SUCH PICTURE EXISTS"; } } else { echo" <h3>Search for image to " . (isset($_GET['view']) ? 'view' : 'edit') . " it: </h3> <form id='form' method='POST' action='admin.php?edit" . (isset($_GET['view']) ? '&view' : '') . "'> Uploader's first name: <input type='text' name='name' value='' /> OR Image name: <input type='text' name='img' value='' /> OR Email: <input type='text' name='email' value='' /> <input type='submit' name='submit' value='Search' /> </form>"; if (isset($_POST['submit'])) { $name = empty($_POST['name']) ? '%' : '%' . $_POST['name'] . '%'; $email = empty($_POST['email']) ? '%' : '%' . $_POST['email'] . '%'; $img = empty($_POST['img']) ? '%' : '%' . $_POST['img'] . '%'; $query = mysql_query( 'SELECT * from `' . $table_name . '` where ' . 'first_name like "' . $name . '" and ' . 'email like "' . $email . '" and ' . 'image_name like "' . $img . '"'); if (mysql_num_rows($query) > 0) { while ($pic = mysql_fetch_array($query)) { echo"<hr/><strong>Uploaded by $pic[first_name] $pic[last_name] " . date(' \a\t H:i \o\n d/m/Y', intval($pic['image_name'])) . "</strong> - <a href='$default_dir$pic[image_name]' target='_blank'>$pic[image_name]</a> <a href='?edit" . (isset($_GET['view']) ? '&view' : '') . "&pid=$pic[pid]' class='button'>" . (isset($_GET['view']) ? 'View' : 'Edit') . "</a>"; } } else { echo "NO IMAGE MATCHES THAT DESCRIPTION"; } } } exit; } if (isset($_GET['approve'])) { if (mysql_query('UPDATE `' . $table_name . '` SET approved = 1 WHERE pid = ' . intval($_GET['approve']))) { if (@mail($to, $subject, $message)) { echo('<p>Mail sent successfully.</p>'); } else { echo('<p>Mail could not be sent.</p>'); } echo"<h2>APPROVEDs</h2>"; } } It's not whole script though. Hey I'm trying to send my check-boxes with PHP. Before i added them to my script everything worked fine, i tested the form and i received the answers in my inbox. when i tried to let the checkboxes work, it stopped working. Please help me out! ! I've added this to check my check-boxes: Code: [Select] if ($_POST['Keukens'] == 'on') { $Keukens = "Ja"; } else { $Keukens = "Nee"; } if ($_POST['Badkamers'] == 'on') { $Badkamers = "Ja"; } else { $Badkamers = "Nee"; } if ($_POST['Kasten'] == 'on') { $Kasten = "Ja"; } else { $Kasten = "Nee"; } if ($_POST['Kantoormeubels'] == 'on') { $Kantoormeubels = "Ja"; } else { $Kantoormeubels = "Nee"; } if ($_POST['Tafels'] == 'on') { $Tafels = "Ja"; } else { $Tafels = "Nee"; } if ($_POST['Overige'] == 'on') { $Overige = "Ja"; } else { $Overige = "Nee"; } This is the delivery part: Code: [Select] else { $recipient = "sven@hotmail.com"; //Het email adres van de Ontvanger. $subject = $_POST['sub']; //Onderwerp van de mail. $header = "From: " . $_POST['uwemail'] . "\n"; $mail_body = "Het Contact formulier werd op " . date("d-m-Y") . " om " . date("H:i") . " uur uitgevoerd.\n"; $mail_body .= "De volgende persoon vulde het contact formulier in:\n\n"; $mail_body .= "Voorletters: " . $_POST['voorletters'] . "\n"; $mail_body .= "Achternaam: " . $_POST['naam'] . "\n\n"; $mail_body .= "Adres: " . $_POST['adres'] . "\n"; $mail_body .= "Postcode: " . $_POST['postcode'] . "\n"; $mail_body .= "Woonplaats: " . $_POST['plaats'] . "\n\n"; $mail_body .= "Telefoonnummer: " . $_POST['tel'] . "\n"; $mail_body .= "E-mailadres: " . $_POST['uwemail'] . "\n\n"; $mail_body .= "Onderwerp: " . $_POST['sub']. "\n"; $mail_body .= "Vraag: " . $_POST['field']. "\n\n"; $mail_body .= "Interesses:\n\n"; $mail_body .= "Keukens: ".$Keukens."\n"; $mail_body .= "Badkamermeubels: ".$Badkamermeubels."\n"; $mail_body .= "Kasten: ".$Kasten."\n"; $mail_body .= "Kantoormeubels: ".$Kantoormeubels."\n"; $mail_body .= "Tafels: ".$Tafels."\n"; $mail_body .= "Overige: ".$Overige."\n"; $mail_body .= "\n\n -- Einde van het formulier--"; mail($recipient, $subject, $mail_body, $header); echo "<font color=\"#FFFFFF\"><center><b>Bedankt voor uw reactie.</b><br><br>Wij zullen zo snel mogelijk contact met u opnemen.<br> Met vriendelijke groet,<br>Sven</b><br><br><br>"; echo "Terug naar het <a class=\"main\" href='javascript:history.back(1)'>formulier</a></center></font>"; } } else { ?> This the HTML part: Code: [Select] <font face="Verdana, Arial, Helvetica, sans-serif"> <label> <input type="checkbox" name="Keukens" id="keuze1" value="Keukens"/> <font color="#FFFF00" size="2"> <font size="1">Keukens</font></font></label> <font color="#FFFF00" size="1"><br /> <label> <input type="checkbox" name="Badkamers" id="keuze2" value="Badkamers"/> Badkamermeubels</label> <br /> <label> <input name="Kasten" type="checkbox" id="keuze3" value="Kasten" /> Kasten</label> <br /> <label> <input type="checkbox" name="Kantoormeubels" id="keuze4" value="Kantoormeubels"/> Kantoormeubels</label> <br /> <label> <input type="checkbox" name="Tafels" id="keuze5" value="Tafels"/> Tafels</label> <br /> <label> <input type="checkbox" name="Overige" id="keuze6" value="Overige"/> Overige</label> </font><br /> </font></div> Hi People,
I'm using a php to send an mail using a server via ssl. My program:
<?php Hi Guys I want to knw if its possible to send job to print with php. example, in my database I have a table called Letters which stores letters, while I loop through the table, I want to print each letter off, any examples available? Thank you |