Support » Fixing WordPress » Adding PHP Code — Appears in Chrome but Not In Safari or Firefox

  • I need for my affiliate’s ID to appear in a widget — therefore, I have used a couple different PHP-enabled widgets’ to insert my PHP code into.

    I can get it to work when I view the page using Chrome, but when I view it using Safari or Firefox, it’s just completely blank. Nothing.

    The affiliate software developer tells me that there is nothing wrong with the code (of course) and that I should post for help here.

    Here’s the code, in case you’re wonderng:

    [Code moderated as per the Forum Rules. Please use the pastebin]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Yes, and also Samsarin PHP 1: http://wordpress.org/extend/plugins/samsarin-php-widget/

    They both seem to be working exactly the same. Same result… both work in Chrome and show nothing in Safari and Firefox.

    post the code in pastebin.com and come back here with a link

    Okay — here it is:

    http://pastebin.com/sNDgxXE5

    Thanks!

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    I’d be both shocked and amazed if an include worked inside the php widget.

    Where is this “PapApi.class.php” file on the server? You have no idea where that code is running or in what context it exists. I’d be amazed if this code ever worked.

    PHP is a programming language. Things like files and locations and paths matter. It’s not something where you can just copy and paste bits in and expect them to work.

    Also, your “cookies” bits won’t work in a widget at all. Cookies have to happen before any page output. This code was clearly designed to be integrated into a page, not stuck into a widget. You will have to rewrite it to be more generic.

    hmmm – just tested it on my test site and it worked fine except for failing to call the files I don’t have

    wierd – and you’re using latest FF?

    note – 817 area code, eh? I live in Richland Hills
    you should remove the phone # from the pastebin

    edit – are you on linux or windows server?

    Otto, the file is on my server.

    Samuel, yes, I’m using the latest FF and Safari. Like I said, it works (cookies and all) with Safari, but not with Chrome.

    817- yeah, I’m in Fort Worth. 🙂

    I changed the last 4 digits. It’s not 1111.

    Linux server.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Adding PHP Code — Appears in Chrome but Not In Safari or Firefox’ is closed to new replies.