I am trying to perform a simple jQuery AJAX attempt using either a .get() or a .post().
If I have a local copy on my server and do:
$.get('/hash.php',...,...)
I monitor in my console in firebug that the get is done and I get a response.
All I change is the URI to an outside server and nothing happens.
$.get('https://secure.mysite.c...
Here is the JQuery:
$(document).ready(function() {
$('#autosave').click(function() {
var url = window.location.pathname;
$postData = $('#content form:first').serialize() + '&'
+ $('#content form:first .input-submit').attr('name')
+ '=Save';
$.post(url, $postData, functi...
Quite simple really, in a php/mysql set up, I have to run around 2M point updates on 25M items (where one update covers multiple primary keys), is there a way to pull this off with the same sort of gains as extended inserts?
I'm using unbuffered queries already. Its slow.
NB: Searching came up with nothing, this is on a dev environment...
Hello all, and thanks in advance for the help.
Background -
I am writing a PHP script that needs to figure out the destination the caller is trying to reach. Telephony prefixes are strings that identify a destination. For each call, the program must find the longest prefix that matches the string. For example the number 30561234567 wou...
Hi guys,
I am writing a small PHP application and I am not sure whether I have a security issue. So this is what the application does:
the user can upload either image files (png, gif, jpg, jpeg, tiff and a few others) or zip files
I check for mime-type and extension and if it's not an allowed I don't allow the upload (this is not th...
I have a table, which consists of 3 fields:
id
name
status
Every time I get the results, it should give me 5 names whose status = 1.
Suppose the db contains following:
id name status
1 A 1
2 B 1
3 C 0
4 D 1
5 E 0
6 F 0
7 H 1
8 I 1
9 J 1
10 K 1
11 L 1
12 M 0
1st time, fetch ...
http://www.php.net/manual/en/features.remote-files.php
The only time I could ever think of doing include("http://someotherserver/foo.php") would be as some sort of weird intra-server service interface, but even then I could think of a million different ways that were safer to accomplish the same thing. Still, my specific question is, ...
I have a pretty large site, and I am looking for the most time efficient way to manage it (I am the sole coder).
I am trying to devise a very simple MVC structure (i don't want to use a framework) to help keep all my code in order.
For a huge site, is it better to have only one controller to handle all the pages, or is it better and ea...
I'm creating a script that makes use of the $GLOBALS variable quite a lot. Is there too much you can put into a variable?
If I have a lot of information stored in $GLOBAL variable when the page loads, is this going to slow down the site much or not really?
Is there a limit to how much information one should store in a variable? How doe...
I'm trying to update a div with an ajax post. Problem is...it's updating every div.
Here's the json.php:
//json.php
$data['months'] = $db->escape_value($_POST['check']);
$data['id'] = $db->escape_value($_POST['hidden']);
$query = "UPDATE month SET months = '{$data['months']}' WHERE monthID = '{$data['id']}'";
$result = $db->query($...
Hi everyone,
My swift mailer plugin has just thrown up an error because an email address it tried to send to isn't compliant. Problem is - the email is valid.
Basically, I don't want swift mailer to be checking whether or not the email is valid I'd like it send regardless. Is that possible?
here is the code which has the function whic...
I have a table that hows the following rows...
ID | TITLE | ARTIST | ADDED | HITS | HITS THIS WEEK
--------------------------------------------------------------------------------
7505 | Track 2 | Artist 1 | 2009-08-24 10:32:41 | 1539 | 2
7483 | Track 2 | Artist 1 | 2009-08-23 16:58:35 | 1450...
Hello, I am trying to create an email form that allows you to send an attachment. I have pieced code together from my PHP book and several websites.
When I send the email using this form the attachment ends up corrupted and the "$comments" don't seem to go through.
Here is the code I am using:
<?php
$to = $_POST['to'];
$from = $_POST[...
I'd like to call system("foo") in PHP but also specify environment variables that "foo" will have access to when it runs. This is under Linux.
Any simple trick for that?
...
I have a set of custom PHP scripts. They load a main PHP file (to include other files, set settings, etc.) From this script I'd like to insert a callback function that is called by the scripts that included the main file just before ending.
What I intend to do is make a simple custom output cache with ob_get_contents(). I want to do ob_...
Hi all,
How to find the Birthday of FRIENDS Who are celebrating today using PHP and MYSQL
thanks in Advance...
Fero
...
I am hosting a client's site while they are running an exchange server at their location to handle the email. Whenever I try to send email via PHP to one of their email addresses it fails as it is looking for the address on the local system.
Can I force the mail function to look outside of the server for sending mail?
I'm on a Media T...
I'm now dealing with uri like /page.html?k1=1&k2=2
$str = preg_replace('/[&\?]' . $k . '=[^&]*/',"",$str);
The above aims to delete $k related part in uri,but will also delete ? wrongly.
How to do the right thing?
...
Hello all,
I'm looking for some help and direction on how I can pull an image from a URL (these are my own images) and move/upload the image to my Amazon S3 bucket, using PHP.
For example, let's say the image I need is:
http://myhost.com/image.jpg
I would like to be able to move this image (image.jpg) to my S3 server.
Any ideas on...
I am contemplating between three frameworks: Django, CakePHP and Zend. The project will include social aspect (members), will have a cart/checkout, lots of different forms and very heavy database usage. I would like to write most of my sql by myself but have only basic knowledge of web development. Both PHP and Python will be new languag...