Jump to content

pcw

Members
  • Posts

    285
  • Joined

  • Last visited

    Never

Everything posted by pcw

  1. Because I didnt think anybody would read and answer it, if it already had a reply. But you have kind of defeated the object by answering to this post :-(
  2. Hi, I need some help with this code. The following is just an example of what I have so far, as the script is in excess of 1000 lines. foreach ($part(split('/%%/', $templateflat)) { if ($part == "search results"){ print "Search Form"; } } With this code I get the error: Parse error: parse error, unexpected '{' in sb.php on line 233 if i remove '{' I get the error: Parse error: parse error, unexpected T_IF in sb.php on line 235 Can anybody tell me what I have done wrong? Try: foreach ($part(split('/%%/', $templateflat))) { if ($part == "search results"){ print "Search Form"; } } You were missing a ) Hi, thanks for your reply. I gave this a go and now get the error: Parse error: parse error, unexpected ')' in sb.php on line 233 I really cant figure out what is wrong :-(
  3. pcw

    foreach error

    Hi, thanks for your reply. I gave this a go and now get the error: Parse error: parse error, unexpected ')' in sb.php on line 233 I really cant figure out what is wrong :-(
  4. Hi, I need some help with this code. The following is just an example of what I have so far, as the script is in excess of 1000 lines. foreach ($part(split('/%%/', $templateflat)) { if ($part == "search results"){ print "Search Form"; } } With this code I get the error: Parse error: parse error, unexpected '{' in sb.php on line 233 if i remove '{' I get the error: Parse error: parse error, unexpected T_IF in sb.php on line 235 Can anybody tell me what I have done wrong?
  5. Hi, I am just translating some code from PERL to PHP: This is a line from the script that I have started to translate: if($rulepointer->['action'] == $action){ The -> does not seem to work. Is there a PHP equivalent?
  6. Thats great, thanks for your help :-)
  7. Hi, I am using this section of a PERL script as an example: my ($action, $return) = @_; my $out; I know that 'my' declares the listed variables to be local (lexically) amd was wondering if there was an equivalent to 'my' in PHP. Any help would be much appreciated
  8. Hi, im just developing some PHP software, for a site I am looking to build in the future. I am wondering if the following is possible, and how I would go about implementing it. From my admin area, I would like to have a page where I can set some rules. For example: Whilst on 'uploads' page if 'subscription' is equal to 'plus' then show 'uploads_plus' page The words in ' ' are variables that can be changed from the admin area. I kind of got the jist of it using $_VARIABLE['subscription'] = "$subscription"; if ($_VARIABLE['subscription'] == "") { header("location: test1.php"); exit (); } else { print "Show this..."; But I have to actually place it on the page that I want changed and can be kind of long with all the elseif's I would have to use. I dont want to have to put this on every page, is there a way I could include this information in a file, and have the page refer to that file to check what page is defined by the rule? Any help if much appreciated
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.