problems with my first test code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • alice@fearofdolls.com

    #1

    problems with my first test code

    I'm just starting to learn php, and here's the code from a book I'm
    reading -
    The time is
    <?php echo date(H:i:s');?>
    and the date is
    <?php echo date(j F Y');?>

    I typed it in an editor called Notepad++, FTP'd it using ASCII onto an
    ISP that I know has Apache/MySQL/PHP installed and working. But when I
    go to the URL http://www.fearofdolls.com/time.php I get the error Parse
    error: parse error, unexpected ':' in
    /home/fearofdo/public_html/time.php on line 2.
    What am I doing wrong?
    This is the second time this happened to me- my first test code had a
    similar problem, and that's when I switched to a non-MS notepad editor
    so it would save it correctly, but this time I can't figure out what's
    going wrong. It seems that php is very difficult to get to work.

  • Jerry Stuckle

    #2
    Re: problems with my first test code

    alice@fearofdol ls.com wrote:
    I'm just starting to learn php, and here's the code from a book I'm
    reading -
    The time is
    <?php echo date(H:i:s');?>
    and the date is
    <?php echo date(j F Y');?>
    >
    I typed it in an editor called Notepad++, FTP'd it using ASCII onto an
    ISP that I know has Apache/MySQL/PHP installed and working. But when I
    go to the URL http://www.fearofdolls.com/time.php I get the error Parse
    error: parse error, unexpected ':' in
    /home/fearofdo/public_html/time.php on line 2.
    What am I doing wrong?
    This is the second time this happened to me- my first test code had a
    similar problem, and that's when I switched to a non-MS notepad editor
    so it would save it correctly, but this time I can't figure out what's
    going wrong. It seems that php is very difficult to get to work.
    >
    The time is
    <?php echo date('H:i:s');? >
    ^
    and the date is
    <?php echo date('j F Y');?>
    ^

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • Rik

      #3
      Re: problems with my first test code

      alice@fearofdol ls.com wrote:
      I'm just starting to learn php, and here's the code from a book I'm
      reading -
      The time is
      <?php echo date(H:i:s');?>
      and the date is
      <?php echo date(j F Y');?>
      >
      I typed it in an editor called Notepad++, FTP'd it using ASCII onto an
      ISP that I know has Apache/MySQL/PHP installed and working. But when I
      go to the URL http://www.fearofdolls.com/time.php I get the error
      Parse error: parse error, unexpected ':' in
      /home/fearofdo/public_html/time.php on line 2.
      What am I doing wrong?
      This is the second time this happened to me- my first test code had a
      similar problem, and that's when I switched to a non-MS notepad editor
      so it would save it correctly, but this time I can't figure out what's
      going wrong. It seems that php is very difficult to get to work.
      You don't quote correctly. Either your not that great in retyping them, or
      you should ask for your money back.
      If you use Notepad++, I assume you have syntax highlighting, which might
      have told you that fact. Normally, a good editor will give a string a
      different color (and functions, and variable names....), usually some
      greyish thing.

      echo date('H:i:s');
      echo date('j F Y');

      Remember, it's not like HTML, every quote counts, and omitting it will not
      be forgiven :-).
      --
      Rik Wasmus


      Comment

      Working...