39,326 Topics
| |
<?php //if user hit sumbit //check if field are not empty if(isset($_POST["username"]) && isset($_POST["password"])) { $manager = preg_replace(#[^A-Za-z0-9#i',",$_SESSION["username"]]); $password = preg_replace(#[^A-Za-z0-9#i',",$_SESSION["password"]]); include "../storescript/connect_to_mysql.php"; $sql = mysql_query("SELECT id FROM admin WHERE username='$manger' AND password='$password' LIMIT 1"); //make sure person exists in database--- $existCount = mysql_num_rows($sql); //count the row num if($existCount == … | |
<?php session_start(); //if user is not loged in if(!isset($_SESSION["manager"])) { header("location: admin_login.php"); exit(); } //check if user exists in database $managerID = preg_replace('#[^0-9#]i','',$_SESSION["id"]); //decype the id $manager = preg_replace('#[^A-Za-z0-9]#i','',$_SESSION["manager"]); $password = preg_replace('#[^A-Za-z0-9]#i','',$_SESSION["password"]); include "../storescripts/connect_to_mysql.php"; $sql = mysql_query("SELECT * FROM admin WHERE id='$managerID' AND username='$manager' AND password='$password' LIMIT 1"); //make sure … | |
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in \xampp\htdocs\proj\demo.php on line 57 Can anyone explain my problem. Thanks! <?php $result = mysql_query("SELECT * FROM internet_shop"); while($row=mysql_fetch_assoc($result)) { echo '<div class="product"><img src="img/products/'.$row['img'].'" alt="'.htmlspecialchars($row['name']).'" width="128" height="128" class="pngfix" /></div>'; } ?> | |
Hi, I've written some code in PHP, which I have tried converting to ASP.NET after looking at some examples. I'm stuck on a form processor, where I'm trying to check if some values have been filled in or not. Basicly I had a few issets() to do this in the … | |
Is this possible? <li><a href="master.php" class="selected"><span></span>Home</a></li> <li><a href="about.php"><span></span>About</a></li> <li><a href="products"><span></span>Products</a></li> | |
hello i've started to study html then will go through css then php and mysql please i'd like to ask for your advise for which editor i should stick to to facilitate my learning way the point is that i'd like to start the right way and stick to it … | |
in my home.php file i hv defined one path as javascript variable like below: <?php $path= "http://localhost/tiffany/" ?> <script type="text/javascript" src="<?php echo $path; ?>js/manuals.js"></script> <script type="text/javascript" > var templateUrl = '<?php echo $path; ?>'; </script> & in my 'manuals.js' file i have included someother js files adding with that variable: … | |
php file uploading and save it in database as folder url but save in another project folder. please guide me. | |
i have the follwing table name email pass name1 email1 pass1 name2 eamil2 pass2 how can i cahnge name1 from my admin page please any one help me | |
hi i 've to store the images in folder and retrive them, so how can i ? can anyone help me ? | |
Hi, I'm trying to make a template page for my web site. The main template will include a header section, a main body section and a footer section (not included in sample code). I want to make the header and footer sections separate html pages so I only need to … | |
Hi I am creating some files of which are taken from database fields, the problem is the field in the database has £ in which is great as it is needed when in the browser page. The problem I have is when making the file is that it creates the … | |
Hi! It's ma first time in this forum,i hope u wll wormly welcome me.I am an undergraduate student in Software Eng. at the University of Dodoma in Tanzania, i would like 2 know if I can develope a **computer alarm** with **PHP**, if not the other languages I h've gon … | |
Hi, In the fg_membersite.php file I would like to get the ['id_user'] variable under the function SendUserWelcomeEmail, so the subscriber will receive the registration number (a kind of ticket)... Can someone help me on how to achieve this? I've been trying changes for months but I get nothing. Many thanks … | |
hello everyone..i just wanna ask how i can increment the score after each answer given by the user and at last displaying result after questions finish. i want to store the result in database here's my code which is working fine with checking questions and displaying result and then next … | |
Hi, I'm trying to make my gallery so that it shows a certain number of images then creates more pages. Can anyone help me out on this? This is my gallery file at the minute. gallery.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> <link href="../css/thumbnailviewer.css" rel="stylesheet" … | |
Ok, I am not a professional in PHP as I am more on front-end than back-end. I want to know some information of file upload in PHP. I did create a website as a project where users can upload images, with its security and validation. The images stored in a … | |
Its been alot of mess to make the pagination in wordpress :( I have the pagination, but it renders the same page template file is ?php get_header(); ?> <?php global $my_query; global $paged; $paged = get_query_var('paged') ? get_query_var('paged') : 1; $temp = $my_query; $my_query = null; $args = array( 'post_type' … | |
I've been at this for quite some time and just can't figure it out.I have a html table and have to find the total sum of the values in the $total/Sale Cost (last) row. Can anyone help me out or point me in the right direction. Code below: <?php print … | |
hi, im trying to write a mysql query to join tables. I basically i have the following tables: tblwinners = table that shows all the winners PK reward_id customer_id tbluser = table that holds all the user accounts PK customer_id tblcompleterewards = completed rewards PK reward_id tblrewards = holds a … | |
Hello Everyone, I have a php class like this: class DatabaseObject { protected static $table_name; } Then, when I extended this class, I do this: class User extends DatabaseObject { protected static $table_name = "users"; } However, I am encountering errors "mysql_fetch_array(): supplied argument is not a valid MySQL" because … | |
> hy guys,..how to make paging from array 3D? > first index[0] become first page next index[1]become second page and next index[2] become third page > example: Array ( [0] => Array page>>>1 ( [0] => Array ( [0] => aaa [1] => bbb ) [1] => Array ( [0] … | |
Hello, I am trying to install this free script: --------------- 3. Installation --------------- To install MyMail, follow these simple steps and you'll be creating lists in no time. 1. Unzip file contents to a folder 2. FTP into your server and upload MyMail 3. CHMOD config.php to 777 and the … | |
Hello, Cek this site: [website](http://www.kompas.com/) If you hover the mouse above each article title, there is an explanation tips appears. How to do so? | |
Hi, I need help in writing a regular expression accoding to the following criteria: preg_match (keywords tel/contact/phone/phne/telephone which can be found anywhere in the string) followed by 7 int(numbers). Thnx, Regards, Sami | |
<?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("ms", $con); $time1 = $row['timein']; $time2 = $row['timeout']; $sql = mysql_query("SELECT employees.*, timetable.* FROM employees INNER JOIN timetable ON employees.id = timetable.id WHERE timetable.in_time BETWEEN employees.timein AND employees.timeout "); echo "<table width='734'> <tr> <th width='49' scope='col'>Employee … | |
If I choose to retrieve some MySQL data using PHP, how do I put it in a certain area of my page? For example, if there is a div with an id of "putTextHere", how to make PHP echo/put text in this div? And how to get a certain value … | |
Hi, I am trying to create an input that collects address inputs (home address) and I have no idea how to start nor how to create an input like that. I tried Google, got nothing from it. If anyone can help, that would be great :) | |
hi, i have a problem to display my data. i have 4 table (**proposals,quotation, po,simulation**), in **proposal** there is **pro_id, pro_name,file_name and file**, in **quotation** there is **pro_id, quo_name, file_name and file**, in **po** there is **pro_id, po_name, file_name and file**, in **simulation** there is **pro_id, simul_name, file_name and file**. … |
The End.