By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,521 Members | 1,460 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,521 IT Pros & Developers. It's quick & easy.

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

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

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. <?php
  4.  
  5. include_once "scripts/connect_to_mysql.php";
  6.  
  7. $id = mysql_real_escape_string($id);
  8. $id = eregi_replace("`", "", $id);
  9.  
  10. $sql = mysql_query("SELECT * FROM contactInfo WHERE id='$id'");
  11.  
  12.  
  13.  
  14.  
  15.     while($row = mysql_fetch_array($sql)){ 
  16.  
  17.  
  18.  
  19.     $contactEmail = $row4["contactEmail"];
  20.     $contactEmail = "$contactEmail";
  21.  
  22.  
  23.     }
  24. //////////////////this is where the client email go below///////////    
  25.  
  26.     $email_to =   'someone@mail.com'; //the address to which the email will be sent
  27. ?>
  28.  
  29. <?php print "$contactEmail"; ?>
  30.  
  31.  
  32.  
  33.  
May 8 '12 #1
Share this Question
Share on Google+
2 Replies


PsychoCoder
Expert Mod 100+
P: 465
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.
May 10 '12 #2

P: 3
Thanks for that info
May 10 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.