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...
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 '...
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 ...
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...
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?
...
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...
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...
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 ...
Hello There,
What can be the common PHP coding pitfalls which probably many of us are not avoiding?
...
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...
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...
Hello,
What exactly is late-static binding in PHP?
...
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
...
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 ...
I have a simple table:
describe chat_public_messageboard ;
+--------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+---------------+------+-----+---------+----------------+
| message_id | int(100) | NO | PRI...
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...
Hello all,
What exactly is the difference between an interface and abstract class?
...
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...
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...
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...