Page 1 of 2 1 2 LastLast
Results 1 to 15 of 23

Thread: perlukan bantuan untuk coding php

  1. #1
    Join Date
    Jul 2002
    Location
    dalam perut bumi
    Posts
    40
    Rep Power
    0

    perlukan bantuan untuk coding php

    aku ade buat satu webbase system cam helpdesk...aku ingin buat password tapi coding aku tak berjalan lancar la...boleh sesiapa bantu aku untuk buat coding tuk password.

    ade sesiapa boleh bantu aku buat coding untuk search cam search nama, or barang dalam webbase aku nie...
    Last edited by paranoidz; 12-05-2004 at 12:59 PM.
    <embed src="http://www.geocities.com/paranoidz02/new.swf" WIDTH=400 HEIGHT=55 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>®

  2. #2
    Join Date
    Feb 2003
    Location
    Kluang, Johor
    Posts
    2,367
    Rep Power
    246
    wat? sorry, I do not understand your language.

    In your check.php, you should get the submited form data first. use $variableName = $_POST['FIELD']

  3. #3
    Join Date
    Jul 2002
    Location
    dalam perut bumi
    Posts
    40
    Rep Power
    0
    do you have any script that written properly cause i'm new in php...
    <embed src="http://www.geocities.com/paranoidz02/new.swf" WIDTH=400 HEIGHT=55 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>®

  4. #4
    Join Date
    Feb 2003
    Location
    Kluang, Johor
    Posts
    2,367
    Rep Power
    246
    no, sorry.
    we are here to help you, not here to write code for you.

  5. #5
    Join Date
    Jul 2002
    Location
    dalam perut bumi
    Posts
    40
    Rep Power
    0
    ok i repaired my script first then i submit here
    <embed src="http://www.geocities.com/paranoidz02/new.swf" WIDTH=400 HEIGHT=55 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>®

  6. #6
    Join Date
    Jul 2002
    Location
    dalam perut bumi
    Posts
    40
    Rep Power
    0
    <body topmargin="0" leftmargin="0">
    <form name="password" method="post" action="<?echo $PHP_SELF?>">
    <table width="300" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
    <tr>
    <td width="400" class="text"><div align="center"></div></td>
    </tr>
    <tr>
    <td class="text"><table width="250" border="0" cellpadding="0" cellspacing="0" class="text">
    <tr>
    <td width="94"><div align="right">username</div></td>
    <td width="9">: </td>
    <td width="120"><input name="username" type="text" id="username" maxlength="12" border="0"></td>
    </tr>
    <tr>
    <td><div align="right">password</div></td>
    <td>: </td>
    <td><input name="password" type="password" id="password" maxlength="8"></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td colspan="3"><div align="right">
    <input type="submit" name="Submit" value="Submit" border="0">
    </div></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td colspan="3"><div align="center">forgot password contact nazrin</div></td>
    </tr>
    </table>
    <div align="left"></div>
    <div align="center"></div></td>
    </tr>
    </table>
    </form>
    <?php
    if ($submit) {
    $db=mysql_connect("localhost","sreport") or die ("connection problem");
    mysql_select_db("sreport",$db) or die ("cant connect to database");
    $result=mysql_query("select * from user where name='$username'",$db) or die ("database not found");
    while ($row=mysql_fetch_array($result)) {
    if ($row["password"]==$password) {
    printf("Successfully Logged In!<a href="report/report.php?">Click Here</a>");
    }
    }
    }
    ?>
    </body>
    </html>
    Parse error: parse error in C:\apache\htdocs\sreport\users\users.php on line 223...
    the error refer hereprintf("Successfully Logged In!<a href="report/report.php?">Click Here</a>");
    <embed src="http://www.geocities.com/paranoidz02/new.swf" WIDTH=400 HEIGHT=55 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>®

  7. #7
    Join Date
    Sep 2001
    Location
    epox
    Posts
    432
    Rep Power
    224
    your script is screwed if the server enabled register_globals
    *laughs*
    Munzir + "/^[Hh](a)(z)\1\2[iI]$/"

  8. #8
    Join Date
    May 2002
    Location
    Klate
    Posts
    91
    Rep Power
    210
    maybe u need to escape the double quote eh , like this

    printf("Successfully Logged In!<a href=\"report/report.php?\">Click Here</a>");

  9. #9
    Join Date
    Jul 2002
    Location
    dalam perut bumi
    Posts
    40
    Rep Power
    0
    <?php
    function print_form() {
    ?>
    <form action="chk_pass.php3" method="post">
    <h3>Please Login</h3>
    Username : <input type="text" name="user_name">
    Password : <input type="password" name="user_pass">
    <input type="submit" name="submit" value="login">
    </form>
    <?
    }

    if(isset($submit));

    if(!$db = mysql_connect("localhost","root")):
    print("<h1>Database Connection Failed</h1>\n");
    else:
    mysql_select_db("users",$db);
    endif;

    $sql = "select * from users where user_name = '$user_name'";
    $result = mysql_query($sql);
    $row_count = mysql_num_rows($result);
    if($row_count == 0):
    ?>
    <h3>Wrong Username</h3>
    <?
    print_form();
    else:
    $row = mysql_fetch_array($result);
    if($password != $row["user_pass"]):
    ?>
    <h3>Invalid Password</h3>
    <?
    print_form();
    else:
    ?>
    <h3>Password Accepted</h3>
    <?
    endif;
    endif;
    else: <---------------------error asyik kat sini...
    print_form();
    endif;
    ?>

    aku modified script tu kasik lowert skit...n dapat error nie...
    <embed src="http://www.geocities.com/paranoidz02/new.swf" WIDTH=400 HEIGHT=55 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>®

  10. #10
    Join Date
    May 2002
    Location
    Klate
    Posts
    91
    Rep Power
    210
    kat if(isset($submit)); tu hujung dia tanda ni ; ke : ???
    PHP Code:
    <?php echo "PHP is a language?"?>

  11. #11
    Join Date
    Jul 2002
    Location
    dalam perut bumi
    Posts
    40
    Rep Power
    0
    PHP Code:
    if ($_POST[user] && $_POST[pass]) {  
    $result mysql_query("select * from users where user_name='$_POST[user]");    
    $row mysql_fetch_array($result);    
    if (
    $row[id] > 0) {     
    setcookie ("user"md5($user_data[username]));      
    setcookie ("pass"md5($user_data[password])); 
    header("Location: users.php");    }
     else 
    $login_errortrue; }   } 
    Warning: Supplied argument is not a valid MySQL result resource in c:\apache\htdocs\sreport\users\users.php on line 26

    camner nie ye
    Last edited by paranoidz; 12-05-2004 at 10:37 AM.
    <embed src="http://www.geocities.com/paranoidz02/new.swf" WIDTH=400 HEIGHT=55 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>®

  12. #12
    Join Date
    Feb 2003
    Location
    Kluang, Johor
    Posts
    2,367
    Rep Power
    246
    replace:
    PHP Code:
    $result mysql_query("select * from users where user_name='$_POST[user]"); 
    with:
    PHP Code:
    $result mysql_query("select * from users where user_name='" $_POST[user] . "'"); 

  13. #13
    Join Date
    Jul 2002
    Location
    dalam perut bumi
    Posts
    40
    Rep Power
    0
    PHP Code:
    <?php
    $db_username 
    "ayin"
    $db_password "mypass"
    $db_hostname "localhost";     
    $db_connect mysql_connect($db_hostname$db_username$db_password)or die("Unable to connect to MySQL"); 
    $db_select mysql_select_db("sreport"$db_connect)or die("Unable to select test"); 
    //additional functionality here 
    echo "You have successfully connected to MySQL!"
    mysql_close($db_connect);

    //$username = 'admin';  
    //$password = 'password';

    //current time
    $time=time();

    //logout
    if($logout == true){
    setcookie("user",md5($_POST[user]),$time-3200);
    setcookie("pass",md5($_POST[pass]),$time-3200);
    header("location:users.php");
    }

    //mysql validate
    if ($_POST[user] && $_POST[pass]) {
    $result mysql_query("select * from users where user_name='" $_POST[user] . "'");
     
    $row mysql_fetch_array($result); 
     if (
    $row[id] > 0) { 
      
    setcookie ("user"md5($user_data[username]));  
      
    setcookie ("pass"md5($user_data[password]));  
      
    header("Location: users.php"); 
     } else { 
    $login_errortrue; } 
    }
    still same problem la...anybody can help me...
    Last edited by paranoidz; 12-05-2004 at 12:59 PM.
    <embed src="http://www.geocities.com/paranoidz02/new.swf" WIDTH=400 HEIGHT=55 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>®

  14. #14
    Join Date
    Feb 2003
    Location
    Kluang, Johor
    Posts
    2,367
    Rep Power
    246
    Try change all
    $_POST[pass] to $_POST["pass"]
    $_POST[user] to $_POST["user"]
    $user_data[username] to $user_data["username"]
    $user_data[password] to $user_data["password"]

  15. #15
    Join Date
    Jul 2002
    Location
    dalam perut bumi
    Posts
    40
    Rep Power
    0
    did u mean like this...i try 1st...if still cannot i give my other script but i need to do a cookies for this script n it did not work as i wanted...tomorrow i post it here...

    PHP Code:
    <?php
    $db_username 
    "ayin"
    $db_password "mypass"
    $db_hostname "localhost";     
    $db_connect mysql_connect($db_hostname$db_username$db_password)or die("Unable to connect to MySQL"); 
    $db_select mysql_select_db("sreport"$db_connect)or die("Unable to select test"); 
    //additional functionality here 
    echo "You have successfully connected to MySQL!"
    mysql_close($db_connect);

    //$username = 'admin';  
    //$password = 'password';

    //current time
    $time=time();

    //logout
    if($logout == true){
    setcookie("user",md5($_POST[user]),$time-3200);
    setcookie("pass",md5($_POST[pass]),$time-3200);
    header("location:users.php");
    }

    //mysql validate
    if ($_POST["pass"]&& $_POST["user"]) {
    $result mysql_query("select * from users where user_name='" $_POST[user] . "'");
     
    $row mysql_fetch_array($result); 
     if (
    $row[id] > 0) { 
      
    setcookie ("user"md5($user_data["username"]));  
      
    setcookie ("pass"md5($user_data["password"]));  
      
    header("Location: users.php"); 
     } else { 
    $login_errortrue; } 
    }
    Last edited by paranoidz; 12-05-2004 at 08:54 PM.
    <embed src="http://www.geocities.com/paranoidz02/new.swf" WIDTH=400 HEIGHT=55 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>®

Page 1 of 2 1 2 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Perlukan bantuan pakar PHP + Javascript
    By rarahim in forum Website Programming
    Replies: 0
    Last Post: 03-01-2010, 03:23 PM
  2. perlukan pembetulan
    By chek-kalem™ in forum Websites Review and Suggestion
    Replies: 10
    Last Post: 21-05-2006, 01:24 PM
  3. Perlukan Solution Atau Coding
    By marco in forum Website Programming
    Replies: 9
    Last Post: 22-09-2004, 09:22 AM
  4. Replies: 10
    Last Post: 08-07-2004, 06:38 PM
  5. mintak bantuan...flash form ke php..tak jalan
    By seman_t in forum Website Programming
    Replies: 1
    Last Post: 10-07-2002, 06:38 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
  •  

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37