pixeltrace
Members-
Posts
577 -
Joined
-
Last visited
Never
Everything posted by pixeltrace
-
problem on displaying data from database
pixeltrace replied to pixeltrace's topic in PHP Coding Help
for the drop down menu, i have this code code]sort by : <select name="select"> <option value="1">name</option> <option value="2">client ID</option> <option value="3">date</option> </select>[ i will use this so i may have the option to view the data sorted via name, client id or date but i dont know what is the codes to make the drop down menu function correctly. hope you could help me with this. thanks! -
problem on displaying data from database
pixeltrace replied to pixeltrace's topic in PHP Coding Help
ic. thanks! its working now. i still got 2 more problems. notice in my codes i got a select form there <select name="select"> <option value="clientmngr.php?id=v1">name</option> <option value="clientmngr.php?id=v2">client ID</option> <option value="clientmngr.php?id=v3">reg date</option> </select> i am planning to use it as a option to view the data via: name client id reg date (day, month, year is separated from the databse field) i dont know how to do it. also what is the code that will display the total number of items in my database let say via clientid? thanks in advance! -
guys, i need help, i cant get the correct method on how to display items in my database in my table. the error message that i am getting is "no data found" also, i have a drop down option wherein i can view the datas by name clientID reg date ( day, month, year is on a separate field in my database) i also have a section there wherein it has to show the total number of items in the database but i dont know how to make it work too. below is my codes for this page <table width="620" border="0" cellspacing="2" cellpadding="0"> <tr> <td colspan="6"><table width="616" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="329" class="text6"> total record found : <? '' ?></td> <td width="287"> </td> </tr> </table></td> </tr> <tr> <td colspan="6"><table width="617" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="459"> </td> <td width="158" class="text6">sort by : <select name="select"> <option value="clientmngr.php?id=v1">name</option> <option value="clientmngr.php?id=v2">client ID</option> <option value="clientmngr.php?id=v3">reg date</option> </select> </td> </tr> </table></td> </tr> <tr> <td colspan="6"> </td> </tr> <tr> <td width="52" align="center" bgcolor="#83C2ED" class="text5">ID</td> <td width="160" align="center" valign="top" bgcolor="#83C2ED" class="text5">name</td> <td width="69" align="center" bgcolor="#83C2ED" class="text5">joined date </td> <td width="153" align="center" bgcolor="#83C2ED" class="text5">rate agreed </td> <td width="133" align="center" bgcolor="#83C2ED" class="text5">remark</td> <td width="39" bgcolor="#83C2ED"> </td> </tr> <? include 'db_connect.php'; $uSql = "SELECT clientid, client_name, joined_day, joined_month, joined_year, client_rate, client_remarks FROM clients ORDER by client_name DESC"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; } else{ while($uRow = mysql_fetch_row($uResult)){ ?> <tr> <td bgcolor="#FFFFCC" class="text8">C<?= $uRow[0]?></td> <td bgcolor="#FFFFCC" class="text8"><?= $uRow[1]?></td> <td bgcolor="#FFFFCC" class="text8"><?= $uRow[2]?>-<?= $uRow[3]?>-<?= $uRow[4]?></td> <td bgcolor="#FFFFCC" class="text8"><?= $uRow[5]?></td> <td bgcolor="#FFFFCC" class="text8"><?= $uRow[6]?></td> <td align="center" bgcolor="#FFFFCC"><a href="clientedit.php?$clientid=$clientid" class="link1">edit</a></td> </tr> <? } } ?> <tr> <td colspan="6"> </td> </tr> <tr> <td colspan="6"> </td> </tr> </table> hope you could help me with this. thanks in advance!
-
help please!
-
any update on this? appreciate your help thanks!
-
yes. it should be admin_user i changed it already but i still cant update the password. also in my useracct.php howcome whenever i click on the update button its opening a new window of the same page? what could be wrong in my codes? need help. thanks!
-
guys, i need help on my change password form. it seems that its not updating the password to the new password and whenever i click on the update button its opening a new page. i got 2 page 1. useracct.php 2. changepass.php also in my useracct.php i have there a code for the <? $userIP = getenv("REMOTE_ADDR"); echo "$userIP"; ?> i dont know what wrong with my code but its not getting the computer's current IP this is the code for my useracct.php <? session_start(); if (session_is_registered("username")){ if($_SESSION['user_level'] == 'administrator'){ $username = $_SESSION['username']; //$username = $_POST['username']; include 'db_connect.php'; $query = mysql_query("SELECT userid, username, first_name, last_name, job_title, email, user_level FROM admin_user WHERE username= '$username'") or die(mysql_error()); $row = mysql_fetch_array( $query ); $userid = $row["userid"]; $username = $row["username"]; $first_name = $row["first_name"]; $last_name = $row["last_name"]; $job_title = $row["job_title"]; $email = $row["email"]; $user_level = $row["user_level"]; ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>:: JobHiRings :: Administration Page</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 10px; margin-right: 0px; margin-bottom: 0px; } --> </style> <link href="css.css" rel="stylesheet" type="text/css"> </head> <body> <table width="778" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="3"><img src="images/header.gif" width="778" height="148"></td> </tr> <tr> <td width="16" rowspan="2" align="left" valign="top" background="images/left.gif"><img src="images/left.gif" width="16" height="14"></td> <td width="745" valign="top"><table width="746" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3" class="text4">USER ACCOUNT INFORMATION </td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="2" valign="top"><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1"></td> <td width="214" valign="top"><? include 'sidemenu.php'; ?> </td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1"></td> </tr> </table></td> <td width="519" align="center" valign="top"><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1"></td> <td width="214" valign="top"><table width="460" border="0" cellspacing="2" cellpadding="0"> <tr> <td colspan="3" valign="top"><img src="images/spacer.gif" width="10" height="8"></td> </tr> <tr> <td colspan="3" bgcolor="#999999"> </td> </tr> <tr> <td colspan="3" valign="top"><img src="images/spacer.gif" width="10" height="10"></td> </tr> <tr> <td width="137" align="right" class="text6">account ID : </td> <td> </td> <td class="text7">USR<? echo "$userid"; ?></td> </tr> <tr> <td align="right" class="text6">username : </td> <td width="7" rowspan="2"> </td> <td width="308"><span class="text7"> <? echo "$username"; ?> </span></td> </tr> <tr> <td align="right" class="text6">name : </td> <td width="308"><span class="text7"> <? echo " ".$first_name." ".$last_name." "; ?> </span></td> </tr> <tr> <td align="right" class="text6">job title : </td> <td> </td> <td><span class="text7"> <? echo "$job_title"; ?> </span></td> </tr> <tr> <td align="right" class="text6">email address : </td> <td> </td> <td><span class="text7"> <? echo "$email"; ?> </span></td> </tr> <tr> <td align="right" class="text6">user level : </td> <td> </td> <td><span class="text7"> <? echo "$user_level"; ?> </span></td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td align="right" class="text6">last login : </td> <td> </td> <td><span class="text7"> <? echo date('m-j-Y'); ?> </span></td> </tr> <tr> <td align="right" class="text6">IP address used : </td> <td> </td> <td><span class="text7"> <? $userIP = getenv("REMOTE_ADDR"); echo "$userIP"; ?> </span></td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <form target="changepass.php" method="post"> <tr> <td align="right" class="text6">change password : </td> <td> </td> <td> </td> </tr> <tr> <td align="right" class="text6">new : </td> <td> </td> <td><input type="password" name="newpasswd"></td> </tr> <tr> <td align="right" class="text6">confirm new password : </td> <td> </td> <td><input type="password" name="newpasswd2"></td> </tr> <tr> <td rowspan="2"> </td> <td rowspan="2"> </td> <td><input type="submit" name="update" value="update"></td> </tr> <tr> <td> </td> </tr> </form> </table></td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1"></td> </tr> </table></td> </tr> <tr> <td colspan="3"> </td> </tr> </table></td> <td width="16" rowspan="2" align="right" valign="top" background="images/right.gif"><img src="images/spacer.gif" width="1" height="1"><img src="images/right.gif" width="16" height="14"></td> </tr> <tr> <td valign="top"><img src="images/spacer.gif" width="746" height="10"></td> </tr> <tr> <td colspan="3" background="images/footer.gif"><table width="583" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="12" rowspan="2"><img src="images/spacer.gif" width="12" height="43"></td> <td width="560" height="10" valign="top"><img src="images/spacer.gif" width="12" height="10"></td> <td width="12" rowspan="2"><img src="images/spacer.gif" width="12" height="43"></td> </tr> <tr> <td align="center" valign="top" class="footer">Copyright © 2007 www.jobhirings.com. All Rights Reserved</td> </tr> </table></td> </tr> </table> <? }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='index.php'>Login</a></font>"; } }else{ echo '<script language=javascript>top.location = "index.php";</script>'; } ?> </body> </html> and this is the code for my changepass.php <? session_start(); if (session_is_registered("username")){ $username = $_SESSION['username']; $newpasswd = $_POST['newpasswd']; $newpasswd2 = $_POST['newpasswd2']; if ($newpasswd = $newpasswd2) { include 'db_connect.php'; $password = md5($newpasswd); $sql="UPDATE admun_user SET password='$password' WHERE username='$username'"; mysql_query($sql) or die("error:".mysql_error()); if ($_SESSION['user_level'] == 0) { echo '<script language=javascript>alert("Password has been changed");top.location = "useracct.php?username='.$username.'";</script>'; } else echo '<script language=javascript> alert("Password does not match!");top.location = "useracct.php?username='.$username.'";</script>'; }else{ echo '<script language=javascript> alert("You are not authorized to access this page!");top.location = "main.php";</script>'; } }else{ echo '<script language=javascript>top.location = "index.php";</script>'; } ?> hope you could help me with this. thanks in advance!
-
thanks for the explanation. it helped.
-
thanks man! its working now! just one last question. what is the "." for? the one that you placed before and after first_name and last_name <? echo " ".$first_name." ".$last_name." "; ?> :: <? echo "$job_title"; ?> thanks again!
-
Hi, Its still the same. welcome :: instead of welcome peter parker :: spiderman i checked the database and there a value for first_name, last_name and job_title there
-
thanks skali! i'll try this out.
-
hi, i tried this but its not showing the values. only welcome :: instead of welcome peter parker :: spiderman thanks!
-
in the main page instead of welcome peter parker :: spiderman this is appearing welcome $first_name $last_name :: $job_title what could be wrong in my codes? is it in the main.php or in the checkuser.php? need help thanks in advance!
-
hi, thanks for the help, with regards to my previous question also, how will i rename the resume file in the submit php page? ex. myresume.doc to jobID000101.doc thanks!
-
any update on this one? thanks! ???
-
its still not working. this is the error i am getting Parse error: parse error, unexpected '}' in c:\hosting\webhost4life\member\diorgrace\admean\main.php on line 77 this is the current entire codes in my main.php page <? session_start(); if (session_is_registered("username")){ if($_SESSION['user_level'] == 'administrator'){ $username = $_SESSION['username']; include 'db_connect.php'; $uSql = "SELECT first_name, last_name, job_title FROM admin_user WHERE username= '$username'"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; } } } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>:: JobHiRings :: Administration Page</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 10px; margin-right: 0px; margin-bottom: 0px; } --> </style> <link href="../CSS.css" rel="stylesheet" type="text/css"> <link href="css.css" rel="stylesheet" type="text/css"> </head> <body> <table width="778" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="3"><img src="images/header.gif" width="778" height="148"></td> </tr> <tr> <td width="16" rowspan="2" align="left" valign="top" background="images/left.gif"><img src="images/left.gif" width="16" height="14"></td> <td width="745" valign="top"><table width="746" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="746" colspan="2"> </td> </tr> <tr> <td colspan="2">Welcome <? echo '$first_name $last_name' ?> :: <? echo '$job_title' ?></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td colspan="2"> </td> </tr> </table></td> <td width="16" rowspan="2" align="right" valign="top" background="images/right.gif"><img src="images/spacer.gif" width="1" height="1"><img src="images/right.gif" width="16" height="14"></td> </tr> <tr> <td valign="top"><img src="images/spacer.gif" width="746" height="10"></td> </tr> <tr> <td colspan="3" background="images/footer.gif"><table width="583" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="12" rowspan="2"><img src="images/spacer.gif" width="12" height="43"></td> <td width="560" height="10" valign="top"><img src="images/spacer.gif" width="12" height="10"></td> <td width="12" rowspan="2"><img src="images/spacer.gif" width="12" height="43"></td> </tr> <tr> <td align="center" valign="top" class="footer">Copyright © 2007 www.jobhirings.com. All Rights Reserved</td> </tr> </table></td> </tr> </table> <? }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='index.php'>Login</a></font>"; } }else{ echo '<script language=javascript>top.location = "index.php";</script>'; } ?> </body> </html>
-
hi, i changed the codes in main.php already but its still not working this is the current codes in my main.php <? session_start(); if (session_is_registered("username")){ if($_SESSION['user_level'] == 'administrator'){ $username = $_SESSION['username']; include 'db_connect.php'; $uSql = "SELECT first_name, last_name, job_title FROM admin_user WHERE username= '$username'"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; } ?>
-
guys, i also need help in my login form, i have 3 page 1. index.php 2. checkuser.php 3. main.php so when i login to index.php - checkuser.php will validate the user once done it will bring me to main.php my problem is, in main.php it not getting the data from checkuser.php let say i have username: peterparker when i get to main.php the field where peterparker's first name and last name should be shown is not appearing but just the variable. this is the code for my index.php <?php include 'db_connect.php'; ?> <form action="checkUser.php" method="post" name="frmLogin"> <table width="260" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#2A4DAB"> <tr> <td width="276"><table width="260" border="0" align="center" cellpadding="4" cellspacing="0"> <tr> <td height="2" colspan="3" valign="top"><img src="images/spacer.gif" width="10" height="2"></td> </tr> <tr> <td colspan="3" bgcolor="#5F9DE3" class="text2">STAFF LOGIN </td> </tr> <tr> <td colspan="3" valign="top"><img src="images/spacer.gif" width="10" height="2"></td> </tr> <tr> <td width="30%" align="right"><span class="text1">User</span></td> <td colspan="2"align="left"><input name="username" type="username" id="username" /></td> </tr> <tr> <td align="right"><span class="text1">Password</span></td> <td colspan="2" align="left"> <input name="password" type="password" id="password" /> </td> </tr> <tr> <td> </td> <td width="21%"> <input type="submit" name="Submit" value="Login" class="mybutton" /> </td> <td width="49%"> <a href="forgotpass.php" class="link1">forgot your password?</a></td> </tr> <tr> <td> </td> <td colspan="2"> </td> </tr> </table></td> </tr> </table> </form> this is the code for my checkuser.php <? session_start(); $username = $_POST['username']; $password = md5($_POST['password']); if(empty($username) || empty($password)){ echo '<script language=javascript> alert("Please enter ALL of the information!");</script>'; echo '<script language=javascript> top.location = "index.php";</script>'; exit(); } include 'db_connect.php'; $result = mysql_query("SELECT userid, user_level FROM admin_user WHERE username = '{$username}' AND password = '{$password}'"); $numb_rows = mysql_num_rows($result); if($numb_rows == 0) { //NOT A VALID LOGIN/PASSWORD echo '<script language=javascript> alert("You could not be logged in! Either the username and password do not match! Please try again!");</script>'; echo '<script language=javascript> top.location = "index.php";</script>'; die(); } $row = mysql_fetch_assoc($result); $_SESSION['userid'] = $row['userid']; $_SESSION['username'] = $username; $_SESSION['user_level'] = $row['user_level']; mysql_query("UPDATE users SET last_login=now() WHERE userid=" . $row['userid'] . ""); if($row['user_level'] == 'administrator') { header("Location: main.php"); } else if($row['user_level'] == 'staff') { header("Location: main2.php"); } ?> and this is the code for my main.php <? session_start(); if (session_is_registered("username")){ if($_SESSION['user_level'] == 'administrator'){ $username = $_GET['username']; include 'db_connect.php'; $uSql = "SELECT first_name, last_name, job_title FROM admin_user WHERE username= '$username'"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; } ?> Welcome <? echo '$first_name $last_name' ?> :: <? echo '$job_title' ?> what's wrong in my codes? need help please! Thanks in advance!
-
assuming this is my form page <form target="submit.php" method="post"> <table width="733" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="116"> </td> <td width="617"> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td>name * </td> <td><input name="name" type="text" id="name" /> </td> </tr> <tr> <td>gender</td> <td><input name="gender" type="text" id="gender" /></td> </tr> <tr> <td>date of birth </td> <td><input name="bdate" type="text" id="bdate" /></td> </tr> <tr> <td>email address * </td> <td><input name="email" type="text" id="email" /></td> </tr> <tr> <td>contact number * </td> <td><input name="cnumber" type="text" id="cnumber" /></td> </tr> <tr> <td>nationality</td> <td><input name="nationality" type="text" id="nationality" /></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td>current salary * </td> <td><input name="csalary" type="text" id="csalary" /></td> </tr> <tr> <td>expected salary * </td> <td><input name="esalary" type="text" id="esalary" /></td> </tr> <tr> <td>notice period * </td> <td><input name="nperiod" type="text" id="nperiod" /></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td>attach photo </td> <td><input name="photo" type="file" id="photo" /> * picture should not exceed 100KB </td> </tr> <tr> <td>attach resume </td> <td><input name="resume" type="file" id="resume"></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td>Text Resume </td> <td> </td> </tr> <tr> <td> </td> <td><textarea name="textresume" cols="100" rows="120"></textarea></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> </table></form> what should my submit.php codes be? and assuming all resumes will be save inside "resume" folder. hope you could help me with this. Thanks in advance!
-
actually i dont have any idea and i haven't tried it yet the last form that i did was just a sendmail form wherein the fields are just text field, text area and radio buttons with regards to attachment i haven't tried yet and i dont know how. hope you could help me with this. thanks in advance!
-
form where they can upload the picture and resume then the resume will be saved in a specific folder into the server. let say "resumes" and have the filename renamed let say from myresume.doc to jobID001.doc is this possible? thanks in advance!
-
guys, i need help, i am currently developing a job portal and there's a page wherein job seeking or applicants needs to upload there picture and resume. is there anyone here who have made a job portal already? i dont have any idea on how to develop the form for this. i need tips for this. hope you guys can help me with this. thanks in advance!
-
guys i need help, i got 2 page, 1 for the form and 1 for the sendmail this is the link for my form http://www.banyantree.com/earthday/eform.php and this is the link for my sendmail http://www.banyantree.com/earthday/sendmail.php i was able to solve my previous problem here regarding my checkbox now my new problem is this: when i select the resort from the form what i want to happen there is when i select it it will remain selected instead of going back to my default selected item which is bangkok. hope you're getting what i mean. this is an easy problem but i can't find the solution, hope you could help me with this. this is the code for my drop down: [code]<? if (!isset($_GET['url'])){ $url='bangkok.php'; } else { $url = $_GET['url']; } ?> <select class="sorteventlist" name="list" onFocus="selectedIndex = 0" onChange="if( options[selectedIndex].value != '') document.location = 'eform.php?url='+form.list.value"> <option value="bangkok.php">Banyan Bangkok</option> <option value="bintan.php">Banyan Tree Bintan</option> <option value="lijiang.php">Banyan Tree Lijiang</option> <option value="maldives.php">Banyan Tree Maldives</option> <option value="phuket.php">Banyan Tree Phuket</option> <option value="ringha.php">Banyan Tree Ringha</option> <option value="seychelles.php">Banyan Tree Seychelles</option> </select> <br><br> <? include ($url); ?> [/code] thanks!
-
hi, I am having this same kind of problem. what is will be the script on the second page? by the way my seconde page is a sendmail page and i need to send the information from the checkbox with <br> how do i do this? thanks!
-
need help please!!!!