SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem with Safari and my CMS

    My page editing function (using Editize latest version) works fine in IE6 and Firefox, but not in Safari. I think the problem may be that Safari does not recognize the variable $_SERVER['PHP_SELF'] in the form action:
    PHP Code:
     <form name="edit_page" method="post" action="<?php $_SERVER['PHP_SELF']; ?>" >
    Instead of sending the contents of the form to the rest of the script for processing, it redirects one to the home page, no doubt by my 400.php script.

    My markup is all validated by the W3C checker.

    Here are two raw access log file entries that may say something:
    72.70.243.69 - - [29/Apr/2006:11:51:51 -0400]
    "POST / HTTP/1.1" 200 6365 "http://www.clickbasics.com/pages/edi....php?pg_id=184"
    "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/417.9 (KHTML, like Gecko)
    Safari/417.8"

    72.70.243.69 - - [29/Apr/2006:11:51:52 -0400] "GET /favicon.ico HTTP/1.1" 404
    4839 "-" "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/417.9 (KHTML, like Gecko)
    Safari/417.8"
    Any clues why Safari does not process page edit changes in my CMS.

    (Off topic, any suggestions for a program that will read a raw access .txt file?)
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  2. #2
    SitePoint Guru
    Join Date
    Jul 2005
    Location
    Orlando
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The browser never sees the PHP code, so one browser doesn't interpret your PHP code any differently than another. Now if your PHP is producing invalid HTML, one browser may read that differently than another.

    If you load your page in any browser, what does that <form> tag look like in its html form? Can you copy and paste that here?

  3. #3
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I'll be.....

    Here's how the form tag looks in the source view of IE6
    HTML Code:
     <form name="edit_page" method="post" action="" >
    How can that be, yet it still works in IE6 Firefox?
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  4. #4
    SitePoint Guru
    Join Date
    Jul 2005
    Location
    Orlando
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paulcj2
    Well I'll be.....

    Here's how the form tag looks in the source view of IE6
    HTML Code:
     <form name="edit_page" method="post" action="" >
    How can that be, yet it still works in IE6 Firefox?
    I'd imagine by default IE & Firefox submits the form back to itself, while Safari has another default action.

  5. #5
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. Know of a work around?
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  6. #6
    Obey the Purebreed trib4lmaniac's Avatar
    Join Date
    Dec 2004
    Location
    Cornwall, UK
    Posts
    594
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    action="<?php echo $_SERVER['PHP_SELF']; ?>"

  7. #7
    SitePoint Addict jtresidder's Avatar
    Join Date
    Nov 2003
    Location
    Southampton, UK
    Posts
    345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Covered already, but yep, IE will send a form to itself if no action is specified, but not all browsers do.

  8. #8
    SitePoint Guru
    Join Date
    Jul 2005
    Location
    Orlando
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by trib4lmaniac
    action="<?php echo $_SERVER['PHP_SELF']; ?>"
    tribal is of course correct. You have to echo the $variable to have it show up in the page.

  9. #9
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks
    Paul C.
    ClickBasics
    http://www.clickbasics.com


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
  •