Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
  1. #1
    Senior Member tekp's Avatar
    Join Date
    Jan 2004
    Location
    A small village near a small city near a small cit
    Posts
    918
    Member #
    4667
    Liked
    1 times
    I'm about to unveil a website to a client but there's a PHP error on one of my files:

    www.ssnmentalhealth.co.uk/membership/index.php

    Here is the line: (188):

    Code:
    $iama = $_POST['iama_other'];
    And here's it's context (second line on here):

    Code:
    if($_POST['iama'] == "other") {
       $iama = $_POST['iama_other'];
      } else {
       $iama = $_POST['iama'];
      }
    I have no idea what's wrong, and it was working a couple of weeks ago then I go away and come back and now this!

    Can somebody help me? I've been staring at that code for a little over a day and can't see anything wrong with it...

    Thanks
    tekp :cheeky: tekponline.com

  2.  

  3. #2
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Hm, I am not sure what your trying to do, but whether your condition returns true or false, the same line of code is executed.

  4. #3
    Senior Member tekp's Avatar
    Join Date
    Jan 2004
    Location
    A small village near a small city near a small cit
    Posts
    918
    Member #
    4667
    Liked
    1 times
    How?

    If a variable equals 'other' then $iama is set to something, but if it's not 'other' $iama is set to something else.
    tekp :cheeky: tekponline.com

  5. #4
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Hm, sorry, I must have looked at it wrong.

    The only thing I can see wrong, is you may have changed the name of the form element being posted?

  6. #5
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    Have you scrutinized your code for missing '$' signs and missing ';' in the preceding line?
    S. Rosland

  7. #6
    Senior Member tekp's Avatar
    Join Date
    Jan 2004
    Location
    A small village near a small city near a small cit
    Posts
    918
    Member #
    4667
    Liked
    1 times
    Quote Originally Posted by rosland
    Have you scrutinized your code for missing '$' signs and missing ';' in the preceding line?
    The preceding line is the first line on that group of code.

    I think I already did, but I'll check all the form elements again.

    Thanks
    tekp :cheeky: tekponline.com

  8. #7
    Senior Member Fallout's Avatar
    Join Date
    Aug 2003
    Location
    Richmond, Virginia
    Posts
    543
    Member #
    2748
    It's moved to line 189 for what that's worth.

  9. #8
    Senior Member mossoi's Avatar
    Join Date
    Apr 2003
    Location
    Englandshire, United Kingdomsville y'all!
    Posts
    1,111
    Member #
    1206
    Liked
    1 times
    This sort of error can be caused by a number of things, sometimes from elsewhere in the code. Any chance we can have a look at the code for the whole page?

  10. #9
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Yeah, that would be most useful. It looks like it's finding a string where it's not expecting it, but I'm not sure what a constant encapsulated string is supposed to be... Probably refers to the stuff inside the $_POST...

    Different form names shouldn't cause this, as they lead to a blank variable, not an error. At least not in my experience.

  11. #10
    Senior Member tekp's Avatar
    Join Date
    Jan 2004
    Location
    A small village near a small city near a small cit
    Posts
    918
    Member #
    4667
    Liked
    1 times
    Here's the file.

    Thanks again for your help
    tekp :cheeky: tekponline.com


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:03 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com