php

Does a MySQL, PHP, JSON framework exist?

I'd like to query a MySQL database via a RESTful service with the middleware being PHP. I'd like the output to be JSON. I'm a beginner in those areas. Are there any frameworks or scripts that can do this without requiring you to be an expert? I don't have a problem stringing a few scripts together if they can work. Or, if it can be don...

Passing base64_encoded serialized data between form submissions

I'm creating a wizard-based series of forms for taking user inputs. One of the requirements for that wizard is that the script (PHP) cannot save the inputs into the database (MySQL) until the user clicks the 'Save' button, so I have to device a mechanism to transport user inputs in one form to another when the user clicks 'Previous' or '...

<br /> <b>Parse error</b>: syntax error, unexpected $end in <b>E:\xampp\htdocs\online\viewhistory.php</b> on line <b>43</b><br />

Below is the code of viewhistory.php. <?php foreach($_POST as $value){ if (empty($value)) { echo 1; exit(); } } //come code; //SQL query; while($row=mysql_fetch_assoc($result)) { //some code; if (!empty($reference)) { $referencetxt=<<<html | Referenced Solution ...

PHPIniDir broken under windows 7?

I had a server running on a windows xp machine using apache2 with php and mysql. I've recently upgraded to windows 7 and have been having trouble getting it to work. Apache works fine and php works, but I can't seem to get it to work with a php.ini file. When I set PHPIniDir to a directory with a php.ini file, the Apache service does NO...

PHP: Is there any particular difference between intval and (int)?

Hello, Is there any particular difference between intval and (int)? Example: $product_id = intval($_GET['pid']); $product_id = (int) $_GET['pid']; Is there any particular difference between above two lines of code? ...

Recommended PHP6 Books?

Just like the title says, what book(s) would you recommend for learning PHP6? I know my way around PHP5 pretty well, so I don't need a "beginner" book; just one that explains what's new and maybe some general PHP "best practices." PHP6 & MySQL 5 for Dynamic Web Sites looks ok. So does Professional PHP6 (although the one review worries...

How to center a div generated dynamically?

Hello There, I generate a div for my javascript automated validation script. It is generated with below code: var alertbox = document.createElement("div"); Now how do i center that div programatically both horizontally and vertically? Note: Currently I am showing an alert box but once i know how to center a div, i will replace the a...

Interview: Tricky Questions

Hello There, What tricky questions can you suggest to ask an interviewee about PHP? I suspect there can be much to be asked from micro-optimization tips and probably questions related to dealing with deep nested arrays. Let's suppose, we are looking for a good php developer. What can be the trickiest questions to ask him? Thanks for ...

Common PHP Coding Pitfalls

Hello There, What can be the common PHP coding pitfalls which probably many of us are not avoiding? ...

PHP Update table Inserts blank fields

UPDATE: I narrowed it down, when I got rid of this tag in the header.php file it all works, can someone please explain this. <script src="#" type="text/javascript"></script> Hi I'm having quite an annoying issue with my php code. I am trying to update a php database, from a form, when I do this however the fields in the data base beco...

deltified document revision control in PHP

If I have a PHP application which allows users to make changes to documents, what is the best way to implement revision tracking for each document? I want the storage of each revision to be deltified (i.e. only save the changes that were made) like svn and other SCMs do with code. I know on a very simple level how it works, but when I st...

What exactly is late-static binding in PHP?

Hello, What exactly is late-static binding in PHP? ...

PHP: Is ReflectionClass future-compatible?

Hello There, I have been using the cool reflection class in my framework. I wonder whether or not ReflectionClass is future-compatible? For example, in PHP5.3 or PHP6. Thanks ...

php simple xml element question/bug

Hey there, I have some xml, lets say <names number="12"></names> When I run the following: $simpleXMLElement = new SimpleXMLElement($xml); pr($simpleXMLElement); I get the following: SimpleXMLElement Object ( [@attributes] => Array ( [number] => 12 ) [0] => ) It throws in that 0 entry. This ...

Why does insert from php to mysql mis-handle question marks sometimes, but from command line never?

I have a simple table: describe chat_public_messageboard ; +--------------+---------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+---------------+------+-----+---------+----------------+ | message_id | int(100) | NO | PRI...

PHP calling and displaying CSS in different browser.

I'm having problem with CSS where, when I run on Mozilla Firefox the CSS is doing fine. But when I run inside Internet Explorer, the CSS is not working. When I try to change the code in the CSS file, it works otherwise. Mozilla is OK, but Internet Explorer is not. I have an idea calling 2 different CSS. For example, style_IE.css and sty...

PHP: What is the difference between an interface and abstract class?

Hello all, What exactly is the difference between an interface and abstract class? ...

What is this syntax in PHP?

I'm working on modifying a script to better suit my needs, and I came across this line in the code: return isset($_COOKIE[$parameter_name]) ? $_COOKIE[$parameter_name] : ""; I know that the function itself is essentially a cookie getter method, but I'm not quite sure what that syntax (i.e. the "?" and ":") means. I apologize if this i...

i want the cooment in sert in the upper not in the lowest

hi guys now i searched for comments system one of my friends suggest to me this Advanced PHP Comments System With jQuery and i download from his tutorial like Jooria-Comments-0.02.zip [5.17 KB] http://www.jooria. com/downloads/442/Jooria-Comments-0.02.zip its really nice but the only disadvantage is it add the insertedd comment in...

php installation script

Hi, I'm selling a php script which customers can install and run on their own sites. Currently the install process is a somewhat "standard" one...that is: 1. Check if your hosting covers the install requirements 2. Download a zip package 3. Unzip 4. Upload to server 5. Read install instructions 6. Create mysql DB 7. Set up folder permis...