No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
11 Posted Topics
Hi all this is my index page it works fine but the only porblem is that when user close the tab without logging out then login.php page displayed with menu obove.i want to expire the session if user close the tab help me out please <?php session_start(); if(!isset($_SESSION['_LOGIN'])) { $_SESSION['_LOGIN'] … | |
<?php include 'inc/db.php'; function dateDiff($start, $end) { $start_ts = strtotime($start); $end_ts = strtotime($end); $diff = $end_ts - $start_ts; return floor($diff / 86400); } $q ="SELECT * FROM date"; $p=mysql_query($q); while ($res=mysql_fetch_array($p)) { $start =$res['sdate']; } $qc ="SELECT * FROM accounts"; $pc=mysql_query($qc); while ($r=mysql_fetch_array($pc)) { $elecend=$r['elec_contract_edate']; $gasend=$r['gas_contract_edate']; $elecshow =dateDiff( $start,$elecend ); … ![]() | |
Warning: Invalid argument supplied for foreach() in /opt/lampp/htdocs/pbook/inc/login.in.php on line 12 <?php include 'contacts.php'; if($_SERVER['REQUEST_METHOD']=='POST'&& $_POST['submit']=='Login') { $lname = isset($_POST['lname']) ? trim($_POST['lname']):NULL; $lpwd = isset($_POST['lpwd']) ? trim($_POST['lpwd']):NULL; if(($lname!=NULL)&&($lpwd!=NULL)) { $lobj=new DB_Action(); $l=$lobj->disp("Select * From members where memname= '$lname'and mempass='$lpwd'"); foreach ($l as $result) { $aid =$result['memid']; $_SESSION['_ENTER'] =1; header("location:address-book.php?l=$aid"); exit; … ![]() | |
<?php class contacts { public $name; public $cno; public $clocation; public function __construct($name,$cno,$clocation) { $this->name = trim($name); $this->cno = trim($cno); $this->clocation= trim($clocation); } public function getName() { return $this->name; } public function getNO() { return $this->cno; } public function getLocation() { return $this->clocation; } } class DataBaseAction extends contacts { … ![]() | |
this is my contacts class <?php class contacts { private $name; private $cno; private $clocation; public function __construct($name,$cno,$clocation) { $this->name = trim($name); $this->cno =trim($cno); $this->clocation=trim($clocation); } public function getName() { return $this->name; } public function getNO() { return $this->cno; } public function getLocation() { return $this->clocation; } } class DataBaseAction … | |
$accname =$_POST['uaccountname']; $aid =$_POST['aid']; if($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['submit'] =='update account') { $qry = "UPDATE accounts SET acc_name = $accname WHERE acc_id =$aid"; mysql_query($qry) or die(mysql_error()); } it gives folling error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for … ![]() | |
i having these two annoying errors plz help me out how to fix these. Warning: array_push() expects parameter 1 to be array, boolean given in D:\xampp\htdocs\simple_blog\inc\functions.inc.php on line 31 Warning: array_pop() expects parameter 1 to be array, boolean given in D:\xampp\htdocs\simple_blog\index.php on line 20 <?php include_once 'inc/functions.inc.php'; include_once 'inc/db.inc.php'; $db … | |
$e = retrieveEntries($db,$id); i m passing db connection and entry id to function and function returning mein one when i check with print_r $e is not returning please help me out here is the function function retrieveEntries($db,$id=NULL) { if(isset($id)) { $sql ="SELECT title,entry FROM entries WHERE id =? LIMIT =1"; … | |
i have been using this code in creating blog i'm getting this error on exectute(array($title,$entry); line the error is Notice: Undefined variable: title in D:\xampp\htdocs\simple_blog\inc\update.inc.php on line 14 Notice: Undefined variable: entry in D:\xampp\htdocs\simple_blog\inc\update.inc.php on line 14 can any one please help me out. <?php if($_SERVER['REQUEST_METHOD']=='POST' && $_POST['submit'] =='Save Entry' … | |
I have been inserting the file path in to data base but it s giving a mysql syantax error can any pne fix it <?php include 'db.php'; if($_SERVER['REQUEST_METHOD']=='POST') { if(isset($_FILES['photo'])&& is_uploaded_file($_FILES['photo']['tmp_name']) && $_FILES['photo']['error']==UPLOAD_ERR_OK) { if($_FILES['photo']['type']=='image/jpeg') { $tmp_img = $_FILES['photo']['tmp_name']; $path = "d:/xampp/htdocs/upload/images/" .$_FILES['photo']['name']; move_uploaded_file($_FILES['photo']['tmp_name'], $path); $imgname=$_FILES['photo']['name']; $q="Insert INTO image (name,imgpath) … | |
<?php function autogen() { $qr="Select * from autogen where gid = 1"; $we=mysql_query($qr)or die(mysql_error()); while($brec=mysql_fetch_array($we)) { $ln=$brec['autoln']; } $lw= ++$ln; return $lw; } $newlead=autogen(); $qry="Select * from leads"; $r=mysql_query($qry) or die(mysql_error()); while($re=mysql_fetch_array($r)) { if($rec['leadno']==$newlead) { ++$newlead; } } $er="UPDATE autogen SET autoln='$newlead'WHERE gid =1"; $bn=mysql_query($er)or die(mysql_error()); ?> This Code generates … |
The End.