I'm trying to update the database library that we use at work to use parameterized queries so that coworkers who are not very knowledgeable about SQL injection won't have to remember to escape input and just pass in an array of parameters instead (I'm using pg_query_params).
However, I am running into a problem. One of the requirements ...
Hi all,
MY PLATFORM:
PHP & mySQL
MY SITUATION:
I am trying to implement transactions within my code. I tried to follow examples, but it's not much help. I am running 3 queries and I wanted to write a transaction in such a way so that if any of the query(ies) fail, the whole transaction should roll back. I would really appreciate a si...
Hi,
As our new web app gets more complicated, so the need for help docs increases. I am not talking about documenting code, I am literally talking about application help. So myapp/help, or for example, enabling context help from a particular point in the app with a link such as myapp/help/users/create/ etc.
Are there apps out there for...
We have a site that resides on server A with the URL eg www.blah.com, however when it is live it will be accessed at the url eg www.notblah.com which will proxy the request to server A.
My question is, in PHP how does one properly work out the host and URI when the request is passed via a proxy? $_SERVER['host'] and $_SERVER['uri'] give...
in php you could do like this:
$key1 = 1;
$key2 = 1;
$array[$key1][$key2] = 'hi';
in javascript i tried with this:
key1 = 1;
key2 = 1;
var array = new Array();
array[key1][key2] = 'hi';
but it didnt work. how can i do the same thing in javascript?
...
I need to create a 10 page quiz for a mobile browser. It is only a mobile webpage, so no considerations need to be taken for other browsers.
Here's the problem I'm having: I can't use JavaScript, because not every mobile browser supports it. I'm not very skilled in other languages, but I thought perhaps something could be done in PHP as...
What is wrong with this code:
$q = query("select * from users where email = '$_POST['email']' and name = '$_POST['name']'");
Parse error: parse error, expecting T_STRING' orT_VARIABLE' or `T_NUM_STRING' in C:\wamp\www\conn\index.php on line 16
Thanks in advance.
...
I'm trying to "faux-fork" a process (an email being sent via SMTP) in my web application, and the application is built on Kohana.
$command = 'test/email';
exec('php index.php '.$command.' > /dev/null/ &', $errors, $response);
I'm getting an error --
Notice: Undefined index: SERVER_NAME
When I look into Kohana's index.php f...
Running php 5.2.5 on Windows Server 2003 (64 bit) and connecting to SQL Server 2008
Having issues getting datetime fields from SQL Server using mssql_query. Any datetime field that I query returns nothing. All other fields in the query are correct, but the datetime fields are blank.
We switched from PEAR DB to mssql_ functions recentl...
I've setup an ecommerce site using Prestashop and when testing their contact form, I found that I was not receiving any messages if user enters Yahoo email address as the senders address. I have no problems, however, if the user enters a Gmail address.
Prestashop is set up currently to use the PHP Mail() function for the contact form...
I have been working on a content management system (nakid) and one of my toughest challenges is the file navigation. I want to make sure the file paths and settings work on local and remote servers. Right now my setup is pretty much something like this:
first.php (used by all pages):
//Set paths to nakid root
$core['dir_cur'] = dirname...
what is the sense of writing these lines of codes
header("Cache-Control: no-cache, must-revalidate");
header("Expires: May, 17 May 1983 05:00:00 GMT\n");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
and where we have to write these lines of codes?
on the page where we do databse dealing or just any php pages?
...
Hi ,
I am having a little problem how can I turn the following code into a whileloop , I know how to create a whileloop but working with the simpleXML code seems to throw me of course.
my code get me either the first or last attribute but I need all of them.
can any one help
<?php foreach (current($xml->xpath('/*/gig[last()]'))->a...
I'm working on a PHP form that attaches a file to an email, and trying to gracefully handle cases where the uploaded file is too large.
I've learned that there are two settings in php.ini that affect the maxiumum size of a file upload: upload_max_filesize and post_max_size.
If a file's size exceeds upload_max-filesize, PHP returns the...
How can i test a var if its empty or not?
i have this array
array($myname,$myhouse,$mywife);
how can i check each of them if it empty or not without using a loop?
...
Hi,
I'd like to give my users the option to not only fill in letters and numbers, but also "special" letters like the "á", "é" etc. Though I do not want them to be able to use symbols like "!", "@", "%" etc.
Is there a way to write a regex to accomplish this?
(preferably without specifying each special letter)
Now I have;
$reg = '/^[...
How could I detect which version of PHP my PHP script requires?
The general version like PHP5 or PHP4 could I know myself,
but there are some function which are added not in the minor relase.
...
How do i know that this is global or local environment for my php pages
means i m using Google map Key
there is two different key one for local server and another for that domain where it has to be shown, so how do i write the code for both keys together and page automaticaaly detect that which key have to be use
these things i als...
Hi,
I'm trying to use rewrite rules in my .htaccess to take user from an old link to a temporary new link (it's not a permanent new site, so I don't want a 301 redirect)
The following works for all the html pages and also the php pages without parameters, but it doesn't process the last example - a php page with parameters. Note that t...
Anyone has any idea about PHP Inertia framework? how do u evaluate it?Google didnt help me to find out it's manuel.
...