Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Aug 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP Not Executed Correctly?

    I wish someone could help me please with this problem.

    Iíve the same exact directory files set up for both hosting sites which support php. My question is why this particular URL is only working at one hosting site but not the other one.
    Do I have to modify the php file in order to make it work and how? The site is supporting php 5.2, 5.3 and 5.4. Iím selecting 5.2. I donít mind what version it is for as long as it works for me.

    Much appreciated for your help.

    Here are the links at two sites:

    x10hosting.com - Working one

    1freehosting.com - Now working

  • #2
    Senior Coder
    Join Date
    Apr 2010
    Posts
    1,454
    Thanks
    71
    Thanked 102 Times in 101 Posts
    Don't use free website hosting, they don't support half of the features you need. You can get hosting for as little as $1.95 per month,
    Been a sign maker for 7 years. My business:
    American Made Signs

  • #3
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,174
    Thanks
    19
    Thanked 66 Times in 65 Posts
    On the one that doesn't work you have google analytics code at the bottom of your fpslideshowvar.php file which is causing the script to fail because javascript can't parse the variables for your gallery

  • #4
    New to the CF scene
    Join Date
    Aug 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    They added analytics code on every file. Is there a way to fix it?

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,027
    Thanks
    79
    Thanked 4,436 Times in 4,401 Posts
    Well, they didn't add it on EVERY file...only on the "fpslideshowvar.php" file. Note that the "fpslideshow.js" file is untouched.

    So how about simply renaming that ".php" file to ".js"? After all, it really *DOES* contain JS code, even though it might be generated by PHP.

    I know, I know. You want to be able to invoke the PHP-that-generates-JS from your main HTML page via
    <script src="gallery/dramas/2013 eog/bts/01-04/fpslideshowvar.php" type="text/javascript"></script>

    But there's a simple fix for that, I think. Move the definition of fpslideshowvar into your fpslideshow.js file. But just move a SKELETON definition there:
    Code:
    var fpslideshowvar={
    	baseurl: "http://leeyowon.hostingsiteforfree.com/gallery/dramas/2013 eog/bts/01-04/",
    	images: [ ],
    	desc: []
    }
    and then add some AJAX code (except use Synchronous--SJAX--instead of Async) to invoke a slightly modified fpslideshowvar.php file that returns JUST the array of images in JSON form so that you can put that array into your images array, above.

    Seems like a lot of work the way I describe it, but it shouldn't take more than a few minutes.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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