SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2010
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can you spot a syntax error on this line?

    Parse error: syntax error, unexpected T_IS_EQUAL, expecting ',' or ')' in /home/public_html/test02.php on line 10

    Thanks.

    PHP Code:
    if( isset($_POST['submitted']) || isset($_POST['radio00'] == 'replace') && !isset($_POST['radio00'] == 'delete') || !isset($_POST['radio00'] == 'keep') ) {

    do  
    something;


  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,788
    Mentioned
    151 Post(s)
    Tagged
    3 Thread(s)
    Yup, you cant have an isset as well as an ==

    PHP Code:
    if( 
        isset(
    $_POST['submitted']) || 
        (
    $_POST['radio00'] == 'replace') && 
        (
    $_POST['radio00'] == 'delete') || 
        (
    $_POST['radio00'] == 'keep') ) { 

    do  
    something

    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2010
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply and your help. I am venturing into new territory here.

  4. #4
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,788
    Mentioned
    151 Post(s)
    Tagged
    3 Thread(s)
    no problem.
    What is it that you are aiming for and checking for with that line?
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  5. #5
    SitePoint Zealot ChrisWiegman's Avatar
    Join Date
    Sep 2010
    Location
    Austin, Texas, United States
    Posts
    177
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To clarify isset and == are two separate check and must be treated as such. isset is checking for the existence of the variable while == is looking for a specific value.

  6. #6
    SitePoint Enthusiast
    Join Date
    Aug 2010
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am trying to upload an image.
    Preview the image.
    Then go back into edit mode and choose to keep, delete or replace the image.
    Then preview it again, before submitting it to a database.

    One of the challenges I run into is when I go back and forth between between edit and preview with a new browser window, parts of the script try to repeat itself.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •