chokies12
Members-
Posts
18 -
Joined
-
Last visited
Never
Everything posted by chokies12
-
[SOLVED] Delete doesnt execute whats wrong??
chokies12 replied to chokies12's topic in PHP Coding Help
o thanks my fault i dont read that much..thanks dude -
here's my code i doesnt delete anything from the database <html> <head> <title>Select</title> </head> <body> <form name="form1" method="post" action="select.php"> <table width="537" border="0"> <tr> <th width="1" scope="row"> </th> <td width="126"> </td> <td width="300"> </td> <td width="92"> </td> </tr> <tr> <th scope="row"> </th> <td>Enter Lastname: </td> <td><label> <input name="keyword" type="text" id="keyword" size="50"> </label></td> <td><input name="submit" type="submit" id="submit" value="Search"></td> </tr> <tr> <th scope="row"> </th> <td> </td> <td><label></label></td> <td> </td> </tr> </table> </form> <table border="1"> <div align="center"></div> <tr> <th>LastName</th> <th>FirstName</th> <th>MiddleName</th> <th>Action</th> </tr> </body> </html> <?php include('inc/function.php'); extract($_POST); if(isset($submit)) { //$keyword = strtolower($keyword); $result = mysql_query("SELECT * FROM student_applicant_information WHERE ppd_lastname='$keyword'"); if(mysql_num_rows($result)){ while($rs = mysql_fetch_array($result)){ $studID = $rs[0]; $lastname = $rs[2]; $firstname = $rs[3]; $midname = $rs[4]; echo "<tr>"; echo "<td>$lastname</td>"; echo "<td>$firstname</td>"; echo "<td>$midname</td>"; echo "<td><a href='select.php?a=delete&id=$studID'>Delete</a> <a href='select.php?a=edit&id$studID'>Edit</a></td>"; echo "</tr>"; } } mysql_close($dbConn); echo "</table>"; } if($_GET['a'] == 'delete') { $id = $_GET['id']; $sql = "DELETE * FROM student_applicant_information WHERE stud_applicant_id=$id"; $result = mysql_query($sql); } if($_GET['a'] == 'eidt') { echo "hello world"; } ?>
-
i think its short_open_tags something like that
-
Hi i only have 1 table for category and the problem is this is already as is i just have to make indention for sub categories. Im just doing some updates and i not familiar with its structures im still a newbie
-
[SOLVED] How to remember POST variabe from html
chokies12 replied to etxnreg's topic in PHP Coding Help
for much easier debuggin why dont you separate your html codes from your php codes. <?php session_start(); extract($_POST); // extract $_POST array so you wont be type $_POST always $_SESSION['test1']=$test1; ?> <html> <head> </head> <body> <form name="form1" method="POST" action="interface.php" style="margin:0px"> <input name="test1" value="test1" type="text" style="position:absolute;width:200px;left:18px;top:108px;z-index:0"> <input name="formbutton1" type="submit" value="next" style="position:absolute;left:72px;top:202px;z-index:1"> </form> </body> </html> -
hi need some help i dont know how to do this. i have list that shows my category items what i want to do know is to have and indent if that item is a sub category can someone help me..thx here's part of my code <table width="80%" cellpadding="2" cellspacing="2"> <tr> <td class="listhd" width="25">#</td> <td class="listhd" width="50">Actions</td> <td class="listhd">Category Name</td> <td class="listhd" width="50" align="center">Order </td> </tr> <?php $n_record_counter=1; foreach($result_fields as $v){ $s_bgColor=($n_record_counter%2) ? '#FFFFFF' : '#EFEFEF'; ?> <tr bgcolor="<?=$s_bgColor?>"> <td > <?=$n_record_counter++;?>.</td> <td > <a href="?a=categories&action=edit&id=<?=$v['id']?>"> <img src="images/icon_edit16x16.gif" /></a> <a href="?a=categories&action=delete&id=<?=$v['id']?>"> <img src="images/icon_delete16x16.gif" /></a> </td> <td class="rowGreen"> <?=$v['name']?> </td> <td align="center"> <?=$v['ordseqn']?></td> </tr> <?php } ?> </table>
-
/FYPSIT/videouploads/ try this one..
-
$ftp_path = 'videouploads/'; try this $ftp_path = '/videouploads/';
-
passwords should be encrypted so the main idea is generate and email and temporary code then a link. upon click the link $_GET the temporary code which you include in the url then if verified in the database show a change password form for much tighter security
-
post your code there's something wrong with your directory
-
what i did was just put a session_destroy(); in top of my login page. i think my logout page has problems doesnt unset the value even if i put unser() .. i did is when you press logout redirect the script to login page and will trigger the destroy part so it will not unset any value from my session variable.
-
help please
-
[SOLVED] Putting a query inside a function
chokies12 replied to alconebay's topic in PHP Coding Help
<?php include 'dbconnect.php'; function pb_stng_selectall($users) { $query = "SELECT * FROM users='$users'"; $result = mysql_query($query) or die(mysql_error()); $stng = mysql_fetch_array($result) or die(mysql_error()); echo = $stng['users']; } ?> <?php pb_stng_selectall(); ?> -
like this?
-
@neil.johnson i can still access my index.php and doesnt redirect me to login.php after i have already logout. still it echo's a value for my $_SESSION['userName']
-
why remove session_destroy?
-
hi guys i need help with my session. im currently applying session in my page security im a newbie.my problem is when i logout and try to access my index page to test if my script work and will redirect me to the login page.but what happen is i can see my index page and my session still has its value. my code for index.php <?php include('include/function.php'); session_start(); if($_SESSION['userName'] == '') { header('location: login.php'); } echo $_SESSION['userName']; ?> <html> <head> <title>Home</title> </head> <body bgcolor="cyan"> <center></br></br> Home View <a href="login.php">Logout</a> </form> </center> </body> </html> logout.php <?php session_start(); unset($_SESSION['userName']); $_SESSION = array(); session_destroy(): header('location: index.php'); ?> any input will be much appreciated