WordPress.org

Ready to get started?Download WordPress

Forums

Adding PHP Code -- Appears in Chrome but Not In Safari or Firefox (8 posts)

  1. Brad Edwards
    Member
    Posted 3 years ago #

    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]

  2. Samuel B
    moderator
    Posted 3 years ago #

  3. Brad Edwards
    Member
    Posted 3 years ago #

    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.

  4. Samuel B
    moderator
    Posted 3 years ago #

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

  5. Brad Edwards
    Member
    Posted 3 years ago #

    Okay -- here it is:

    http://pastebin.com/sNDgxXE5

    Thanks!

  6. Samuel Wood (Otto)
    Tech Ninja
    Posted 3 years ago #

    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.

  7. Samuel B
    moderator
    Posted 3 years ago #

    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?

  8. Brad Edwards
    Member
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags