-
Posts
167 -
Joined
-
Last visited
Never
Everything posted by salman_ahad@yahoo.com
-
Script to catch email addresses in paragraph.
salman_ahad@yahoo.com replied to salman_ahad@yahoo.com's topic in Regex Help
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 -
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??
-
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);
-
[SOLVED] Importing data from excel 97-03
salman_ahad@yahoo.com replied to salman_ahad@yahoo.com's topic in PHP Coding Help
Thanks I just saved the file as .CSV and imported the file. It did just perfect! -
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...
-
can I call a class like this ?
salman_ahad@yahoo.com replied to salman_ahad@yahoo.com's topic in PHP Coding Help
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? -
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");
-
Optimized php page
salman_ahad@yahoo.com replied to salman_ahad@yahoo.com's topic in PHP Coding Help
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? -
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
-
Need help with sessions
salman_ahad@yahoo.com replied to salman_ahad@yahoo.com's topic in PHP Coding Help
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? -
[SOLVED] Delete rows belonging to datetime
salman_ahad@yahoo.com replied to salman_ahad@yahoo.com's topic in PHP Coding Help
Fixed it!! thanks though Maq $query_users = mysql_query("DELETE FROM test1 WHERE date_time < (curdate() - 2)")or die(mysql_error()); -
[SOLVED] Delete rows belonging to datetime
salman_ahad@yahoo.com replied to salman_ahad@yahoo.com's topic in PHP Coding Help
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 -
.. $query = mysql_query("DELETE FROM *table* WHERE datetime > 3 days back")or die(mysql_error()); My error?
-
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.
-
DELETE rows based on content
salman_ahad@yahoo.com replied to salman_ahad@yahoo.com's topic in PHP Coding Help
It deleted my all 8000 entries in database, any possibility to back that up? -
DELETE rows based on content
salman_ahad@yahoo.com replied to salman_ahad@yahoo.com's topic in PHP Coding Help
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. -
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
-
[SOLVED] utf8_general_ci error ??
salman_ahad@yahoo.com replied to salman_ahad@yahoo.com's topic in PHP Coding Help
Yeah it was un escaped data...It fixed it...thanks!! -
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??
-
[SOLVED] Check response from API ??
salman_ahad@yahoo.com replied to salman_ahad@yahoo.com's topic in PHP Coding Help
Any help ?? -
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 ??
-
How to shuffle data in any table ?
-
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 { ................ ................ } } }
-
[SOLVED] MySQL LIMIT error
salman_ahad@yahoo.com replied to salman_ahad@yahoo.com's topic in PHP Coding Help
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 -
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?