Website Building Expertise

7 replies
Hey all, I just have a quick question that I want some thoughts on because I can't figure out why this is NOT working.

My website and hosting service recognize both PHP codes and ASP codes inside my websites and I have used them several times. But when I want to insert a piece of PHP code for the date? Dreamweaver recognizes it, but the Internet does not! How can this be?

Can someone please tell me how they insert the date/time codes on their webpages. Im trying to optimize my landing page by inserting actual time with the offer to boost response.

The php codes I use can be found all over the net so I'm quite positive that Im using the right ones. So thats not the problem, maybe my Godaddy host is? Who can explain this problem.

I'm very curious...
#building #expertise #website
  • Profile picture of the author dreamtab
    I use JavaScript for date. Can you post php code here?
    Signature
    Website Setup $250 only
    Full-Time VA Available. 13 years IM, SEO, WordPress, Customer Support experience.
    {{ DiscussionBoard.errors[972227].message }}
  • Profile picture of the author Dennis Miedema
    Here's the date code I tried to use:

    <?php echo date('l, M d, Y'); ?>

    Here's the time code I tried to use:


    <?php echo date('g:i A ');?>
    {{ DiscussionBoard.errors[973458].message }}
  • Profile picture of the author Dennis Miedema
    any thoughts?
    {{ DiscussionBoard.errors[979919].message }}
    • Profile picture of the author Dan C. Rinnert
      Originally Posted by Dennis Miedema View Post

      any thoughts?
      Are you using it on a page that has the .php extension or is otherwise setup to be parsed by the PHP engine?
      Signature

      Dan's content is irregularly read by handfuls of people. Join the elite few by reading his blog: dcrBlogs.com, following him on Twitter: dcrTweets.com or reading his fiction: dcrWrites.com but NOT by Clicking Here!

      Dan also writes content for hire, but you can't afford him anyway.
      {{ DiscussionBoard.errors[979938].message }}
  • Profile picture of the author Dennis Miedema
    Hi Dan, well..

    It's set up on a regular HTML page with a php code inserted in it. Does that mean I need to setup a separate .php file inside my website directory for it, or do I have to do something else?
    {{ DiscussionBoard.errors[982639].message }}
    • Profile picture of the author Dan C. Rinnert
      Originally Posted by Dennis Miedema View Post

      Hi Dan, well..

      It's set up on a regular HTML page with a php code inserted in it. Does that mean I need to setup a separate .php file inside my website directory for it, or do I have to do something else?
      If the php code is just in a regular HTML page, then it is not being parsed by the PHP engine at all, so the code just gets ignored.

      You can change the filename from filename.html to filename.php.

      If you have links to the .html version, you can setup your .htaccess to redirect requests for the .html page to the .php page.

      There are also ways (through .htaccess) of setting it up so that all your .html or .htm pages are run through the PHP engine. The method of doing that will vary with your particular host and PHP configuration. That way, you wouldn't have to change the filename extensions.
      Signature

      Dan's content is irregularly read by handfuls of people. Join the elite few by reading his blog: dcrBlogs.com, following him on Twitter: dcrTweets.com or reading his fiction: dcrWrites.com but NOT by Clicking Here!

      Dan also writes content for hire, but you can't afford him anyway.
      {{ DiscussionBoard.errors[982677].message }}
  • Profile picture of the author jendoe
    The php code needs to be a page that actually ends with .php, otherwise the web server won't know it's supposed to use php on it.

    It's frustrating - I ran into this too!

    There's supposedly a workaround that involves the .htaccess file - but this did not work at all on the server I used. When I tried it, it literally killed my site! Not good!

    If you're just getting the site up and haven't marketed it yet, you might want to consider just using .php for all your pages (so that you can easily embed any php you want)... I wish I had done that from the start, and *will* on the next site!

    Good luck!
    {{ DiscussionBoard.errors[982655].message }}

Trending Topics