-
<html><head>
-
<title>Submit a URL</title>
-
</head>
-
<body>
-
<?php
-
-
$message = '<font color = "red">The following errors occured: <br/>';
-
$problem = FALSE;
-
-
if(!eregi("^[[:alpha:].'-] {4,} $", stripslashes(trim($_POST['name'])))) {
-
$problem = TRUE;
-
$message = '<p>Please enter a valid name(at least 4 characters)</p>;
-
}
-
-
if(!eregi("^[[:alnum:]] [a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$",
-
stripslashes(trim($_POST['email'])))) {
-
$problem = TRUE;
-
$message = '<p>Please enter a valid URL category</p>';
-
}
-
-
if (!isset($_POST['url_category']) OR !is_numeric($_POST['url_category'])){
-
$problem=TRUE;
-
$message='<p>Please enter a valid URL category</p>';
-
}
-
-
if (!$problem){
-
echo '<p>Thank you for the URL submission.</p>';
-
}else{
-
echo $message;
-
echo '</font><p>Please go back and try again</p>';
-
}
-
?>
-
</body>
-
</html>
-
Parse error: syntax error, unexpected T_STRING in C:\wamp\www\lab8q2\handle_submit_url.php on line 16
2 907
Hi
Replace your code with the below code -
<html><head>
-
<title>Submit a URL</title>
-
</head>
-
<body>
-
<?php
-
-
$message = '<font color = "red">The following errors occured: <br/>';
-
$problem = FALSE;
-
-
if(!eregi("^[[:alpha:].'-] {4,} $", stripslashes(trim($_POST['name'])))) {
-
$problem = TRUE;
-
$message = '<p>Please enter a valid name(at least 4 characters)</p>';
-
}
-
-
if(!eregi("^[[:alnum:]] [a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$",
-
stripslashes(trim($_POST['email'])))) {
-
$problem = TRUE;
-
$message = '<p>Please enter a valid URL category</p>';
-
}
-
-
if (!isset($_POST['url_category']) OR !is_numeric($_POST['url_category'])){
-
$problem=TRUE;
-
$message='<p>Please enter a valid URL category</p>';
-
}
-
-
if (!$problem){
-
echo '<p>Thank you for the URL submission.</p>';
-
}else{
-
echo $message;
-
echo '</font><p>Please go back and try again</p>';
-
}
-
?>
-
</body>
-
</html>
-
Thanks,
Mayur Bhayani
thanks, the message came out but i still got error. function eregi() is deprecated. do you know why?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Wescotte |
last post by:
The error message Parse error: syntax error, unexpected $end in FILE on
line X is one I run into frequently and I know the cause is I missed an
ending quote.
Is there an easy way to determine...
|
by: badkitty63 |
last post by:
I am getting this error Help!!!!!!
Parse error: syntax error, unexpected T_STRING in /home/desertr3/public_html/includes/languages/english/shipping.php on line 18
I am trying to add shipping...
|
by: rhys |
last post by:
My Gurus and Angels --
Please pardon this old-school programmer, only recently enlightened to open-source, having been trapped in the convenience of proprietary lingos for way too long. My...
|
by: sclarkstone |
last post by:
Im getting this error;
Parse error: syntax error, unexpected T_STRING, expecting ':' or ';'
with this line;
header ('postcodesearch.php?e=nw&pcode=',);
I cant find whats wrong, can anyone...
|
by: fburn |
last post by:
I need some help with an error I'm getting using php 5.2.5 running on linux.
I receive an error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or...
|
by: paulrajj |
last post by:
hi to all,
i am getting syntax error on my code..
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D:\xampp\htdocs\Dummy\paulraj\matrim\exam.php on line 62
...
|
by: benicio |
last post by:
Parse error: syntax error, unexpected T_STRING, expecting '(' in C:\wamp\www\study_group\includes\functions.php on line 19
I got this error and this syntax is from 8 to 19th line.
<?php
...
|
by: riverdale1567 |
last post by:
Hi I am a newbie trying to get some of my first code working, yada yada yada.
I have a drop down box which chooses a state then takes the post data to 'processform2.php' to use that to pull up...
|
by: 9139530 |
last post by:
Hey, I'm getting the error:
Parse error: syntax error, unexpected T_VARIABLE in Z:\home\baza\www\get2.php on line 7
with this code (have 2 pages , html-from page (reguser.php) and...
|
by: tiff zhan |
last post by:
the error
public function getTable($tableName)
{
if (!isset($this->_tables)) {
$this->_tables = Mage::getSingleton('core/resource')->getTableName($tableName);
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
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...
|
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: 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,...
|
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...
|
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: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| | |