php

How to implement check availability in hotel reservation system

I am developing website for my friend's very small resort, please see www.shivgangaresorts.com/dev This resort has 8 rooms in total and all rooms are of the same type, so every room is equally priced. I just need code or logic to check availability of given no. of rooms on given check-in and check-out dates. When somebody makes a rese...

Parsing basic textual output from php.

var req = function () { $.ajax({ url: "out.php", cache: false, success: function(html){ $("#stuff").empty().append(html); }, complete: function(){ req(); }...

How to use nuSOAP for messages with multiple namespaces

Hello, I'm trying to access a WebService using nuSOAP (because I'm bound to PHP4 here) that uses more than 1 namespace in a message. Is that possible? An example request message would look like this: <soapenv:Envelope ... xmlns:ns1="http://domain.tld/namespace1" xmlns:ns2="http://domain.tld/namespace2"&gt; <soapenv:Header/> <s...

PHP DB Passwords : Managing 'admin' and 'read-only' users.

Hey, I've read the "how-to-secure-database-passwords-in-php" which recommends keeping the password in a config file outside of the web root of the application, but what pattern should I use if i want to control "admin" and "read-only" users of my site. When an admin logs in i need to be able to load the admin config password file, and v...

UML tool for php

Can anyone suggest UML tool for php i.e if i import a file then it will produce its UML Duplicate: http://stackoverflow.com/questions/393603/php-uml-generator ...

Inner Join

$query4 = mysql_query("SELECT * FROM comments WHERE content_id = '$id' AND content = 'thread' INNER JOIN users ON comments.poster = users.id ORDER BY comments.date ASC"); while ($comment = mysql_fetch_array($query4)) { } all the tables and columns exist and i am connected to the database but it stil...

How to use one query for two tables representing a poll with question and multiple answers?

Hi, I have two tables poll and poll_answers, which represent a poll and the options to choose from to answer a question from the poll. EX: DO I suck at SQL? yes yes, you do change craft and the co-responding tables: poll pollID pollQuestion 1 | DO I suck at Sql? poll_answers pollAnswerID pollAnswerText pollID 1 | yes | 1 2 ...

MKDIR is not working correctly?

Hi, i'm using Xampp. When I tried to do this earlier, it worked, but now it is not working. I'm trying to make a directory in my www folder to hide it from baddies who steal files. Each user gets their own folder in uploads to put their files on. Xampp uses apache, and Xampp is a local web server. It allows me to design websites witho...

how to fit wide table on an a4 size paper?

hi i want to print a table of report on an a4 size paper , but only a part of table is getting printed , few columns are being left out ... can anybody please tell me what might be the problem, i tried to srink to fit but , it becomes too small to read ... ...

Viewing file information in PHP?

Hi, I have just made a file upload form, and so far I have it so that users can only upload their own .mp3's; Currently, all my form does is change the filename to $username . " - " . $title; in which the variables they enter; The form is still in beta, however, and I am asking if there is a way I can view the file information (for ....

How to Mix up C++ and php

Hi folks, I was wonder is it possible to write some C or C++ code and compile them and use them inside php ? or also is it possible to write php library using C and C++ ? If so,please tell how can I do so? (I think this ganna be useful for all php developers who don't know how to do it,becuase it's really needed in enterprise applicat...

Adding an echo with a string in PHP?

Hello, I have an echo = "000000" and a string named $id which is an integer. If $id is = 1, how do I add "000000" + $id to get 000001 ? ...

PHP fopen() Redirection Limit Reached Error

When executing the following block of code: foreach($eventfiles as $eventfile) { if($eventfile['filename']) { $file = $eventfile['filepath']; // Open File if( !($fp = fopen($file, "r"))) { echo '<br>CAN NOT READ FILE.'; exit; } // Read data from the file into $data $data = ""; wh...

What should you check for in HTML form text fields?

I'm writing a PHP script to grab text box data from a submitted form. These are simple text boxes and I don't want to accept any HTML tags. I think I should at least use strip_tags() and addslashes(). Anything else? I wouldn't mind restricting the input to alphanumerics, should I use a regular expression to seek out nonstandard characte...

php select function generates weird where clause

Hello I try to create a function to generate select functions. But the following code public function select($psTableName, $paFields ="",$paWhere=array()) { //initial return value $lbReturn = false; try { $lsQuery = "SELECT * FROM `"; $lsQuery .= $psTableName; $lsQuery .= "` "; if (!empty($paWhere)){ $lsQuery .= "WHERE...

How can I update a table to include an email when it is received using PHP?

I am trying to send an email from PHP using PHPmailer(). I have included the following syntax to display the content in a table. I need to update the table to display the email when the email is received. How can I accomplish this? $message ="<html><body> <table><tr><td>HELLO</td></tr></table></body></html>"; $body = ereg...

How to validate drop down menus in php??

Its like we have to insert the Date of Birth(which is a drop down box containing DD/MM/YYYY) in MySql by validating it..How can it be done? Thanks for the help. ...

Javascript/ajax/php question: sending from server to client works, sending from client to server fails.

Hey All, Sorry for reposting(Admins, please delete the other one!). since you guys have been a great help, I was kinda hoping that you could help me once again while having the following question: I am currently trying to work with AJAX by allowing a managerclass in PHP to communicate via an XmlHttpobject with the javascript on the clie...

Wordpress Digg-Like Voting System Plugin

I just found out about BuddyPress (a collection of plugins that convert a WordPress MU install into a social network) and now I was wondering if there are any Digg-like voting plugins for WordPress. This would eventually integrate into a BuddyPress website, where the site members would submit, vote and comment on stories (much like Digg...

objects and strings

Hello, I was trying to return a set of objects. But this code gives me the following error: Catchable fatal error: Object of class User could not be converted to string in ... public function fetchObject($psClassname ="",$paParams =array()){ $lrResource = $this->mrQueryResource; $liResult = null; while...