How to use example print function to print within your php code?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • beezgoodtimez
    New Member
    • Apr 2012
    • 3

    How to use example print function to print within your php code?

    Have an idea to be able to allow clients to submit email address and then my db will place email address within php code .

    Code:
    
    <?php
    
    include_once "scripts/connect_to_mysql.php";
    
    $id = mysql_real_escape_string($id);
    $id = eregi_replace("`", "", $id);
    
    $sql = mysql_query("SELECT * FROM contactInfo WHERE id='$id'");
    
    
    
    
    	while($row = mysql_fetch_array($sql)){ 
    	
    	
    	
    	$contactEmail = $row4["contactEmail"];
    	$contactEmail = "$contactEmail";
    	
    	
    	}
    //////////////////this is where the client email go below///////////	
    
        $email_to =   'someone@mail.com'; //the address to which the email will be sent
    ?>
    
    <?php print "$contactEmail"; ?>
  • PsychoCoder
    Recognized Expert Contributor
    • Jul 2010
    • 465

    #2
    I would get rid of the eregi_replace function. Per the PHP site:

    Warning
    This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.
    I would suggest you look at preg_replace and see if it's what you're looking at.

    Comment

    • beezgoodtimez
      New Member
      • Apr 2012
      • 3

      #3
      Thanks for that info

      Comment

      Working...