Results 1 to 10 of 24

Thread: Day 10 - Let's Eat Cookie - Become PHP Expert in 30 days

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    india,kerala-god's own country
    Posts
    14,007

    Default

    Can we start php using '<?' only instead of '<?php'.

    I had seen this post in which the code working and executing successfully.

  2. #2
    Join Date
    Feb 2007
    Posts
    26,214

    Default

    DAY 10 PHP PROGRAMMING

    http://php.flashwebhost.com/tom/day_10_ex_1.php

    PHP Code:

    <?php
    if (isset($_COOKIE['clientName'])) {
    echo 
    'Hello ' $_COOKIE['clientName'] . ' Welcome to Our WebSite';exit;
    }
    if (isset(
    $_POST['clientName']) && strlen($_POST['clientName']) > ){
    setcookie('clientName'$_POST['clientName'], time()+3600);
    echo 
    ' Cookie Set. Close the browser. Revisit this page, I will remember your name';
    } else {
    echo
    '
    What is Your Name?
    <form method="POST" action=""><input type="text" name="clientName"><button type="submit" name="whatever">Enter</button></form>
    '
    ;
    }

Tags for this Thread

Bookmarks

Posting Permissions

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