Jump to content

salman_ahad@yahoo.com

Members
  • Posts

    167
  • Joined

  • Last visited

    Never

Posts 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. 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...

  5. 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? 
    

     

     

  6. 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

  7. 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?

  8. 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.
    

  9. 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??

     

     

  10. 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 ??

  11. 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 
    		{
                             ................
                             ................
    	         }
    	}
    }
    
    
    

  12. 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

     

     

  13. 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.