39,320 Topics
| |
Hi! Can somwhone make, or copy here php image upload code, I was searching on internet but found nothing... What I need is that, to upload picture to database, but not blob, and show it in actual link like www.website.com/pictures.php?id= <--and there a number, that shows a picture. And switching … | |
Dear Sirs! I would like to echo out the last iteration of a while loop differently as the first ones. This is my code wich echos out the first and the last iteration, but I need the middle iterations as wel.. <?php // Print if ($row = mysql_fetch_array($result)) { echo … | |
hi every one. i have two tables table_1 ( std_id primary key, std_name, tchr_id foreign key ); table_2 ( tchr_id primary key, tchr_name ); as from the above tables i have the foreign key constraint. it mean if i want to delte teacher id it must be firstly deleted from … | |
Hi, I am completing a edit page in php however, it keep stating that "Parse error: syntax error, unexpected $end in home/..........................................". Can anyone help me to check my code if there are any mistakes. Since the code is extremely long therefore I have linked it to my business page … | |
hi all i want to store the error of `mysql_error()` in a variable. i was trying the following: $alert_error = "<script type=\"text/javascript\"> alert('".mysql_error()."') </script>"; $id =5; $query = mysql_query("DELETE FROM abc WHERE id ='$id'") or die ($alert_error); actually my there is a foreign key constraint so when i click to … | |
Hello, Am a PHP developer , am working a hotel application but the issus am having here maynot be so heard to achive but am stock here and i need your help here. I have two table which are "blockedrooms" and "bookingstest" blockedrooms has `blockedrooms` (`id`, `id_item`, `the_date`, `id_state`, `id_booking`, … | |
Hi all friends, I am trying to insert XML data using DOM, i completed mostly but little bit left, issue in the <field></field> the data between that not inserted in db, please consider the below mentioned XML file... <?xml version="1.0" encoding="UTF-8"?> <form name="mc1.dpp" application-name="mc1.dpp" application-id="34" document-id="1342" producer="Penvision Formidable Application Server" … | |
Dear Sirs! I would like to pass the $row[2] from my PHP code below <?php // MySQL mysql_connect("localhost", "", "") or die(mysql_error()); mysql_select_db("") or die(mysql_error()); // Table $result = mysql_query("SELECT * FROM `fillingstations` LIMIT 0 , 30") or die(mysql_error()); // Print while($row = mysql_fetch_array($result)){ echo 'Station name: '. $row[1]; echo … | |
hi i have a following form in html: `<form action="upload_file.php" method="post" enctype="multipart/form-data"> File Name: <input type="file" name="file" id="file" /> <br /> <input type="submit" name="submit" value="Submit" /> </form>` and here is my `upload_file.php` if (($_FILES["file"]["type"] != "file/XML")) { echo "Invalid file type"; } else { echo 'file is uploaded'; } it … | |
Here is my code <?php $url="http://www.google.co.in"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); echo $result; ?> When I try to display webpage in div it goes full page. I want to display it only in div which I want. It is not getting code from it's original css … | |
I have a simple math problem.. But what I would like to do is not have zero display if it equals out to zero... `<? echo $_POST['x'] * $_POST['y']?>` If this equals anything below zero I do not want the number to display. | |
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\E-COMMERCE\admin\inventory_list.php on line 66 line 66: $productCount= mysql_num_rows($sql); //count the output amount <?php //block grab the whole list for viewing $product_list = ""; $sql = mysql_query("SELECT * FROM products ORDER BY date_added DESC"); $productCount= mysql_num_rows($sql); //count the output amount … | |
I have script that using to ssh2 to log into the firewall. I would like to run the commands from the firewall as if I was in the terminal when I add in the command in my script I get Resource id #5. <?php $connection = ssh2_connect('192.168.2.5', 22); ssh2_auth_password($connection, $user, … | |
Based off some stuff from my last thread I tried to write a search results page using maximum 3 parameters. I used a couple of function to try and get everything organized. One: sort_mysql_results has no defined parameters so I can put in as many parameters as needed. The code … | |
Hello, After long time I am visiting this forum. I am very busy with my new job and don't find much time to contribute in forums. I really missed this forum. I have several blogs with wordpress and I think its time for me to learn Joomla. So, I am … | |
Hi I have to echo out some fields but "field 1" "field 2" "field 3" has a numeric value. I need to divide field 1 by field 2 and then take that result off of field 3 and echo that result. The code is part of a table this is … | |
Hello I have a database of jobs and I want persons to be able to search using keywords. users will be required to enter these keywords via text field. I am able to display the results if the user enters one search word in the text field however i am … | |
<?php include 'vars.php'; set_time_limit(0); putenv("TZ=Asia/Calcutta"); $conn = mysql_connect($hostname,$username,$pass)Or DIE ("Unable to connect to database"); mysql_select_db($dbname, $conn); global $name,$pass,$userid,$sex,$nam,$password,$flag; $userid = $_REQUEST['userid']; $userid=strtoupper($userid); $password = $_REQUEST['password']; $query = "SELECT name,password,lastlogin FROM binaryusers where userid = '$userid'"; $res = mysql_query($query)or die ("Bad query: " . mysql_error() ); if (mysql_fetch_row($rs)) { global $name, … | |
I need to generate sequences of games using the round robin algorithm. I have the php page where the user can input the tournament name which will be inserted into the database and it has got a drop down menu up to 32 teams (select number of teams). So if … | |
Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\E-COMMERCE\admin\inventory_list.php on line 55 move_uploaded_file($_FILES['fileField']['tmp_name'], "../inventory_images/$newname"); what is t_string error? here is almst full full. <?php... $sql = mysql_query("INSERT INTO products (product_name, price, details, category, subcategory, date_added) VALUES('$product_name','$price','$details','$category','subcategory','details', now())")or die("insert error"); $pid = mysql_insert_id(); $newname = "$pid.jpg" move_uploaded_file($_FILES['fileField']['tmp_name'], "../inventory_images/$newname"); ...? <html> .... <form … | |
Hi, I am building this script to display a daily comic, I am trying to get every day after the start date and up to the present date to turn into a link on the calendar but only those days. The script is more than one file but I believe … | |
Dear Sirs! I have this php syntax in my <head>. <?php // MySQL mysql_connect("localhost", "fundis_petrol", "petrol123") or die(mysql_error()); mysql_select_db("fundis_petrol") or die(mysql_error()); // Table $result = mysql_query("SELECT * FROM `fillingstations` LIMIT 0 , 30") or die(mysql_error()); // Print while($row = mysql_fetch_array($result)){ echo $row[2]; } ?> And I also have this JS … | |
<?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. |
The End.