Hi.. 'm new to PHP so please guide me.. i just want to create a simple yet secure login page with PHP and MySql as db.. The following must be the program flow.. 1.when a user tries to login for the first time it should check whether the user is registered or not 2.if registered, goto the welcome page.. it should contain the logout option also. 'm expecting a login,registration,welcome,logout code with session.. can anyone please help me with code and explain the database.

Member Avatar
Member Avatar
+0 forum 2

I want to create a dynamic drop down list box in which Locality is loaded on page load then Depending upon selected Locality... Sub locality , Ward will be Loaded... .. I done it by using form with 'get' method.. but I want to done it using post method.. so that Selected values are not shown in the URL.. Database Dump is Attached with it.... and Demo can be seen here [url]http://www.plus2net.com/php_tutorial/dd.php[/url] from which i taken Help... Thanks...

Member Avatar
Member Avatar
+0 forum 2

Hi everyone, First of all let me just tell you that I have never done database programming myself, and this is the first time I'm setting up a MySQL database via phpMyAdmin, so I could be missing something small but I'm sure someone will know the answer, anyways... I have created and set up a MySQL database, and have created two tables ("Users" and "Payment Info"). I have added a unique ID field (along with other fields) in Users [B]AND[/B] Payment Info. The Unique ID field in both tables are supposed to link both sets of records. Both tables are …

Member Avatar
Member Avatar
+0 forum 18

how can i appear confirm message box when row are delete (are you sure to delete this record) in php?? [CODE]echo '<td><a href="teachers_delete.php?Course_Id=' . $row['Course_Id'] .'" ><img src="images/delete.gif" /></a></td>';[/CODE]

Member Avatar
Member Avatar
+0 forum 5

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\AppServ\www\eUTM\login\logincheck.php on line 13 here is the code: <?php //login check require_once("dbconn.php"); $con=connectdb(); $idpengguna=$_POST['idpengguna']; $katalaluan=$_POST['katalaluan']; //login PELAJAR from table pelajar $pekerja_query="SELECT * FROM pengguna where idpengguna = '$idpengguna' AND katalaluan = '$katalaluan'"; $pekerja_result=mysql_query($pekerja_query,$con); $pekerja_row=mysql_fetch_array($pekerja_result); if(!$nama_id && !$katalaluan) { $err=1; include("../index.php"); } elseif($nama_id == $pekerja_row["idpengguna"] && $katalaluan != $pekerja_row["katalaluan"]) { $err=2; include("../index.php"); } elseif($pekerja_row["idpengguna"] == $nama_id && $pekerja_row["katalaluan"] == $katalaluan) { session_start(); $_SESSION['pengguna_id'] = $pekerja_row["pengguna_no_id"]; header("Location: ../aduan.php?log=1"); } else { $err=3; include("../index.php"); } ?>

Member Avatar
Member Avatar
+0 forum 2

[B]The Idea[/B] The idea is that my PHP page will execute specific SQL statements on a database depending on which form elements are filled in. Instead of having to write continuously lengthy IF statements to determine which statement to use, I would like to have the necessary statement "looked up". [B]The Database[/B] I've got a MySQL database set up with a table for storing the SQL statements. Each record has a unique ID number and the statement itself. [B]The PHP Page[/B] My PHP page has a simple (enough) form on it that contains several controls of varying type. When the …

Member Avatar
Member Avatar
+0 forum 1

I am just trying to make a php edit script using a combo box or any other method. But I am not sure how to write a script when selecting a sportsid and fetch the related data at the same time. [CODE] $sql = "SELECT * FROM sports WHERE sport_id=2"; $query = mysql_query($sql); while ($row = mysql_fetch_array($query)){ $id = $row['sportid']; $sname = $row['sport_name']; $sprice = $row['sport_price']; } mysql_free_result($query); ?> <html> <head> <title>Edit User Info</title> </head> <body> <form action="updateinfo.php" method="post"> userid:<br/> <input type="text" value="<?php echo $id;?>" name="id" > <br/> Last Name:<br/> <input type="text" value="<?php echo $sname;?>" name="sname"/> <br/> Last Name:<br/> <input …

Member Avatar
Member Avatar
+0 forum 1

Hi Daniweb, I am confused, how to explode the numbers from database. Simply I can Explode, but after explode I have to relate the numbers to another table. If any one not clear abt my problem, pls reply Eg: 1, 2 Relate to Basket, football [CODE] $sql1=mysql_query("SELECT impid FROM customer where c_id=1") or die (mysql_error()); $result1 = mysql_fetch_array($sql1); echo $exp= $result1['impid']; // get 1, 2 from here echo $array=explode(",",$exp); // cannot get the output from explode function, How can I get the sports name from here. [/CODE]

Member Avatar
Member Avatar
-1 forum 2

How can I use explode function in php I already implode some data in mysql [CODE] // customer table cust_id, impid, 1, 1,2 // sports table sport id, sport name 1, football 2, basketball [/CODE] How can I explode and make a php/mysql query

Member Avatar
Member Avatar
+0 forum 11

I am just trying to link a reference numbers using php/mysql 1) Each reference number will select (see code) 2) Post that number to next page and query the info. How can I post reference ID and query in the page 2. [CODE] <? // Page 1 refno.php $cid= $_SESSION["c_id"]; extract($_POST); echo "Receipts <br><br>"; $sql=mysql_query("SELECT DISTINCT r_ref FROM reserve where c_id='$cid'") or die (mysql_error()); while($row = mysql_fetch_array($sql)){ echo "<a href=ref.php>". $row['r_ref']. "</a>"; // post 1001 number to Page 2 echo "<br>"; } ?> //page 2 $sql=mysql_query("SELECT * FROM reserve WHERE r_ref=1001") or die (mysql_error()); $result = mysql_fetch_array($sql); echo'Payment:<br> '. $result['r_pay']; …

Member Avatar
Member Avatar
+0 forum 1

[CODE]<?php include("includes/connection.php");?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <?php echo $sql= "SELECT * FROM forms WHERE today >= CURDATE() - INTERVAL 30 DAY"; $result=mysql_query($sql); while($row=mysql_fetch_array($result)) {echo $City= $row['City']; echo $Name=$$row['Name'];} ?> </body> </html> [/CODE] i just don't know how to do it, i want to search forms submitted in last 30 days, please help me. above query not selecting any row. attached is a image of database in which dates gets saved by [CODE]date("F j, Y");[/CODE]. please help me.

Member Avatar
Member Avatar
+0 forum 4

I tried lot of way to pass the checkbox values from page 1 to page 2. But I only get successes on fruit id, how can pass the fruit charges. [CODE] // how can I pass room charges"$result[room_charges]" to page 2 // page 1 $sql=mysql_query("select * from fruit"); while ($result = mysql_fetch_assoc($sql)) { echo "<label> <input type=checkbox name=fruit[] value=$result[fruit_id] id=Test_0 > $result[fruit_name] | $$result[fruit_charges] </label> "; echo "<br>"; //page 2 // how to replace from page 1 $result[fruit_charges] the charges to f_pay // like room_id works $room=$_POST['room']; foreach ($fruit as $fruitname) { $sql="INSERT INTO reserve (f_aid, f_name, f_pay) VALUES ('$fid', …

Member Avatar
Member Avatar
+0 forum 7

I have the need for a FUNCTION: Transpose($Song, $direction) The logic I need is pretty straight forward, but I am having a hard time replicating it using PHP functions. I will try to break it down to it's simplest form: I have a field that has several lines of text. Chords and Song Lyrics. The "Chord" lines begin with an asterisk "*" (first character) and end with the line break. These are the strings I want to parse. Lines with NO asterisk at the beginning are ignored. Based on 3 arrays of NOTES, I want SUBSTITUTE the text (based on …

Member Avatar
Member Avatar
+0 forum 1

I want to be able to open a window with a variable. For example, I will use domain.com?reference=1234- This link will open a pop up window as follows: [CODE]<a href="javascript:popUp('http://www.domain.co.uk/staff/tpr/update_action_log.php?action_reference=<?php echo $row2['action_reference']; ?>')" title="Click Here edit this entry"><?php echo $row2['action_reference']; ?></a>[/CODE] When I open this window, it is always showing data put in last, it isnt refreshed. I wanted to open this pop up window, enter data and then click submit and make the data enter the database and then refresh the parent window. Every time I have done this, either the parent or the pop (or both) is showing …

Member Avatar
Member Avatar
+0 forum 10

hello guys , how can i send my html email through php code , i mean i enter my html codes and then the php code sends it but in form of message not codes ,or any way ,my question is how to send an html email through php code .and also i have a question on how to create my own malling list where people can sign up to it and when i want to contact them i send only one message to all of them without entering all the emails .thanks to all of those who will reply …

Member Avatar
Member Avatar
+0 forum 2

greetings.. i'm newbie on php and mysql.. i need help on how to create search form that return the results related to it? i'm using php mysql.. thus, i need help on how to make each result that'll be as a link to all data in it's row.. thank you!

Member Avatar
Member Avatar
+0 forum 2

Hello All, I'm trying to modify some code for an auction site but my lack of PHP knowledge is preventing me from doing so. I bought an "Essential Guide To CSS, AJAX,& PHP" book and have been doing the PHP exercises at the W3 site, but it seems that it'll be some time before I have a real grasp of what it is I'm trying to do. I'm hoping that one of you will be able to help me or steer me in the right direction. There are three pages that I need to help with - a php page, …

Member Avatar
Member Avatar
+0 forum 2

I have a joke script which currently displays a new joke each day and I want to change it to where it displays one every week. I keep getting the SQL error below but when I run it in phpMyAdmin it works just fine. Most likely some little thing which I keep overlooking. Don't worry if the logic is off ... just need the code straightened. Here is the error I keep getting. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' now(), …

Member Avatar
Member Avatar
+0 forum 7

The End.