i m using auto suggest using Ajax Json .
now when a user select a user name , i want to send user on the link of that user name
my json data is coming in this way
{
query:'hel',
suggestions:["hello world","hell boy ","bac to hell"],
data:["2","26","34"]
}
now what i want that user goes to http://userProfile...
I'm currently writing a PHP script that 3rd party clients will be able to access using GET. It will take a few GET parameters and return an XML document with results.
My question is, if required GET parameters are left out or contain invalid data how should display errors back to the end user?
Should I return a completely different XML...
Hello,
What's the difference between those PHP if expressions!?
if ($var !== false)
{
// Do something!
}
if (false !== $var)
{
// Do something!
}
Some frameworks like Zend Framework uses the latest form while the traditional is the first.
Thanks in advance
...
Hi all,
I'm currently looking for a new e-commerce solution for a small to medium-sized webshops. By now I've narrowed it down to 3 competitors: OpenCart (http://www.opencart.com/), PrestaShop (http://www.prestashop.com/) and OXID eShop Community edition (http://www.oxid-esales.com/). I'm interested in pros and cons of the different sol...
.
try
{
$res = $db->exec($sql);
if ($res === FALSE)
{
print_r($db->errorInfo());
die();
}
}
catch(PDOException $e)
{
die($e->getCode().':'.$e->getMessage());
}
catch(Exception $e)
{
die($e->getCode().':'.$e->getMessage());
}
No error info, and neither does it get caught as an exception. Yet ...
I am very inexperienced with PHP and I've having trouble calling a mootools function.
Here's my code:
echo '<script language="JavaScript">';
echo "Sexy.error('Test!');";
echo '</script>';
When viewing source code looks like this:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Ba...
$sql = "SELECT * FROM table ORDER BY :sort :dir LIMIT :start, :results";
$stmt = $dbh->prepare($sql);
$stmt->execute(array(
'sort' => $_GET['sort'],
'dir' => $_GET['dir'],
'start' => $_GET['start'],
'results' => $_GET['results'],
)
);
I tried to use prepare to do the job,but $stmt->fetchAll(PDO::FETCH_...
When submitting forms on a wordpress page with multiple checkboxes, on the first submit, when I print_r($_POST), the checkbox array shows two items without their values. Occasionally it works.
Here's the code:
<form action="<?php echo htmlentities($_SERVER['REQUEST_URI']); ?>" id="assessment-form" method="post">
<ul>
<li>
...
I've been doing some pagination recently and used the following:
if ( $totalPages > $pagesToShow ) {
$start = $pageNumber - floor($pagesToShow/2);
$end = $pageNumber + floor($pagesToShow/2);
while ( $start < 1 ) {
$start++;
$end++;
}
while ( $end > $totalPages ) {
$start--;
$end--;
...
I am implementing OpenId login in a CakePHP application. At a certain point, I need to redirect to another action, while preserving the information about the OpenId identity, which is itself a URL (with GET parameters), for instance
https://www.google.com/accounts/o8/id?id=31g2iy321i3y1idh43q7tyYgdsjhd863Es
How do I pass this d...
Hi guys,
Whats the easiest method of hiding all buttons but not all inputs (say drop down lists, text input boxes) in CSS that works with IE6. The purpose of this CSS file is for printing (using the media="Print" tag in the HTML).
...
I have a form (greatly simplified):
<form action='http://example.com/' method='post' name='event_form'>
<input type='text' name='foo' value='3'/>
<input type='submit' name='event_submit' value='Edit'/>
</form>
And I have a class "EventForm" to process the form. The main method, process() looks like this:
public function process($...
How can I make a singleton of the PDO extention? Extending doesn't work, because I get a fatal error when I try it ...
...
I want to compare the performance of different PHP/Ajax frameworks. I'm not looking for tools to run the tests, I'm looking for what tests to run. I'm in the design phase of a project so I don't have an existing app.
I'd like to build the same page in several different frameworks and compare things like the generated client-side code ...
It is possible with php create a script, and this script insert an appointment in outlook calendar.
I search in internet but... I don't find a solution...
I use php but if it is possible with JavaScript is the same.
Thanks!
...
I am sending all the parameters needed to the SOAP server, but they require one of the params to be a decimal and one to be a datetime. I can't figure out how to convert a string to either type.
<?php
$params = array(
# this converts the string to an int
'int' => (int) '123',
# to datetime is a big ? to me
'day' => date("n/j/Y...
often i want to email some code without attaching a file, are there any gmail/google wave/gdocs plugins for code sharing?
gmail would obviously be most useful!
...
I'm new to php and mysql and I'm trying to learn how to store the following array data from three different arrays friend[], hair_type[], hair_color[] using MySQL and PHP an example would be nice. Thanks
Here is the HTML code.
<input type="text" name="friend[]" id="friend[]" />
<select id="hair_type[]" name="hair_type[]">
<option ...
Hello
I am using PHPSavant templating system for a project and I am not sure how to use ob_start in this.
I have tried before .. for example,
page_header.php
-- ob_start();
page_footer.php
-- ob_end_flush();
But because now I am using a templating system.. am not sure where to put these function.
$template = new Savant3();
$templ...
Trying to load an external php file into another onClick. Iframes will not work as the size of the content changes with collapsible panels. That leaves AJAX. I was given a piece of code
HTML
<a href="#" id="getData">Get data</a>
<div id="myContainer"></div>
JS
$('#getData').click(function(){
$.get('data.php', { section: 'mySection...