PLS want wrong with my code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    PLS want wrong with my code

    <?php

    require_once "header.php";
    function Adex_AcAddpchat($username,$pchat,$chatid){
    if (!valid_username($username) || !user_exists($username))
    {
    return false;
    }



    // now we update the password in the database
    $query = sprintf("insert into adeyemi_acpchat set name = '%s',ac_chatid = '%s'",
    mysql_real_escape_string($pchat), mysql_real_escape_string($chatid));

    if (mysql_query($query))
    {
    return false;
    }else {return false;}
    return false;
    }
    function Adex_Acpchat(){

    echo '<form action="./adex_acaddpchat.php" method="post">
    <input type="hidden" value="'.$_SESSION['username'].'" name="username">
    pchat:<br/>
    <input name="chat" type="text" maxlength="15"><br/> ';
    $cchat = mysql_query("select ac_id,ac_name from adeyemi_acpchat order by ac_id, ac_name");
    echo "chat category:<select name=\"chatid\">";
    while($chat = mysql_fetch-array($cchat))
    {
    echo '<option value="$chat">$chat[1]</option>';
    }
    echo "</select><br/>
    <input name=\"chat\" type=\"submit\" value=\"addchat\">
    </form>";
    }

    if (isLoggedIn() == true)
    {

    if (isset($_POST['chat']))
    {

    if (Adex_AcAddpchat($_POST['username'], $_POST['chat'], $_POST['chatid']))
    {
    echo "chat added! <br /> <a href='./index.php'>Return to homepage</a>";

    } else
    {
    echo "chat failed! Please try again.";
    Adex_Acpchat();
    }

    } else
    {
    Adex_Acpchat();
    }

    } else {
    // user is not loggedin
    show_loginform();
    }

    require_once "footer.php";

    ?>


    pls the above code did not show submit input, what rerror am i have with xhtml/php
    have connected with http://adexchat.com ?
    Fun up with
    http://forum.adexchat.com

    #2
    What the page showing?
    Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
    Visit: WapMasterz Coming Back Soon!
    _______
    SCRIPTS FOR SALE BY SUBZERO
    Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
    FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
    _______
    Info & Tips
    php.net
    w3schools.com

    Comment


      #3
      it does not show this submit button
      not showing the html from here
      echo '<option value="$chat[0]">$chat[1]</option>';
      }
      echo "</select><br/>
      <input name=\"chat\" type=\"submit\" value=\"addchat\">
      </form>";
      and my $chat[0] and $chat[1] not showing what wrong
      Last edited by adex3g; 17.01.11, 19:14.
      have connected with http://adexchat.com ?
      Fun up with
      http://forum.adexchat.com

      Comment


        #4
        What part you think you got wrong

        Code:
        <input type=\"submit\" name=\"chat\"  value=\"addchat\" > |<input type=\"reset\">
        Added after 2 minutes:

        When you echo ' ';

        you can't get the $_GET or $_POST

        So by doing this

        echo "<option value=\"$chat[0]\">$chat[1]</option>";

        or

        echo '<option value='".$chat[0]."'>".$chat[1]."</option>';
        Last edited by subzero; 17.01.11, 19:17.
        Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
        Visit: WapMasterz Coming Back Soon!
        _______
        SCRIPTS FOR SALE BY SUBZERO
        Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
        FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
        _______
        Info & Tips
        php.net
        w3schools.com

        Comment


          #5
          i dont know where am wrong
          have connected with http://adexchat.com ?
          Fun up with
          http://forum.adexchat.com

          Comment


            #6
            check again
            Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
            Visit: WapMasterz Coming Back Soon!
            _______
            SCRIPTS FOR SALE BY SUBZERO
            Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
            FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
            _______
            Info & Tips
            php.net
            w3schools.com

            Comment


              #7
              Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/adex3g/public_html/adex_acaddpchat.php on line 32

              Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /home/adex3g/public_html/adex_acaddpchat.php on line 32
              have connected with http://adexchat.com ?
              Fun up with
              http://forum.adexchat.com

              Comment


                #8
                Weird ...

                Ok what you gotten so far?
                Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                Visit: WapMasterz Coming Back Soon!
                _______
                SCRIPTS FOR SALE BY SUBZERO
                Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                _______
                Info & Tips
                php.net
                w3schools.com

                Comment


                  #9
                  If you post up your full form i can tell you what is incorrect with the code. You have a \ Where it is not wanted.
                  Last edited by wap2k; 08.02.11, 07:19.

                  Comment

                  Working...
                  X