Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. to check if its in the correct format.. <?php if (!preg_match('/^\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b$/si', $email)) { //invalid email, display message JS popup etc } ?>
  2. you could have a it sent 10 per minute on a crown.. (will need to send 6.5 per minute to make the 90 per day)
  3. to display the hi-res, the file is larger.. thus more bandwidth.. simple as.. maybe Thumbnail(150x150), Medium(300x300), and Full(1024x768) Show Thumbnail, hover shows Medium, click shows Full
  4. Use thorpe's post, but key should be `key`
  5. either that or have an half an hour break.. 90k of emails is classed as an e-Bomb!
  6. Assuming, the table works i don't see any image link.. try this, update the http://domain.com/test/jpg <?php $subject="hi"; $message="<table border=1><tr><td>hi this is test mail</td></tr></table> <img scr=\"http://domain.com/test/jpg\"> "; $to="xxxx@xx.com"; //$from=str_replace(" ","",$fromAdd); $from="jeeva"; //ini set for mail ini_set("SMTP",$server); //ini_set("sendmail_from",$from); //set the html header $femail = "From: $from<$to>"; $cc="Cc:xxx@xx.com"; $remail = "Reply-To: $from<$to>"; $headers = 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $mail=mail($to,$subject,$message,$headers); ?> EDIT: oops. forgot to escaped the quote
  7. backticks(`) not quotes(') Top left of the keyboard (or copy and paste)
  8. $K = Key (AKA index number) So as you loop through the post (via the key) you also check the FILES with the same key or use kenrbnsn idea
  9. Add to fields to the database, Active, ActivationCode (or whatever) Now When you create an account, set Active to 0, and a random code in ActivationCode, ie MD5(time()); on logon check that Active is 1, Now email them a link ie http:\\blar.com\activate.php?email=[email entered]&Activate=[CodeRenerated] Now in your activate.php, Use something like <?php $email = $_GET['email']; $Activate= $_GET['Activate']; //Add Filter to above to stop injection //SQL stuff //UPDATE users SET Active=1 WHERE email='$email' AND Activate='$Activate'; ?> also remeber a link to re-sent the activation code (search for email) hope this helps
  10. @cry of war change key to `key`
  11. Why not just, send 1 email, create an account for yourself ie mailer@domain.com then send 1 email to that and BCC everyone in that list, this will protect their email address from other and reduce stress on the server!
  12. Try this <?php foreach($_POST['myfield'] as $K => $V) { echo "textBox=$V<br>"; echo "File=".$_FILES[$K]['name']."<br>"; //Add If here if( !empty($_FILES[$K]['name']) && !empty($V) ) { //Both NOT empty //NOTE: i used $V for the text, i could also do $_POST[$K]['myfield'] } } ?>
  13. remember your need to attach the image, or have a full URL to its location on your site (better option), also the mail must be HTML format not text.. do you have some sample code, so show ?
  14. Hummm, hope its not homework lol
  15. Use the software provided for connecting to the WebCam.. you could intergrate this but without knowing the software its hard to say.. either way your need access to the server for a short time to set it up.. not really a PHP issule!
  16. $getpaper = "SELECT * FROM useritem WHERE UserID='{$_SESSION['Current_User']}' And ItemID = '1'" or die(mysql_error()); // Fetch the row from the database if (!($paperrow = mysql_fetch_assoc($GetUserID))) //Makes no sense! { $TotalPaper = 0; }else{ $TotalPaper = $paperrow['Quantity']; }
  17. erm.. do you mean like this <?php $tel = "(15555555555)"; //added a 5 as it didn't make sense! $tel = preg_replace('/\((\d?)([0-9]{3})[-. ]?([0-9]{3})[-. ]?([0-9]{4})\b\)/s', '+\1 (\2) \3-\4', $tel ); ?>
  18. Post your code..
  19. Input (to the database) <?php $compliments = (! get_magic_quotes_gpc ()) ? addslashes ($_POST['compliments ']) : $_POST['compliments ']; ?> Output (from the database) <?php $compliments = (get_magic_quotes_gpc ()) ? stripslashes ($compliments) : $compliments; ?> Now, if the magic quotes are enabled then the don't add slashes on input, BUT on output remove slashes if magic quotes are enabled, Now if someone types day\night the input will be changed to day\\night thus the output filters the \
  20. use phpmailer.. may be more helpfull
  21. reversal <?php $compliments = ( get_magic_quotes_gpc ()) ? stripslashes ($compliments) : $compliments; ?> EDIT: Ahh type'o
  22. try this <?php $compliments = (! get_magic_quotes_gpc ()) ? addslashes ($_POST['compliments ']) : $_POST['compliments ']; ?> EDIT: note use the same idea for all post's
  23. try this <?php //This is the directory where images will be saved $path = '../images/'; //This gets all the other information from the form $name=$_POST['name']; $suburb=$_POST['suburb']; $price=$_POST['price']; $content=$_POST['content']; $content2=$_POST['content2']; $agentmobile=$_POST['agentmobile']; $agentemail=$_POST['agentemail']; $uploadFile0=($_FILES['uploadFile0']['name']); $uploadFile1=($_FILES['uploadFile1']['name']); $uploadFile2=($_FILES['uploadFile2']['name']); $uploadFile3=($_FILES['uploadFile3']['name']); $uploadFile4=($_FILES['uploadFile4']['name']); $uploadFile5=($_FILES['uploadFile5']['name']); $uploadFile6=($_FILES['uploadFile6']['name']); $uploadFile7=($_FILES['uploadFile7']['name']); $uploadFile8=($_FILES['uploadFile8']['name']); // Connects to your Database mysql_connect("localhost", "root", "5050888202") or die(mysql_error()) ; mysql_select_db("gcproperty") or die(mysql_error()) ; // Uploads Images $uploadNeed = $_POST['uploadNeed']; // start for loop for($x=0;$x<$uploadNeed;$x++){ $file_name = $_FILES['uploadFile'. $x]['name']; //test $Size = $_FILES['uploadFile'. $x]['size']; //Test Check if(valid_ext($file_name)) { echo "valid ext"; }else{ echo "invalid"; } echo "<br>"; if(valid_size($Size)) { echo "valid size"; }else{ echo "invalid"; } // strip file_name of slashes $file_name = stripslashes($file_name); $file_name = str_replace("'","",$file_name); if(file_exists($path . $file_name) ) { echo "The file {$file_name} already exists."; } else { $copy = move_uploaded_file($_FILES['uploadFile'. $x]['tmp_name'], $path . $file_name); } } // check if successfully copied if($copy){ print "<meta http-equiv=\"refresh\" content=\"0;URL=property_added_successfully.php\">"; //Writes the information to the database mysql_query("INSERT INTO `employees` VALUES ('$name', '$suburb', '$price', '$content', '$content2','$agentmobile', '$agentemail','$uploadFile0','$uploadFile1', '$uploadFile2', '$uploadFile3', '$uploadFile4', '$uploadFile5', '$uploadFile6', '$uploadFile7', '$uploadFile8')") ; } else{ echo "$file_name The File(s) could not be uploaded!<br>The file must be under 1 meg and be of a valid extension type, (jpeg, ,jpe, jpg, png or gif!<br /> <br /> Please go back and try agian"; } // end of loop //***FUNCTIONS //filter extensions function valid_ext($file_name) { $valid = array("jpeg","jpg","jpe","png","gif"); $extension = strtolower(substr($file_name,-3,3)); return (in_array($extension, $valid)); } //filter by size, function valid_size($size) { return ($size <= 1048576); } ?>
  24. either extra records or extra fields or maybe serialize!!.. just an idea
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.