php

Is Multiple Inheritance allowed at class level in PHP?

Is Multiple Inheritance allowed at class level in PHP? ...

PHP:Wrong Login info does not redirect to the specific page

<?php include 'lib/db_conn.php'; $uid=$_REQUEST['uid']; $pass=$_REQUEST['pass']; if(($uid==NULL && $pass==NULL) ||($uid==NULL) ||($pass==NULL)) { header("location:index.php?msg=Fields can't be left blank.."); } $pass=md5($pass); $sql1="SELECT * FROM `tb_user` WHERE `email`='$uid' AND `pass`='$pass'"; $rs1=mysql_query($sql1) or die (...

How to create a Dynamic Phonebook with Groups functionality

Hi... I want to create an online phone book where user can add as many contact as he want and he must be able to create and divide those contact into groups. For eg. Friends, Family etc. All the groups must be created or deleted by the user. Can anyone help me.. Any good tutorial or a book reference will do. I will be using PHP, MySQL ...

Doctrine_Record doesn't set PK in object after save()

Per documentation, Doctrine_Record after saving should set id of newly created record as object property. In my case, new record is created, but not value is set on object (while database has this new id value). What has caused this? $user1 = new ModelUsers(); $user1->save(); echo "last insert id=" . $user1->UserId; PS UserId is confi...

Recursion Problem in PHP

I need to create a valid xml from a given array(); My Method looks like this, protected function array2Xml($array) { $xml = ""; if(is_array($array)) { foreach($array as $key=>$value) { $xml .= "<$key>"; if(is_array($value)) { ...

php unexpected T_VARIABLE, little help here

Hey there. I've got the following code: class user { //URLs private static $signInURL = $_SERVER['DOCUMENT_ROOT'].'/?page=signin'; ... ... ... And i get and unexpected T_VARIABLE error. Can somebody tell me how to construct that url so it won't give me an error? ...

Lock web app only work for intranet

some week in the future i will have job to create php web app that will work as billing process. As the client and my team agree upon, the web app will only deploy in their internal server. This need arose some fundamental questions for myself. how do we lock the web app really really will work only in internal server and not in intern...

filter by multiple attributes

I have the table : id id_products id_atribut name value 1 13 8 autdio 2.1 2 13 9 hdd 200 Gb 3 13 10 cd-rom 2 4 20 8 audio 2.1 the problem is, how can i select from this table where name="audio" and value="2.1" and name="hdd"...

zipping file problem on the server PHP

Hi, here is my code; error_reporting(-1); require("zip_min.php"); $f = $_SERVER['DOCUMENT_ROOT'] ."/mp3/allmp3s.zip"; if (!file_exists($f)) { $zipfile = new zipfile(); $folder = $_SERVER['DOCUMENT_ROOT'] ."/mp3"; if (is_dir($folder)) { if($dir = opendir ($folder)) { while (false !== ($file = readdir($dir))) { i...

Turn value from SQL into PHP

Let's say I have saved this kind of data (some text '.date(d).' some text) to SQL (with htmlspecialchars()). Now, if I restore htmlspecialchars, is there a way for me to have PHP fill in the date? Basically I guess what I'm asking is, is there way to turn text into php string? ...

PHP Jquery DropDownSelectList Multiple Variables with same name

Hi I am using the Select->DropDownCheckList from http://dropdown-check-list.googlecode.com/svn/trunk/src/demo.html... with a PHP back end... This checklist submits (on form post) each selection as an individual variable, so for example: brand=Apple brand=Microsoft brand=Google And when doing $_POST["brand"] in php I only get 1 of the...

Attendance Management System

Hi Friends, I am looking for an open source Attendence Management System, I'd like to be able to customise functions. Please recommend some written in PHP. I am running BPO with around 20 employees. I want to track their daily check-in and check-out time. Thanks Bharanikumar ...

Approaches to timing out sessions on a web app using AJAX autorefreshes

I'm writing a web application that autorefreshes data with an AJAX call at set intervals. Because it's doing that, server side user sessions never time out, since the last activity is refreshed with every ajax call. Are there good client side rules I could implement to time out the user? I.e. should I track mouse movements in the brow...

Is file_get_contents multi line?

Hello all, Does file_get_contents maintain line breaks? I thought it did but I have tried this: if($conn){ $tsql = file_get_contents('scripts/CreateTables/SLR05_MATCH_CREATETABLES.sql'); $row = sqlsrv_query($conn, $tsql); print_r(sqlsrv_errors()); } The errors I get is that SQL Server complains that there is incorrect...

Invalid XML Replace Content in PHP

I have a invalid XML like this Warning: count() [function.count]: Node no longer exists in /var/bla/test.php <?xml version="1.0" encoding="ISO-8859-1"?> <nodes> <some>test</some> </nodes> Now i need a regex which would replace the Warning: count() [function.count]: Node no longer exists in /var/bla/test.php with "" how can i do that? ...

Is there any way to print the actual query that mysqli->execute() makes?

I have a complex query that gets executed like this: if ($stmt = $dbi->prepare($pt_query)) { $stmt->bind_param('ssssssssi', $snome,$scognome,$ssocieta,$svia,$slocalita,$sprovincia,$scap,$stelefono,$sfax,$uid); $stmt->execute(); echo $dbi->error; $stmt->close(); } else { printf("...

Convert tax like IRS function to SQL

Trying to convert this tax-like IRS function http://stackoverflow.com/questions/1817920/calculating-revenue-share-at-different-tiers to SQL. The assumption is the table would be one column (price) and the tiers will be added dynamically. My first attempt has some case statements that didn't work out well. I have since scrapped it :) Tha...

Screenshot of page, or getting unchanged image

Hi there! I need to get image from page, without reloading it, and without getting it's source. I read about "SimpleTest" scriptable browser, but i don't know can it save site image. Any ideas? Thanks ...

PHP get external page content

hi, i get the html from another site with file_get_contens, my question is how can i get a specific tag value? let's say i have: <div id="global"><p class="paragraph">1800</p></div> how can i get paragraph's value? thanks ...

Design Practice Retrieve Multiple Users - PHP

Greetings all, I'm looking for a more efficient way to grab multiple users without too much code redundancy. I have a Users class, (here's a highly condensed representation) Class Users { function __construct() { ... ... } public static function getNew($id) { // This is all only example code $sql = "SEL...