Hello and welcome to our community! Is this your first visit?
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
    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. #2
    Senior Coder
    Join Date
    Apr 2010
    Thanked 110 Times in 109 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 8 years. My business:
    American Made Signs

  3. #3
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Bradford, UK
    Thanked 68 Times in 67 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. #4
    New to the CF scene
    Join Date
    Aug 2014
    Thanked 0 Times in 0 Posts
    They added analytics code on every file. Is there a way to fix it?

  5. #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,947 Times in 4,908 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:
    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.
    Be yourself. No one else is as qualified.


Posting Permissions

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