473,386 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 .

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
2 1654
PsychoCoder
465 Expert Mod 256MB
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
Thanks for that info
May 10 '12 #3

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

Similar topics

3
by: Andrew Boothman | last post by:
Hi, This may be the dumbest question ever, but in the following code (using PHP 4.3.8) how do I call b() from within a()? class test { function a() { print "a called"; b();
12
by: Christopher J. Bottaro | last post by:
I want to get the name of the function from within the function. Something like: def myFunc(): print __myname__ >>> myFunc() 'myFunc' Really what I want to do is to easily strip off the...
2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
2
by: Lauren Quantrell | last post by:
Maybe this is just a bit too strange... Is there a way to get the name of the Function or Sub from within that Function or Sub? For example, I have the following code: Function...
13
by: ukrbend | last post by:
I'm new to Javascript and to html and am trying to make the following code snippet work but it doesn't. It refuses to call the getPage() function and I always get a 404 error. I know the code is...
5
by: j_depp_99 | last post by:
Could someone check my code as to why my print function is not working? Also my pop member function is getting an error in main. <code> template<class Type> void Novice<Type>::Print() {...
41
by: Cartoper | last post by:
I hear it is possible to disable the web browsers print function, does anyone know how to do that?
1
by: 7nan | last post by:
hi there, here I have a qustion, which says; (((Write a course class which contains number of credits and a string id. In addition to the constructor, it should contain a print function))) so,...
0
by: agarwalsunitadhn | last post by:
hi.. How will i use print and print preview option. I have to print only a part of a page. for that i declare in a div and give that a id and then using java function to print that portion but my...
5
by: hurricane_number_one | last post by:
I'm trying to have a class, which uses threads be able to raise events to the form that created it. I've seen solutions around the net for this, but I didn't really like their implementation. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.