473,394 Members | 1,840 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,394 software developers and data experts.

Newbie need help with a solution of the syntax error?

4
Could I have a problem in the following syntax error:

Deprecated: Function eregi () is deprecated in C: \ xampp \ htdocs \ holiday-shelter \ feedback_kirim.php on line 8
Your email is wrong


and this is the script:

Expand|Select|Wrap|Line Numbers
  1. <?php 
  2. $NmAnda=$_POST['TxtNmAnda']; 
  3. $EmAnda=$_POST['TxtEmAnda']; 
  4. $TelpAnda=$_POST['TxtNoAnda']; 
  5. $pesan=$_POST['TxtPesan']; 
  6.  
  7. function CekEmail ($email) { 
  8.     if (eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",$email)) 
  9.     { 
  10.         return TRUE; 
  11.     } 
  12.     else { 
  13.         return FALSE; 
  14.     } 
  15.  
  16. if ($NmAnda=="") { 
  17.     echo "Your name is empty"; 
  18. else if (! CekEmail($EmAnda)) { 
  19.     echo "Your email is wrong"; 
  20. else if ($TelpAnda=="") { 
  21.     echo "Your Telephone is empty"; 
  22. else if ($pesan=="") { 
  23.     echo "Your message is empty"; 
  24. else { 
  25.     $noip = getenv("REMOTE_ADDR"); 
  26.     $$httpref = getenv("HTTP_REFERER"); 
  27.     $httpagen = getenv("HTTP_USER_AGENT"); 
  28.  
  29.     $hariini = date("1, fj, y, g:i a"); 
  30.     $pesan = stripcslashes($pesan); 
  31.  
  32.     $isipesan = "$hariini \n "; 
  33.     $isipesan .= "From : $NmAnda ($EmAnda) 
  34.     n"; 
  35.     $isipesan .= "Feedback : $pesan \n"; 
  36.     $isipesan .= "Additional Info : IP = $noip \n"; 
  37.     $isipesan .= "Browser = $httpagen \n"; 
  38.     $isipesan .= "Referral = $httpref"; 
  39.  
  40.     $from = "From : $EmAnda \r\n"; 
  41.  
  42.     $kirim=mail("rizkywk@yahoo.com",$TelpAnda,$isipesan, $from); 
  43.  
  44.     if ($kirim) { 
  45.         echo "Your message has been sent"; 
  46.     } 
  47.     else { 
  48.         echo "Your message has been failed"; 
  49.     } 
  50. ?>
  51.  
please i need a solution to this problem !!
May 7 '11 #1
1 1353
johny10151981
1,059 1GB
your used function is depreciated by PHP
to view detail follow the link

to avoid the warning use @ at the beginning of the function
May 9 '11 #2

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

Similar topics

5
by: paul brown | last post by:
Hi, I have this website that contains an internal message system that allows users to send each other "email" messages. My client wants me to extend the system so that when a user receives an...
0
by: Justin Case | last post by:
I have a Perl app that stores pictures in a blob. Now I want to load a thumbnail version of the picture into another blob column, but the update fails with a syntax error. I'm able to insert the...
4
by: Chris Kettenbach | last post by:
Hi Peter, I get error when processing the stylesheet. It errors here. <xsl:for-each select="registration)=1]"> specifically: Expression does not return a DOM node. registration)=1]<--
7
by: ceasar | last post by:
Hello all, My editor seems to not accept the following: Dim color As New System.Drawing.Color If node.ForeColor Is color.Violet Then Exit Sub Form1.vb(363): 'Is' requires operands that have...
2
by: trevor.niemack | last post by:
I have got some code to attach a doc to an email but I have a few problems with it. The first is a syntax error on the code below: ElseIf ListBox1.Items.ToString <> ("") Then Dim Counter As...
2
by: trpost | last post by:
I hope this is a simple fix, but it has been driving me crazy, I have the following code, that errors out with a syntax error: <INPUT TYPE=button...
1
by: gatorfalcon | last post by:
I'm using mysqli_multi_query to run multiple queries concatenated with a semicolon that I set using the HEREDOC format. What's weird is that this works fine on my development system on my laptop...
17
by: trose178 | last post by:
Good day all, I am working on a multi-select list box for a standard question checklist database and I am running into a syntax error in the code that I cannot seem to correct. I will also note...
3
by: broll911 | last post by:
I am gettin a error message on this script can someone help me. I am a complete newbie on this stuff. Thanks in advance for any help you can give me. here is the error. Parse error: syntax error,...
11
by: Blondie1966 | last post by:
Im trying to write a program about a truck inventory with trucks coming and going and the amount in each one, but keep coming up with declaration syntax error.. Any help would be greatly appreciated....
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: 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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.