Jump to content

AeonE

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

AeonE's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. yay man it works, using $gTotal += $row[cQuantity] * $row[cartPrice]; THANKSSSS alot man, u been a great help!! thx again
  2. guys, I'm having a problem how to calculate the grandTotal. heres the case : [img src=\"http://www.geocities.com/d3private/a.jpg\" border=\"0\" alt=\"IPB Image\" /] see that picture above? a part of that the grand Total is missing, and I dont know how to calculate that because I'm using the loop command , and dont have any specific for rows btw heres the code for displaying above [quote] $query = "SELECT * FROM cart INNER JOIN products ON cart.pId = products.pId where username = $_SESSION[username] "; $result = mysql_query($query) or die ("Query Error on listing MyCart"); $total=mysql_num_rows($result); for($n=0; $n<$total; $n++) { while($row=mysql_fetch_array($result) ) { if($row > 1) { $a += 1; ?> <tr> <td align="center" width="30" height="26"><?php echo $a ?></td> <td align="center" width="50" height="26"><img src="../../Image/<?php echo $row[pImage]; ?>" width="50" height="50"></td> <td align="center" width="100" height="26"><?php echo $row[pName] ?></td> <td align="center" width="25" height="26"><input type=text name=quantity size= "1" value="<?php echo $row[cQuantity] ?>"></td> <td align="center" width="75" height="26"><b>$</b> <? echo $row[cartPrice] ?></td> <?php $total1 = $row[cQuantity] * $row[cartPrice]; ?> <td align="center" width="75" height="26"><?php echo $total1 ?></td> <td align="center" width="30" height="26"> </td> </tr> </table> [/quote] I use <?php $total1 = $row[cQuantity] * $row[cartPrice]; ?> for the calculating [quantity * price ea], and for the grandTotal <?php $gTotal = ...... ?>....?, how to calculate the grand total.... HELPPPP
  3. guys, I'have some question to ask [quote] eCom | - eCom.php | | -Admin | |- Admin.php | |- User | |- User.php [/quote] where eCom is my TOP directory and Admin/user is a folder under eCom directory, here's my question, how do I link those 3 together without repeating the hyperlink code? assuming in eCom.php I have created a hyperlink to Admin like this <?php echo "<a href=\"Admin/Admin.php>Admin Page</a>" ?> and of course my Home is <?php echo "<a href=\"eCom.php>Home</a>" ?> so it looks like this in eCom.php, [quote] <?php echo "<a href=\"eCom.php>Home</a>" ?> <?php echo "<a href=\"Admin/Admin.php>Admin Page</a>" ?> <?php echo "<a href=\"User/User.php>User</a>" ?> [/quote] and for Admin.php, [quote] <?php echo "<a href=\"../eCom.php>Home</a>" ?> <?php echo "<a href=\"Admin.php>Admin Page</a>" ?> <?php echo "<a href=\"../User/User.php>User</a>" ?> [/quote] it works to link them together but... I want a simple method that allows you to only need to define SERVER root to access files in that root, how you do that? meaning that I can remove this: [quote] <?php echo "<a href=\"../eCom.php>Home</a>" ?> <?php echo "<a href=\"Admin.php>Admin Page</a>" ?> <?php echo "<a href=\"../User/User.php>User</a>" ?> [/quote] for my admin.php , and only add include ('../eCom.php'); inside my Admin.php what should I write in my eCom.php , please help!!! many thanks
  4. [!--quoteo(post=353940:date=Mar 11 2006, 11:07 AM:name=joecooper)--][div class=\'quotetop\']QUOTE(joecooper @ Mar 11 2006, 11:07 AM) [snapback]353940[/snapback][/div][div class=\'quotemain\'][!--quotec--] $result = mysql_query($query); if (mysql_num_rows($result) > 0){ echo "password correct! you logged in"; }else{ echo "incorrect login!"; } [/quote] still won't work, Im getting Incorrect login everytime I tried to login. I'm stuck...
  5. [!--quoteo(post=353918:date=Mar 11 2006, 09:31 AM:name=wickning1)--][div class=\'quotetop\']QUOTE(wickning1 @ Mar 11 2006, 09:31 AM) [snapback]353918[/snapback][/div][div class=\'quotemain\'][!--quotec--] Your insert statement is inserting $password when it should be inserting $enc_pwd. You have a comment there that says to switch it out, but the code you posted doesn't have them switched out. [/quote] can you correct it for me, bro? cause Imma kinda new to this php many thanks
  6. guys, I'm having some problem here, after I created my registration form (username and password fields only) using this code [quote] <?php $host = ''; $uname = "root"; $pass = ""; $database = "db"; $tablename = "login"; $username = $_POST[customerId]; $password = $_POST[password]; $enc_pwd = md5($password); $connection = mysql_connect ($host,$uname,$pass) or die("Database connection failed, please re-check!!"); $result = mysql_select_db($database) or die ("Database could not selected, please check again!!"); $query = "INSERT INTO $tablename VALUES('$username','$password')"; //change $password to $enc_pwd for encrypted password!!! $result = mysql_query($query); if (!$result) { die ("query failed, please check again <br>"); } ?> [/quote] that code above is for creating new user and it works, when I go to mysql in phpmyadmin it says the password for this use is 234242hj4hj24hj. but then I created the login form, with these code [quote] <?php $host = ''; $uname = "root"; $pass = ""; $database = "db"; $tablename = "login"; $username = $_POST[customerId]; $password = $_POST[password]; $enc_pwd = md5($password); $connection = mysql_connect ($host,$uname,$pass) or die("Database connection failed, please re-check!!"); $result = mysql_select_db($database) or die ("Database could not selected, please check again!!"); $query = "SELECT * from $tablename where customerId = '$username' and password = '$enc_pwd'"; $result = mysql_query($query); if ($row = mysql_fetch_array($result)) { if(!$enc_pwd == $row[password]) { die ("Wrong Password"); } } else { die ("User not exists/password Incorrect"); } ?> [/quote] and it seems I could not retrieve the data from the database... it always says "User not exists/password Incorrect", checked the HTML form with the login everything are same, oh boy, it suxs I tried over over and over still no luck, maybe some1 here can help me, HELPP!! many thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.