Reply
Help identifying unexpected t_variable
Old 08-25-2009, 09:56 PM [SOLVED] Help identifying unexpected t_variable
Skilled Talker

Posts: 84
Trades: 0
Just a quick question for someone with a better PHP eye than me...

I'm getting this error:

Code:
Parse error:  syntax error, unexpected T_VARIABLE in /[directory]/test.php on line 22
In this code...

PHP Code:
<?php
require_once("../[directory]/api/api.php");
$fields ft_api_init_form_page(28);
 
// validation time!
$errors = array();
if (isset(
$_POST['submit']))
{
  
$rules = array();
  
$rules[] = "required,how_they_heard_about_us,Please select a referral source.";
  
$rules[] = "required,email,Please enter your email address.";
  
$errors validate_fields($_POST$rules);
 
  
// no errors - great! Now we process the page. The ft_api_process_form does
  // the job of both updating the database and redirecting to the next page
  
if (empty($errors))
  {
      
$criteria = array(
  
"email" => $_POST["email"]
);
if (
ft_api_check_submission_is_unique(28 $criteria))
{
  
// uh-oh! A submission already exists with this email address! Abort, abort! 
  // here, you could do something like set a variable like: $already_exists = true
  // and in the webpage do a little test to see if it's set. If so, let the user know 
  // what's going on
  
  
$already_exists true;
  
}
else
{
  
// call ft_api_process_form function here to continue processing the form submission
      
$params = array(
      
"submit_button" => "submit",
      
"next_page" => "thanks.php",
      
"form_data" => $_POST,
      
"finalize" => true
    
);
    
ft_api_process_form($params);
  
}      
      
      

  }
}
?>
But for the life of me I can't seem to figure out where the t_variable is...

Any help would be greatly appreciated -- thanks!


EDIT: had to put in a comma between 28 and $criteria...

Last edited by msaz87; 08-26-2009 at 12:32 AM.. Reason: solved
msaz87 is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 08-26-2009, 06:23 AM Re: Help identifying unexpected t_variable
lizciz's Avatar
Ultra Talker

Posts: 334
Name: Mattias Nordahl
Location: Sweden
Trades: 0
The number 28 shouldn't be there. In the line

if (ft_api_check_submission_is_unique(28 $criteria))


EDIT: Oh, Didn't see your edit. So the problem's solved then?
__________________
596f75206d65616e20796f752063616e2061637475616c6c79 207265616420746869733f

Last edited by lizciz; 08-26-2009 at 06:25 AM..
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Reply     « Reply to Help identifying unexpected t_variable
 

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.10900 seconds with 13 queries