Jump to content

salman_ahad@yahoo.com

Members
  • Posts

    167
  • Joined

  • Last visited

    Never

Everything posted by salman_ahad@yahoo.com

  1. Yes I think it should be in regex, but I dont know how ?? My updated code if ($_POST['Submit']) { $para = $_POST['para']; $emails = split('[<>;:,\/"{}*!?]',$para); foreach ($emails as $email) { if (empty($email)) { continue;} if(stristr($email, '@') === FALSE) { //Checking for those strings containing '@' continue;} else { echo $email.'<br \>'; } } } My output is almost there...but I am also getting strings like name@yahoo.co.in ---------- Forwarded message ---------- From //in these type of strings I think need to use regex... any help
  2. I have a pragraph full of email addresses. I need to catch emails only and ignore the rest. if ($_POST['Submit']) { $para = $_POST['para']; $emails = split('[<>;:,\/"{}*!?]',$para); foreach ($emails as $email) { if (empty($email)) { continue;} //I need help here for deleting those empty rows. else { // echo $email.'<br \>'; // or insert in database..... ............ } } } Also I need help applying this email validation ereg, guide me here too please $regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$"; //or '/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$/' //or Anything better before inserting in database??
  3. Need to send email in a email template like iContact or ConstantContact. $email_id="user@mysite.com"; $subject="Hi" $message=""//I need to insert a email template saved as photoshop image on my computer. How to do it? Or is there any other way to do it? mail($email_id, $subject, $message);
  4. Thanks I just saved the file as .CSV and imported the file. It did just perfect!
  5. How do attach excel wooksheet(import) in MySql table "emails", Col 1: email_id, Col 2: emails I saved the data in excel (97-03) where in sheet 1 I have the data, column 1 is headed as email_id and Column 2 is headed as email. Need to import that data in table, do I need to write php code or just import from import button. Does it need to be in CSV form? Please help...
  6. I dont know where is php.ini file on my godaddy server ?? Anyone ?? Also I am calling this url from www.mysite.com in a file http://subdomain.mysite.com so if I give the path it will be point to subdomain root folder, but how do I point to mysite root folder?
  7. I am getting a warning and error... [function.require]: failed to open stream: no suitable wrapper could be found in require("http://www.mysite.com/include/categories.php");
  8. Any way we could code this like $URL= //fetch the url customer is on if URL="http://a.mysite.com" { <div class="categories"> b.mysite.com c.mysite.com d.mysite.com </div> } ... if URL="http://b.mysite.com" { <div class="categories"> a.mysite.com c.mysite.com d.mysite.com </div> } ... if URL="http://c.mysite.com" { <div class="categories"> a.mysite.com b.mysite.com d.mysite.com </div> } ... if URL="http://d.mysite.com" { <div class="categories"> a.mysite.com b.mysite.com c.mysite.com </div> } //Something like this?
  9. I have categories on top of the webpage like "Advertise", "Entrepreneur", "Shetech", "Smartphones" etc. <?php include("includes/categories.php"); ?> //The categories include file will be called by those subdomain. It shall look like this <div><ul class="categories"> <li><a href="http://advertise.ideatoceo.com/">Advertising</a></li> <li><a href="http://entrepreneur.ideatoceo.com">Entrepreneur</a></li> <li><a href="http://shetech.ideatoceo.com">She TECH </a></li> <li><a href="http://smartphones.ideatoceo.com">Smart Phones </a></li> </div> I want to keep this <div> class in some include file and call it on those subdomain pages. For example if http://advertise.ideatoceo.com/ is calling this include file...it should show to user as <div> <li><a href="http://entrepreneur.ideatoceo.com">Entrepreneur</a></li> <li><a href="http://shetech.ideatoceo.com">She TECH </a></li> <li><a href="http://smartphones.ideatoceo.com">Smart Phones </a></li> </div> // since advertise is calling it, I want to exclude advertise link here. Similarly if "Enterpreneur" is calling this include file, //need to exclude "http://entrepreneur.ideatoceo.com" Any help
  10. To be frank, I have no knowledge of sessions. All I want is second user at the same time should be in session queue when first is already using it. if ( $_POST ['Submit']) { $user = $_POST ['usernm']; $username = strtolower($user); $password = $_POST ['userpw']; //What does these two lines do? session_start(); $_SESSION['username']=$user; //Do I need to include any file and what?
  11. Fixed it!! thanks though Maq $query_users = mysql_query("DELETE FROM test1 WHERE date_time < (curdate() - 2)")or die(mysql_error());
  12. Any HELP $query_users = mysql_query("DELETE FROM *table* WHERE date_time < SYSDATE - 3 ")or die(mysql_error()); //I am trying to delete all data 3 days old
  13. .. $query = mysql_query("DELETE FROM *table* WHERE datetime > 3 days back")or die(mysql_error()); My error?
  14. I have a form on my website where users are allowed to fill it and use the application. How do I create a session for them ? if ( $_POST ['Submit']) { $user = ($_POST ['usernm']); $username = strtolower($user); $userpassword = ($_POST ['userpw']); ... ...//my application where session to be used to deploy. Need help to place this username and password in session.
  15. It deleted my all 8000 entries in database, any possibility to back that up?
  16. by placing '%http://www.bit.ly/abcd%' it will check that link anywhere in the sentence right?? or search for only that link...I need to be able to delete all sentences which does not contain that link.I hope your solution will fix it.
  17. I have a link in my rows $bit="http://bit.ly/abcd"; $query = mysql_query("DELETE FROM *table* WHERE sentence........"); //I need to delete all sentence rows which DOES NOT contain my $bit ..pls help
  18. I have all kinds of data to be inserted in database table //I am getting this error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't Some of my data contains :-), doesn't, ), ;, #,$, etc. Am I getting this error as my table is listed as utf8_general_ci?? What is my fix??
  19. From API class, if I get success...need to insert in table ...//API class if($resultArray['http_code'] == "200") { $response = "Success"; } else { $response = "Failed"; } return $response; ...//My Class if ($response=="Success") { $query = ("INSERT INTO *table*.......); } What am I missing ??
  20. What is my error?...I need to send message[$x] to user[$w]...but is is not working ... $userArray['username'][$w]=$row['usernm']; //getting users from user table $messageArray['message'][$x]=$row['message']; //getting messages from message table ... for($i=0 ; $i<$userCounter ; $i++) //I checked the counter, it has correct no: of users { while ($w==$x) { $username=$userArray['username'][$w]; $message=$messageArray['message'][$x]; if(strlen($message)<1) { echo $error; } else { ................ ................ } } }
  21. Only Taqui and Mike worked... if(isset($_POST['Submit'])) { $VarCount=mysql_real_escape_string($_POST['limit']); $query = mysql_query("SELECT * FROM test WHERE id NOT IN (SELECT id FROM test1) ORDER BY datetime DESC LIMIT $VarCount") or die(mysql_error()); Thanks
  22. I am still getting error.. $Var=$_POST['limit']; $VarCount = mysql_real_escape_string($Var); $query = mysql_query("SELECT * FROM test WHERE id NOT IN (SELECT id FROM test1) AND LIMIT $VarCount ORDER BY datetime DESC ") or die(mysql_error()); //error //You have an error in your SQL syntax;...check near LIMIT...etc If I replace $VarCount(user defined) by 2,3,4(any integer).....it is working. Any ideas?
×
×
  • 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.