473,805 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Newbie need help with a solution of the syntax error?

4 New Member
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 1369
johny10151981
1,059 Top Contributor
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
11147
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 internal message, the system will send an actual email to the user's email address. here's the sample code: function notify_recipient()
0
891
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 new record, with blobs, into a separate table, but can't update the original record. Is it not possible to update blobs?
4
1833
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
3854
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 reference types, but this operand has the value type 'System.Drawing.Color'. where node is Treenode (of Treeview)
2
1043
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 Integer For Counter 0 To listbox1.Items.Count - 1 the 0 is underlined with a syntax error.
2
5170
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 OnClick=javascript:window.location='edit.php?action=remote&ID=1234&pw='+this.form.password.value+; VALUE=remote update> The specific piece that I narrowed the error down to is: +this.form.password.value+;
1
2285
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 (a PC running PHP 5.x and mysql5.x). When I bring the code onto a linux system (with my ISP), the code chokes with a syntax error near the first semicolon. I believe they too are running PHP 5.x and mysql 5.x. Any clues what's going on? I mean,...
17
3146
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 that I am using Allen Browne's multi-select list box for a report as a guide. I should also note that my access skills are not the best so I may need some explaining on certain things. First let me give some background on the database: I have a...
3
5070
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, unexpected T_VARIABLE in /home/content/m/i/x/mixxsalon/html/FormToEmail.php on line 1 here is the code. <?php $my_email = "user@example.com"; /*
11
3338
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. Im using Borland C++. Thanks #include <iostream.h> #include <iomanip.h> #include <stdlib.h> #include <conio.h> #include <string.h> #include <ctype.h>
0
9596
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10607
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10364
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5541
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4317
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3843
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.