39,323 Topics

Member Avatar for
Member Avatar for Naveed_786

Hi All, I havefollowing code and getting error "Parse error: syntax error, unexpected 'elseif' (T_ELSEIF) in C:\xampp\htdocs\SMR\index.php on line 13". Wehen i remove elseif and keep only if it just checks the first condition and ignor the second. When i put back elseif i get error. Please to fix this …

Member Avatar for pritaeas
0
72
Member Avatar for mexabet

I have two MySQL tables, which I want to SELECT using a single PDO query and positional placeholders. I've been going through similar questions here to find a solution, but none seems to match the issues I'm having. The following code is the section of my script: <?php // query …

Member Avatar for mexabet
0
965
Member Avatar for sols4comp

I have created a php form that connects to a MySQL database. This is working fine however I have added validation and this doesn't appear to be working correctly and still posts to the results to the database regardless of if they are validated or not. Any ideas?

Member Avatar for Dani
0
150
Member Avatar for Dani

This question specifically relates to PHP's Memcached library when specifying a server key and adding multiple keys at once. **Question one**: Is it true that PHP's setMultiByKey() doesn't take advantage of the memcached server's native support for setting multiple keys at once, but that the logic is on PHP's side …

0
269
Member Avatar for Passy

function username_exists($username){ global $db; $sql = "SELECT 'username' FROM users WHERE 'username' = '$username'"; $result = mysqli_query($db, $sql); confirmquery( $result ); if (mysqli_num_rows($result) > 0) { return true; }else { return false; } } if(username_exists($username)){ $error['username'] = 'Username already exists'; }

Member Avatar for Dani
0
76
Member Avatar for harshadgowda
Member Avatar for Sahilsahni

please if anyone could tell me, how it would be possible, i want to save the content of a uploaded word document in database field with php, no problem with encrypted file like ( ´V z2Ö<Ö<ôÿÿÿÿÿÿ·üü?????ÿÿÿÿSSS8‹DÏLS¥9à1) as it shows if you open a word document in a browser. just want …

Member Avatar for ishu_1
0
4K
Member Avatar for Passy

**my functions.php file** <?php function confirmquery( $result ){ global $db; if(!$result){ die("OUERY FAILED .".mysqli_error($db)); } } function redirect($location){ return header("Location:". $location); } function is_admin($username = ''){ global $db; $sql = "SELECT user_role FROM users WHERE username = '$username'"; $result = mysqli_query($db, $sql); confirmquery( $result ); $row = mysqli_fetch_array($result); if ($row['user_role'] …

Member Avatar for rproffitt
0
189
Member Avatar for Passy

function username_exists($username){ global $db; $sql = "SELECT 'username' FROM users WHERE 'username' = '$username'"; $result = mysqli_query($db, $sql); confirmquery( $result ); if (mysqli_num_rows($result) > 0) { return true; }else { return false; } } if(username_exists($username)){ $error['username'] = 'Username already exists'; }

Member Avatar for falcon7
0
54
Member Avatar for Sananil

I have set up for users online but some users showing always online . can you help anyone this my code ![zzz.png](https://static.daniweb.com/attachments/4/810ade1e5592a68b47aee955adb8de8f.png) <?php if ($Row->logged_in == '0') { if ($Row->last_login != '0000-00-00 00:00:00') { ?>Last Login : <?php echo date('d M Y ,H:i A', strtotime($Row->last_login)); } else { echo "<span …

Member Avatar for Emmason
0
434
Member Avatar for pandglobal

I want a secured and server side way of interacting with two different servers namely SERVER A and SERVER B and i want database details and queries done on server B without reveling this database details to server A but yet server A functions based on responses it got from …

Member Avatar for Emmason
0
81
Member Avatar for mexabet

I'm trying to redirect user to "**userinfo.php**" after successful registration, but the browser terminates the redirection because it goes into endless loops. Moreover, I need your insight on if the script is secure or not. I need your help, please. Thanks. The following is the "**register.php**" script: <?php // include …

Member Avatar for Dani
0
355
Member Avatar for nishita_1

Please Help me. I am coding PHP using below code but out put is not perfect. i am also attach output picture below. <?php require_once 'core.php'; include_once("../fpdf182/fpdf.php"); $pdf = new FPDF(); $pdf->AddPage(); $pdf->setFont("Arial","B",16); $orderId = $_POST['orderId']; $sql = "SELECT orders.order_id, orders.order_date, customer.customer_name, customer.customer_mobile, orders.sub_total, orders.vat, orders.total_amount, orders.discount, orders.grand_total, orders.paid, orders.due, …

Member Avatar for Dani
0
711
Member Avatar for Joseph Raj

I Couldn't get $_POST['photo'] while echo. how can i rectify it. The method is post action="" if(isset($_POST['btn_submit'])){ extract($_POST); if(is_uploaded_file($_FILES['photo']['tmp_name'])){ $temp=$_FILES['photo']['tmp_name']; $file=time()."-".$_FILES['photo']['name']; move_uploaded_file($temp,"uploads/".$file); $file_sql.="photo='$file',"; } $rs=mysqli_query($con,"INSERT INTO details set name='$name',email='$email',aadhar_number='$aadhar_number',$file_sql room_no='$room_no',age='$age',phone_number='".$_GET['mob_no']."',address='$address'"); echo $_POST['photo'];

Member Avatar for Dani
0
22
Member Avatar for Sananil

I want my users to be logged out automatically after30 minutes of inactivity. I also want to have all sessions destroyed. This is my login.php i have set cookies but does not work. if (isset($_POST['member_login'])) { $username = isset($_POST['username']) ? $_POST['username'] : ""; $password = md5(isset($_POST['password']) ? $_POST['password'] : ""); …

Member Avatar for Dani
0
650
Member Avatar for alexxnorton01

Hi Guys, I am new here I found this forum very well managed this is very satisfactory. I am new in affiliate marketing as well and want to create affiliate website and was looking for solution with data API. Could anyone help me in this regard, I found a solution, …

Member Avatar for Dani
0
67
Member Avatar for Alexis_fr

Hello, I'm a not a programmer at all and when I tried to build a LibraryBox for my school I didn't know it was a discontinued project. So I'm here with my MR3020 version 3 (the one that is not supported anymore by the project...) and I managed with my …

Member Avatar for Dani
0
148
Member Avatar for anish.anick

Hi All, How can i set the session time out in PHP if the user stays inactive for a certain time in a web page.Please help me to solve this.. Thanks

Member Avatar for syaifulrijzal10
0
19K
Member Avatar for Sananil

Hi, first of all let me thank anyone willing to help out with this. Jquery / Ajax update Span or Div by ID without refreshing page <?php } $select = $DatabaseCo->dbLink->query("select sh_id from shortlist where to_id='" . $Row->matri_id . "' and from_id='" . $user_id . "'"); if (mysqli_num_rows($select) == 0) …

Member Avatar for Biiim
0
4K
Member Avatar for nanakumi75

Guys, I need your help. I need a Content Management System for creating an online investment platform. I want to create a website like www.wazobiaking.cash Thanks for you help.

Member Avatar for Dani
1
38
Member Avatar for Kurt_3

I'm having this kind of error tho I already fixed the old issue but still i dont know why I am getting this error. **Please be reminded that I am currently newbie ug PHP and I am self studying** <?php session_start(); $con = mysqli_connect('localhost',); mysqli_select_db($con, 'user');; $s = "select * …

Member Avatar for rproffitt
0
16
Member Avatar for mexabet

I'm struggling to build a PHP registration script using PDO prepared statements with positional placeholders. But the MySQL queries don't execute. `var_dump();` doesn't display any error. Please, I need your help to fix this. Your time and input are much appreciated in advance. Thanks. **register.php:** <?php // include configuration file …

Member Avatar for rproffitt
0
625
Member Avatar for Thanigaivel_1

Greetings to everyone, I am working as a freelance web developer, i have more than 4 years experience in osclass scripts. I am working in the osclass scripts for the past 4 years and have created nearly 67 sites in osclass, and have created many plugins, cuztomized themes, plugin cuztomizations …

Member Avatar for Mcqs
1
341
Member Avatar for texelbee

I am a nyophyte to PHP, and I've seen this answered so many different ways that it is confusing. I have a combobox that is dynamically populated from a MySQL table ACTIVE in a database AIRCRAFT. Based on the selected AIRCRAFTREGISTRATION value from the combobox, I want to find and …

Member Avatar for Biiim
0
307
Member Avatar for sunil_32

I have a website in laravel [instazood](https://www.iinstazood.com/) I want to apply limit clause with eager loading. I tried many other ways made r and d but could not get any solution. function fetchData() { $user = new User; $data = $user->with('comments'=>function($query){ $query->where('status',5); $query->limit(1); })->get(); }

Member Avatar for sunil_32
0
234
Member Avatar for pandglobal

I want to rewrite my URL from example.com/page/pipe?test to example.com/page/pipe/test My concept is just to remove the? at the end of the page and replace it with a / And I have written a rule to remove the .php extension of my files. below is what code looks like #REMOVE …

0
33
Member Avatar for fecapeluda

Hello guys i'm using [batflat](https://github.com/sruupl/batflat/blob/master/inc/core/lib/Image.php) for a small project. The thing is want to save/display webP images too, How can it enabled/possible?. I try **imagecreatefromwebp** without luck. Any idea/help will be awesome. Gracias! /** * Saves image * * @param string $path Path to location * @param string $type Filetype …

Member Avatar for AndreRet
0
234
Member Avatar for Martin_42

Hi all I'm trying to put together a room hire site, to be used by the lettings clerks, for our local Quaker meeting house and I've hit a couple of problems. I have an HTML form that, using data from a MySQL database and some JSON and JavaScript, when a …

Member Avatar for Martin_42
0
296
Member Avatar for garyjohnson

Hello I have a simple for and PHP that uploads multiple images to a file. The problem is I want these images to be resized when they are uploaded. Does anyone know of a simple way to resize these images with PHP? I am not a professional so further explaining …

Member Avatar for haree54
0
3K
Member Avatar for Kelvin_11

I am good in different languages, that is: Java, python, C#, VB.NET, php, javascript I have been programming for a while now it's about 2 and half years but the issue is when I focus on one language I tend to concentrate on it more than the others which leads …

Member Avatar for Mr.M
1
320

The End.