Jump to content

cnagra

Members
  • Posts

    22
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

cnagra's Achievements

Member

Member (2/5)

0

Reputation

  1. i fixed that error but now im gettin this error Warning: mail(): Failed to Receive in c:\project\htdocs\sendemail.php on line 1426 the line of code mail("myemail@hotmail.com", $subject, $message, $from);
  2. hi i keep gettin this error: Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:\project\htdocs\sendemail.php on line 1426 when i try using my email form, im using apache, mysql. what are the default settings, can anyone help thanks
  3. hi, im gettin the following error, when i put the code with some html. Warning: session_register(): Cannot send session cookie - headers already sent by (output started at c:\project\htdocs\checklogin.php:1) in c:\project\htdocs\checklogin.php on line 34 Warning: session_register(): Cannot send session cache limiter - headers already sent (output started at c:\project\htdocs\checklogin.php:1) in c:\project\htdocs\checklogin.php on line 34 Warning: Cannot modify header information - headers already sent by (output started at c:\project\htdocs\checklogin.php:1) in c:\project\htdocs\checklogin.php on line 35 my php code : <?php $host="localhost"; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name="dv8_database"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername and redirect to file "login_success.php" session_register("myusername"); header("location:login_successful.php"); } else { echo "Wrong Username or Password"; } ?> its a simple login form and happens when the username and password is correct. thanks
  4. hi, im gettin the following error, when i put the code with some html. Warning: session_register(): Cannot send session cookie - headers already sent by (output started at c:\project\htdocs\checklogin.php:1) in c:\project\htdocs\checklogin.php on line 34 Warning: session_register(): Cannot send session cache limiter - headers already sent (output started at c:\project\htdocs\checklogin.php:1) in c:\project\htdocs\checklogin.php on line 34 Warning: Cannot modify header information - headers already sent by (output started at c:\project\htdocs\checklogin.php:1) in c:\project\htdocs\checklogin.php on line 35 my php code : <?php $host="localhost"; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name="dv8_database"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername and redirect to file "login_success.php" session_register("myusername"); header("location:login_successful.php"); } else { echo "Wrong Username or Password"; } ?> its a simple login form thanks
  5. hi im tryin to change my code so it outputs the number in £'s instead of $'s here is wat i got blueFont("tahoma"," $NoShipping"); } else { $SC=number_format($SC,"2",".","thousands_sep"); blueFont("tahoma"," $$SC"); } what do i change? thanks
  6. hi i got the text to be a certain size, but cant get it to be Tahoma text...can anyone give me the code. the code i got so far is: echo "<FONT SIZE=4>Stock Updated Successfully - Update Another ?</FONT>"; thanks its ok i got it to work, thanks anyway
  7. hi i need this text to be red, tahoma, and size 16. what do i have to do to add to the code? thanks echo "Record Updated Successfully - Update Another ?";
  8. hi. i got a form that edits fields in my database, but once it edits the databas i want the boxes to be empty so i can enter new records to be edited. where do i put the code and what is the code? thanks php code : <?php mysql_pconnect('localhost'); mysql_select_db('dv8_database'); if ($submit) { // here if no ID then adding else we're editing if ($id) { $sql = "UPDATE stock_control SET category='$category',model='$model',price='$price',stock_amount='$stock_amount' WHERE id=$id"; } else { $sql = "INSERT INTO stock_control (model,category,price,stock_amount) VALUES ('$model','$category','$price','$stock_amount')"; } // run SQL against the DB $result = mysql_query($sql); echo "Record Updated Successfully - Update Another ?"; printf("<a href=\"%s?id=%s\">%s %s</a> \n", $PHP_SELF, $myrow["id"], $myrow["category"], $myrow["model"], $myrow["price"], $myrow["stock_amount"]); } ?> </div> <form method="post" action="<?php echo $PHP_SELF?>"> <p align="center"> <?php if ($id) { // editing so select a record $sql = "SELECT * FROM stock_control WHERE id=$id"; $result = mysql_query($sql); $myrow = mysql_fetch_array($result); $id = $myrow["id"]; $category = $myrow["category"]; $model = $myrow["model"]; $price = $myrow["price"]; $stock_amount = $myrow["stock_amount"]; // print the id for editing ?> <input type=hidden name="id" value="<?php echo $id ?>"> <?php } ?></p> <p align="center"> <input type="Text" name="id" value="<?php echo $id ?>"> </p> <p align="center"> <input type="Text" name="category" value="<?php echo $category ?>"> </p> <p align="center"> <input type="Text" name="model" value="<?php echo $model ?>"> </p> <p align="center"> <input type="Text" name="price" value="<?php echo $price ?>"> </p> <p align="center"> <input type="Text" name="stock_amount" value="<?php echo $stock_amount ?>"> </p> <p align="right"> <input type="Submit" name="submit" value="Update Record"> <input name="reset" input type="reset" id="reset" value="Clear Form" /> </p> </form> <div align="center"> <?php ?>
  9. hi, im very new to php, will i put that code in a php file, what kind of html file would i have to make. i didnt understand that tutprial, can you please break it down what i have to do for me. thanks
  10. can anyone please please help....i jus need the html and php code to input one ID, then view, edit and delete...please help
  11. hi i need to figure out how to view certain records, edit existing records and delete records...does anyone know of any good tutorial sites, or can help me out? thanks
  12. hi that worked great, now i need to figure out how to view certain records, edit existing records and delete records...does anyone know of any good tutorial sites, or can help me out? thanks
  13. hi yeah that worked, do u know how to make the table boxes wider?...all the data is outputted in narrow boxes.. thanks
  14. i get the following error with this code Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in c:\project\htdocs\testoutput.html on line 1475 thanks
  15. hi, i got my data to output successfully, but i need each record to output into a table in a website. can anyone help me. so far they are seperated by a new line but all the data is outputted together. php code: <?php mysql_pconnect('localhost'); mysql_select_db('dv8_database'); $query="SELECT * FROM stock_control"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); $i=0; while ($i < $num) { $id=mysql_result($result,$i,"id"); $category=mysql_result($result,$i,"category"); $model=mysql_result($result,$i,"model"); $price=mysql_result($result,$i,"price"); $stock_amount=mysql_result($result,$i,"stock_amount"); echo "<br>ID: $id| Category: $category | Model: $model | Price: $price | Stock Amount: $stock_amount |<br><hr><br>"; $i++; } ?> 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.