-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
do you mean like this ? !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>sending</title> </head> <?php $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $name = $_GET['name']; $Message = ' <table width="225" border="1" cellpadding="1" cellspacing="1" bordercolor="#000000" bgcolor="#999900"> <tr> <td width="215"><strong>Name</strong>:'.$name.' </td> </tr> <tr> <td><label><strong>City</strong>: </label></td> </tr> <tr> <td><label><strong>State:</strong> </label></td> </tr> <tr> <td><label><strong>Zip:</strong> <br /> </label></td> </tr> <tr> <td><strong>Phone:</strong> </tr> <tr> <td><label><strong>e-mail: </strong> </label></td> </tr> <tr> <td><label><strong>Info:</strong> </label></td> </tr> </table> </p> '; $MessageSent = mail('email@emial.com', $Subject, $Message,$headers); if ($MessageSent) { echo "<p>The following message was sent successfully:</p><hr />"; echo "<p><strong>From</strong>:$From</p>"; echo "<p><strong>To</strong>:$state</p>"; echo "<p><strong>Subject</strong>:$zip</p>"; echo "<p><strong>phone</strong>:$phone</p>"; echo "<p><strong>email</strong>:$email</p>"; echo "<p><strong>info</strong>:$info</p>"; } else echo"<p>The Message was not sent successfully!</p>"; ?> <body> </body> </html>
-
its the URI protocal added when you install iTunes.. you can find them on your PC but i don't know of a list
-
try this *untested* <?php //2008-10-14 00:00:00 $beginDate = date("Y-m-d H:i:s", strtotime( $_POST['beginDate']));; $endDate = date("Y-m-d H:i:s", strtotime( $_POST['endDate'])); $query="SELECT Email FROM Customer WHERE UDFDate2 BETWEEN '$beginDate' AND '$endDate' "; ?>
-
if its a file type then use isset($_FILE['field'])
-
try ripping the scripts from here
-
No.. well not on the clients computer.. PHP is server based your need a client side script like Javascript EDIT: detect QuickTime (untested) <script language="Javascript"> <! — hide from pre-script browsers var haveqt = false; // — > </script> <script language="VBScript"> <! — hide from pre-script browsers On Error Resume Next Set theObject = CreateObject("QuickTimeCheckObject.QuickTimeCheck.1") On Error goto 0 If IsObject(theObject) Then If theObject.IsQuickTimeAvailable(0) Then ‘Just check for file haveqt = true End If End If // — > </script> <script language="Javascript"> <! — hide from pre-script browsers if (navigator.plugins) { for (i=0; i < navigator.plugins.length; i++ ) { if (navigator.plugins[i].name.indexOf("QuickTime") >= 0) { haveqt = true; } } } // — > </script> </head> <body bgcolor="#ffffff"> <H1>Check for QuickTime</H1> <script language="Javascript"> <! — hide from pre-script browsers if (haveqt) {document.write(’<embed src="hotfire.mov" width=120 height=51>’);} else {document.write(’You do not seem to have " + "<a href="http://www.apple.com/quicktime">QuickTime</a>’);} // — > </script> <noscript> Your browser doesn’t support scripting, so you can’t check for QuickTime. </noscript>
-
change Line 64 (i think) print '<tr><th colspan=2><input type="submit" value="Add Show Name" /><input name="sumbitted" type="hidden" value="TRUE"></th></tr></table></form><br><br><br>'; to print '<tr><th colspan=2><input type="submit" value="Add Show Name" name="submit" /><input name="sumbitted" type="hidden" value="TRUE"></th></tr></table></form><br><br><br>'; NOTE the name="submit" OR change if (isset($_POST['submit'])) { to if (isset($_POST['sumbitted'])) {
-
do you have the item_id field in the store_item_color table ? also please use code tags (the # button)
-
I don't have much time so this is a quickie read up on strip_tags() and htmlentities() and htmlspecialchars()
-
I do but a thanx will do I'm happy to help
-
[SOLVED] display session id and store it in database
MadTechie replied to Marcos01's topic in PHP Coding Help
<?php session_start(); $bedrijfsnaam = $_POST['companyname']; $naam = $_POST['name']; $email = $_POST['email']; $sessionid = session_id(); //<--ADD $query ="INSERT INTO formusers (sessionid, companyname, name, email) values('{$sessionid}','{$companyname}', '{$name},'{$email}')"; $result = mysql_query($query, $connection); if ($result){ echo "data added"; }else{ echo "data has not been added to database"; echo 'mysql_error()'; } ?> EDIT: ahh too slow -
Extracting Gmail messages and importing them onto MySQL: Possible?
MadTechie replied to FForce2195's topic in PHP Coding Help
your need to readup on imap heres a basic example <?php // Connection $server = "imap.gmail.com:993"; // server & port $user = "USERNAME@gmail.com"; $pass = "PASSWORD"; $mbox = imap_open("{".$server."/imap/ssl}INBOX", $user, $pass) or die("Error: " . imap_last_error()); echo "<h1>Mailboxes</h1>\n"; $folders = imap_listmailbox($mbox, "{".$server."}", "*"); if ($folders == false) { echo "Call failed<br />\n"; } else { foreach ($folders as $val) { echo $val . "<br />\n"; } } echo "<h1>Headers in INBOX</h1>\n"; $headers = imap_headers($mbox); if ($headers == false) { echo "Call failed<br />\n"; } else { foreach ($headers as $val) { echo $val . "<br />\n"; } } imap_close($mbox); ?> -
No no.. your querying a result change to this <?php $day=date("j"); $sql="SELECT * FROM invoices WHERE day='$day'"; $query=mysql_query($sql) or die($sql.mysql_error()); while ($req=mysql_fetch_array($query)) { mail($req['UserEmail'], "You must pay for protection.", "You haven't paid for protection. You have one day to pay or god may strike down your building."); } ?> if you get an error please give us that exact error
-
opps, change if(!isset($_POST['submit'])) die("FAILED: nothing selected"); to if(!isset($_POST['Search'])) die("FAILED: nothing selected");
-
make sure that image is a GIF or change to a JPEG file and update gif command to jpg command ie header("content-type: image/jpeg"); $image = ImageCreateFromJPEG($imagelink); imagejpeg($image);
-
try putting set_time_limit(0); at the start
-
Are you using sessions on www.alexville.com that are shared on alexville.com, i assume not.. and you could fix the redirect from alexville.com to www.alexville.com via an A Records (DNS management) or via a .htaccess file (easiest option) so i would say no you don't need that line
-
probably errors try commenting out the header( line; and see if an error appears here a quick re-write <?php ob_start(); ini_set('display_errors', 1); error_reporting(E_ALL); # SETTINGS: $imagelink = "http://mysite.com/dir/l.gif"; # END SETTINGS $fp = fopen('logs.txt', 'a'); # File will be created if (!exist) :-) $ip = $_SERVER['REMOTE_ADDR']; $agent = $_SERVER['HTTP_USER_AGENT']; $port = $_SERVER['REMOTE_PORT']; $file = $_SERVER['HTTP_REFERER']; # External page (viewed from this page) fwrite($fp, " Ip: ".$ip); fwrite($fp, " User-Agent: ".$agent); fwrite($fp, " Port: ".$port); fwrite($fp, " File: ".$file); fwrite($fp, "\n"); fclose($fp); ob_end_clean(); if(!file_exists($imagelink)) { die("Fail to load file"); } header("content-type: image/gif"); $image = ImageCreateFromGIF($imagelink); imagegif($image); ImageDestroy($image); exit(); # Force exit (Reason: forum keeps loading) ?>
-
You using subdomain that share sessions with mail domains ? if not you don't need that line.. if you do.. then.. erm..
-
i think he means its on his server BUT wants the parser'd version see my last post
-
Agreed your need FTP access or a add handler update if its your code then use FTP if its not then write your own EDIT: for the HTML source use $googleshtml = file_get_contents('http://www.google.com/'); ie my file dummy.php is on the root of mydomain.com so instead of $html = file_get_contents('dummy.php'); you would do $html = file_get_contents('http://mydomain.com/dummy.php'); make sense ?
-
it check to see if the file was uploaded see the 2 //<--- REMOVE comment lines <?php ini_set('display_errors', 1); error_reporting(E_ALL); if ($_SERVER['REQUEST_METHOD']=="POST") { // we'll begin by assigning the To address and message subject $to="emailaddress"; $subject="E-mail with attachment"; $expected = array('fromname','fromemail'); $required = array('fromname','fromemail'); $missing = array(); // get the sender's name and email address // we'll just plug them a variable to be used later $from = stripslashes($_POST['fromname'])."<".stripslashes($_POST['fromemail']).">"; // generate a random string to be used as the boundary marker $mime_boundary="==Multipart_Boundary_x".md5(mt_rand())."x"; // store the file information to variables for easier access $tmp_name = $_FILES['filename']['tmp_name']; $type = $_FILES['filename']['type']; $name = $_FILES['filename']['name']; $size = $_FILES['filename']['size']; $fromname = $_POST['fromname']; // here we'll hard code a text message // again, in reality, you'll normally get this from the form submission $message = "Here is your file: $name\n"; $message .= "From: $fromname\n\n"; // if the upload succeded, the file will exist //if (file_exists($tmp_name)){ //<--- REMOVE // check to make sure that it is an uploaded file and not a system file if(is_uploaded_file($tmp_name)){ // open the file for a binary read $file = fopen($tmp_name,'rb'); // read the file content into a variable $data = fread($file,filesize($tmp_name)); // close the file fclose($file); // now we encode it and split it into acceptable length lines $data = chunk_split(base64_encode($data)); } if (empty($missing)) { // now we'll build the message headers $headers = "From: $from\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: multipart/mixed;\r\n" . " boundary=\"{$mime_boundary}\""; // next, we'll build the message body // note that we insert two dashes in front of the // MIME boundary when we use it $message = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: text/plain; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n"; // now we'll insert a boundary to indicate we're starting the attachment // we have to specify the content type, file name, and disposition as // an attachment, then add the file content and set another boundary to // indicate that the end of the file has been reached $message .= "--{$mime_boundary}\n" . "Content-Type: {$type};\n" . " name=\"{$name}\"\n" . //"Content-Disposition: attachment;\n" . //" filename=\"{$fileatt_name}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n" . "--{$mime_boundary}--\n"; define ("MAX_SIZE","1000"); function file_extension($filename) { $path_info = pathinfo($filename); return $path_info['extension']; } $filename = stripslashes($_FILES['filename']['name']); $type = strtolower( file_extension( $filename)); if (($type != "jpg") && ($type != "jpeg") && ($type != "png") && ($type != "pdf") && ($type != "dwg") && ($type != "gif")) { echo 'Invalid file type! Only gif, jpg, pdf and DWG files are allowed to be uploaded</a>.'; echo $path_parts['extension'], "\n"; } if ($_FILES['filename']['size'] >= 1048576) { echo 'You have exceeded the size limit of 1Mb!'; echo ' Actual size of attachment: '.$_FILES['filename']['size']; } } foreach ($_POST as $key => $value) { $temp = is_array($value) ? $value : trim($value); if (empty($temp) && in_array($key, $required)) { array_push($missing, $key); } elseif (in_array($key, $expected)) { ${$key} = $temp; } } if (isset($_POST['Submit'])) { if ($missing) { echo "Please Complete the missing items" ; echo '<p>The following required fields have not been filled in:</p>'; echo '<ul>'; foreach($missing as $item) { echo "<li>$item</li>"; } echo '</ul>'; } else { (mail($to, $subject, $message, $headers)) ; echo "Message was sent successfully."; } } //} //<----- REMOVE } ?> <p>Send an e-mail with an attachment:</p> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data" name="form1"> <p>From name: <input type="text" name="fromname" <?php if (isset($missing)) { echo 'value="'.htmlentities($_POST['fromname']).'"';} ?> /> <p>From e-mail: <input type="text" name="fromemail" <?php if (isset($missing)) { echo 'value="'.htmlentities($_POST['fromemail']).'"';} ?> /> <p>File: <input type="file" name="filename" /> <p><input type="submit" name="Submit" value="Submit"> </form>
-
i agree, opening it via a HTTP protocal will parsa the file thus giving you what you want..
-
depends what your changing ie ini_set("error_reporting",0); can be changed to error_reporting(0);
-
i assume it a date problem but try this to check $query=mysql_query($sql) or die(mysql_error());