Results 1 to 7 of 7
  1. #1

    Default Php help guestbook


    mga masters sa php pwde ko ngayo ninyo code/tutorial sa basic nga shoutbox?

  2. #2
    Quote Originally Posted by MEATH NOTE View Post
    mga masters sa php pwde ko ngayo ninyo code/tutorial sa basic nga shoutbox?
    you can try this sites.
    Creating A Guestbook Using PHP and MySQL - PHP MySQL Tutorial
    Creating a simple PHP guestbook

    you can always google your problems

  3. #3
    <?php
    $self = $_SERVER['PHP_SELF'];
    $ipaddress = ("$_SERVER[REMOTE_ADDR]");
    include ('db.php');

    $connect = mysql_connect($host,$username,$password) or die('query failed'. mysql_error($db));

    mysql_select_db = ($db,$connect) or die('query failed'. mysql_error($db));

    if(isset($_POST['send'])) {
    if(empty($_POST['name'])) || if(empty($_POST['email'])) || if(empty($_POST['post'])){
    echo('Make sure you fill all the required fields');
    } else {

    $name = $_POST['name'];
    $email = $_POST['email'];
    $post = $_POST['post'];

    $sql = "INSERT INTO shouts SET name='$name', email='$email', post='$post', ipaddress='$ipaddress';";

    if(@mysql_query($sql)) {
    echo 'Thanks for shouting';
    } else {
    echo 'There was an expected error';
    }
    }
    }

    $query = "SELECT * FROM shouts ORDER BY `id` DESC LIMIT 8;";
    $result = @mysql_query("$query") or die('<p class="error">There was an unexpected error grabbing shouts from the database.</p>');

    // while we still have rows from the db, display them
    while ($row = mysql_fetch_array($result)) {

    $ename = stripslashes($row['name']);
    $eemail = stripslashes($row['email']);
    $epost = stripslashes($row['post']);



    echo('<li><div class="meta"><img src="'.$grav_url.'" alt="Gravatar" /><p>'.$ename.'</p></div><div class="shout"><p>'.$epost.'</p></div></li>');

    }


    ?>

    <!-- at the bottom of the page, we display our comment form -->
    <form action="<?php $self ?>" method="post">
    <h2>Shout!</h2>
    <div class="fname"><label for="name"><p>Name:</p></label><input name="name" type="text" cols="20" /></div>
    <div class="femail"><label for="email"><p>Email:</p></label><input name="email" type="text" cols="20" /></div>
    <textarea name="post" rows="5" cols="40"></textarea>
    <input name="send" type="hidden" />
    <p><input type="submit" value="send" /></p>
    </form>
    unsa error ani parse error on line 8 lagi?

  4. #4
    Quote Originally Posted by MEATH NOTE View Post
    unsa error ani parse error on line 8 lagi?
    change that line to:

    mysql_select_db($db,$connect) or die('query failed'. mysql_error($db));

  5. #5
    if(empty($_POST['name'])) || if(empty($_POST['email'])) || if(empty($_POST['post']))

    why is there an 'if' inside an if?

  6. #6
    mysql_select_db = ($db,$connect) or die('query failed'. mysql_error($db));

    try this one no equal sign.

    mysql_select_db($db,$connect) or die('query failed'. mysql_error($db));

  7. #7
    Quote Originally Posted by nullpointer View Post
    change that line to:

    mysql_select_db($db,$connect) or die('query failed'. mysql_error($db));
    ai sorry naa nman diay ni. sorry bro. admin delete my 1st post.

  8.    Advertisement

Similar Threads

 
  1. Im learning PHP, Help me hw to run the PHP!
    By kyme in forum Programming
    Replies: 23
    Last Post: 08-21-2012, 02:57 AM
  2. Replies: 33
    Last Post: 10-17-2008, 04:09 PM
  3. Streaming/Playing videos in PHP..help.
    By ichiriki in forum Programming
    Replies: 3
    Last Post: 10-08-2008, 05:15 PM
  4. PHP help me
    By poymode in forum Programming
    Replies: 8
    Last Post: 07-28-2007, 02:57 PM
  5. PHP help
    By tjyrna in forum Networking & Internet
    Replies: 1
    Last Post: 07-06-2006, 11:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top