Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Syntax Error... Need a little help here...
Old 10-18-2011, 05:40 PM Syntax Error... Need a little help here...
Ultra Talker

Posts: 494
Name: Mark
Trades: 0
Pretty new to PHP - I have a script and the error msg. keeps giving me a message of "Parse error: syntax error, unexpected ',' in /home/content/b/i/g/bigcat1967/html/registernext.php on line 9"


Here is the script:

<?php
include('connectionfile.php');
$test=$_post(username);
if (!eregi("([^A-Za-z0-9]"),$test)) {

}

else
{
header("Location:invalidname.htm");
}

I know - probably something stupid that I'm missing.

thx guys
__________________

Please login or register to view this content. Registration is FREE
||
Please login or register to view this content. Registration is FREE
|| You
Please login or register to view this content. Registration is FREE
bigcat1967 is offline
Reply With Quote
View Public Profile Visit bigcat1967's homepage!
 
 
Register now for full access!
Old 10-18-2011, 06:05 PM Re: Syntax Error... Need a little help here...
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
In the future use the PHP tags when posting, it makes reading your code much easier. Also, if you have an error on a particular line it helps if you indicate which line it is in your code.

The error is on this line:
PHP Code:
if (!eregi("([^A-Za-z0-9]"),$test)) { 
You put one of the regex parens outside of the quotes. Try:
PHP Code:
if (!eregi("([^A-Za-z0-9])",$test)) { 
Also, ereg functions have been deprecated. You should be using preg functions.

PHP Code:
if (!preg_match("/([^A-Za-z0-9]/i"),$test)) { 
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by NullPointer; 10-19-2011 at 09:36 AM..
NullPointer is offline
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 10-19-2011, 09:08 AM Re: Syntax Error... Need a little help here...
Ultra Talker

Posts: 494
Name: Mark
Trades: 0
Thanks for your help Null!
__________________

Please login or register to view this content. Registration is FREE
||
Please login or register to view this content. Registration is FREE
|| You
Please login or register to view this content. Registration is FREE
bigcat1967 is offline
Reply With Quote
View Public Profile Visit bigcat1967's homepage!
 
Reply     « Reply to Syntax Error... Need a little help here...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.57553 seconds with 12 queries