Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Easy Date   I Sell Pagerank   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 12-03-2003, 01:56 PM   #1 (permalink)
v7n Mentor
 
Pretend's Avatar
 
Join Date: 10-13-03
Location: Ft. Lewis, WA
Posts: 3,264
iTrader: 0 / 0%
Pretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest order
Send a message via AIM to Pretend Send a message via Skype™ to Pretend
Script Problem...

Whenever someone tries to send the application form at http://optikhosting.com/~cyngo/editorapplication.php they get this...

Parse error: parse error, expecting `')'' in /home/cyngo/public_html/sendapplication.php on line 19

here's the code..

[code:1:600055d5c1]
<?

################################################## #########
# CONFIGURE THE FOLLOWING VARIABLES #
################################################## #########

// Recipient of message (This can be changed via the form itself)
$recipient = 'apply@cyngoseek.com';

// Subject of message (This can be changed via the form itself)
$subject = 'Editor Application';

// This is a list of domains that can run EZ FormMail. Do not include
// www, just the actual domain/ip address!
$referers = array('cyngoseek.com', 'optikhosting.com/~cyngo'');

// This is the page that users will be redirected to after the form is
// processed successfully.
$success_url = 'http://optikhosting.com/~cyngo/';

// Your site URL
$siteurl = 'http://www.cyngoseek.com';

################################################## #########
# DO NOT EDIT BELOW THIS LINE #
################################################## #########

function Print_Footer() {
echo '';
}

function Check_Referer() {
global $referers;
$temp = explode('/', $_SERVER['HTTP_REFERER']);
$referer = $temp[2];
$found = false;
foreach ($referers as $domain) {
if (stristr($referer, $domain)) { $found = true; }
}
return $found;
}

if ($_POST) {
if (Check_Referer() == false) {
echo '<font size="+1" color="#FF0000">Error: Invalid Referer</font><BR>';
echo 'You are accessing this script from an unauthorized domain!';
Print_Footer();
die();
}
$ctr = 0;

$isrealname = 0;
$isemail = 0;

foreach ($_POST as $key => $val) {
if ($key == 'realname') { $isrealname = 1; }
if ($key == 'email') { $isemail = 1; }
if (substr($key, 0, 4) == 'req_' || $key == 'realname' || $key == 'email') {
if ($val == '') {
if ($ctr == 0) {
echo '<font size="+1" color="#FF0000">Error: Missing Field(s)</font><BR>';
echo 'The following <i>required</i> field(s) were not filled out:<BR>';
}
echo '<BR>- <b>'.substr($key, 4).'</b>';
$ctr++;
}
}
}
if ($ctr > 0) {
echo '<p>Click <a href="javascript:history.go(-1)">here</a> to go back';
Print_Footer();
die();
}
else {
if ($isrealname == 0) {
echo '<font size="+1" color="#FF0000">Error: Missing Field</font><BR>';
echo 'No "realname" field found.<p><a href="'.$siteurl.'">here</a> to return to the home page.';
Print_Footer();
die();
}
elseif ($isemail == 0) {
echo '<font size="+1" color="#FF0000">Error: Missing Field</font><BR>';
echo 'No "email" field found.<p><a href="'.$siteurl.'">here</a> to return to the home page.';
Print_Footer();
die();
}
}

if (!(preg_match("/^.{2,}?@.{2,}\./", $_POST['email']))) {
echo '<font size="+1" color="#FF0000">Error: Invalid E-mail</font><BR>';
echo 'The e-mail address you entered (<i>'.$_POST['email'].'</i>) is invalid.';
Print_Footer();
die();
}

$body = "Below is the result of your feedback form. It was submitted on:\n".date('l, F jS, Y').' at '.date('g:ia'

).".\n";

foreach ($_POST as $key => $val) {
if ($key == 'recipient') { $recipient = $val; }
elseif ($key == 'subject') { $subject = $val; }
else {
if ($key != 'realname' && $key != 'email') {
$body .= "\n".str_replace('req_', '', $key).": $val";
}
}
}
$body .= "\n\n-------- Submission Details --------\n";
$body .= "Remote Address: ".getenv('REMOTE_ADDR')."\n";
$body .= "HTTP User Agent: ".getenv('HTTP_USER_AGENT')."\n\n";
$body .= "--------------------------------------------------\n";
$body .= "";

$mailheaders = "From: ".$_POST['realname']." <".$_POST['email'].">\n";
$mailheaders .= "Reply-To: ".$_POST['email'];

mail($recipient, $subject, $body, $mailheaders);
header("Location: $success_url");
}
else {
echo '<center>You have access this page from an invalid location. Please click <a href="'.$siteurl.'">here</a> to go

to '.$siteurl.'.</center>';
}

Print_Footer();
?>[/code:1:600055d5c1]

Can anyone tell me why it won't work?
__________________
My posts were too dang barren, so this got thrown in to take up a little bit of space.
Pretend is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 12-03-2003, 02:06 PM   #2 (permalink)
Inactive
 
Join Date: 10-12-03
Location: Cranberry Township
Posts: 275
iTrader: 0 / 0%
niceguyeddie is just really niceniceguyeddie is just really niceniceguyeddie is just really niceniceguyeddie is just really niceniceguyeddie is just really niceniceguyeddie is just really niceniceguyeddie is just really niceniceguyeddie is just really niceniceguyeddie is just really niceniceguyeddie is just really niceniceguyeddie is just really nice
Send a message via ICQ to niceguyeddie
$referers = array('cyngoseek.com', optikhosting.com/~cyngo'');

to

$referers = array('cyngoseek.com', 'optikhosting.com/~cyngo');
niceguyeddie is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-03-2003, 02:21 PM   #3 (permalink)
v7n Mentor
 
Pretend's Avatar
 
Join Date: 10-13-03
Location: Ft. Lewis, WA
Posts: 3,264
iTrader: 0 / 0%
Pretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest order
Send a message via AIM to Pretend Send a message via Skype™ to Pretend
Thanks a lot, works now.
__________________
My posts were too dang barren, so this got thrown in to take up a little bit of space.
Pretend is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-03-2003, 03:03 PM   #4 (permalink)
Inactive
 
Leader of Men's Avatar
 
Join Date: 10-12-03
Location: Minnesota, USA
Posts: 2,207
iTrader: 0 / 0%
Latest Blog:
None

Leader of Men is just really niceLeader of Men is just really niceLeader of Men is just really niceLeader of Men is just really niceLeader of Men is just really niceLeader of Men is just really niceLeader of Men is just really niceLeader of Men is just really niceLeader of Men is just really niceLeader of Men is just really niceLeader of Men is just really nice
Send a message via AIM to Leader of Men Send a message via MSN to Leader of Men Send a message via Yahoo to Leader of Men
Ah man! I actually new this one too!
Leader of Men is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-03-2003, 04:08 PM   #5 (permalink)
v7n Mentor
 
Pretend's Avatar
 
Join Date: 10-13-03
Location: Ft. Lewis, WA
Posts: 3,264
iTrader: 0 / 0%
Pretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest orderPretend is a web professional of the highest order
Send a message via AIM to Pretend Send a message via Skype™ to Pretend
lol

I knew that, I just overlooked it when I looked over it a million times...like usual.
__________________
My posts were too dang barren, so this got thrown in to take up a little bit of space.
Pretend is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-03-2003, 05:32 PM   #6 (permalink)
Moderator
 
LazyJim's Avatar
 
Join Date: 10-13-03
Location: UK
Posts: 2,819
iTrader: 0 / 0%
Latest Blog:
None

LazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to all
Send a message via MSN to LazyJim
hehe yeah was easy to spot when u havn't been staring at it
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
LazyJim is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-04-2003, 06:16 PM   #7 (permalink)
Contributing Member
 
Join Date: 10-14-03
Location: UK
Posts: 181
iTrader: 0 / 0%
Latest Blog:
None

tigermann is on the right pathtigermann is on the right pathtigermann is on the right path
niceguyeddie = eagle-eyed eddie
tigermann is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with my script rob7676 Coding Forum 5 01-14-2008 07:32 AM
PHP script config problem Optix Coding Forum 5 04-29-2007 05:18 AM
Problem with joke of the day script... CircleOfLinks Coding Forum 0 10-13-2006 06:26 AM
ok...new problem..google ads script drew68 Blogging Forum 21 07-27-2006 01:33 AM
PHP + MySQL script problem Limit Coding Forum 14 12-13-2004 08:54 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 10:48 AM.
© Copyright 2008 V7 Inc