I'm using a third-party API to send messages to users. But this third-party limits 30 calls per hour. I'm using PHP on linux.
What's the best way to implement this?
I'm passing a large dataset into a mysql table via php using insert commands and I'm wondering if its possible to insert approximately 1000 rows at a time via a query other than appending each value on the end of an mile long string and then executing it. I am using the codeigniter framework so its functions are also available to me.
How to know who is my ISP provider?
Is it possible to use php to track it?
EDIT:
if i use :
gethostbyaddr($_SERVER['REMOTE_ADDR']);
it returns my ip address, not my host name...
I want to cache the images of my gallery. Generating images every pages load using GD uses a lot of memory, So I am planning to create a cache image for the images generated by php script done with GD. What will be the best thing to create cache?
I am working on a form that adds employee information to a MySQL table and I need to attach a single photo to the file. This is part of a Content Management System and the users do not know how to resize photos, so I need to resize the image to a set size after it is uploaded. How can this be done with PHP? Please note, I am not trying to accomplish a thumbnail image, simply scale the one that is uploaded.
I'm using PHP and MySQL. Is this the best method to select information about "user_1" from four different tables? I know it works, because I have tried it. But is this the preferred method of selecting information from multiple tables for "user_1"?
$query = "SELECT table_1.username, table_2.city, table_3.state, table_4.country
FROM table_1
JOIN table_2
ON table_1.username=table_2.city
JOIN table_3
ON table_1.username=table_3.state
JOIN table_4
ON table_1.username=table_4.country
WHERE table_1.username = 'user_1'";
I am getting this warning whilst using Symfony 1.3.2 on Ubuntu 9.10:
HP Warning: Cookie values can not contain any of the following ',; \t\r\n\013\014' in /lib/vendor/symfony/symfony-1.3.2/lib/response/sfWebResponse.class.php on line 368
I am not sure why this warning is being issued, since I am not directly setting any cookies in my action/template.
Anyone knows what is causing this?
I have a simple commenting system here...
http://affbuzz.com/comments/7299a55137def55917a5dc6c4fe0f261af8a4217
...and people can submit hyperlinks inside the plain text field. When I display these records back from the database and into the web page, what RegExp in PHP can I use to convert these links into HTML-type anchor links?
Bonus: For the algorithm to not do this with any other kind of link, just http and https.
I have content that is given by an XML feed that does not include line breaks.
Is there away using PHP that I could include line breaks to show paragraphs?
Current:
content content content content content content content content content content content content content content content content content content content content.content content content content content content content content
Needed:
content content content content content content content content content content content content content content content content content content content content.
content content content content content content content content
I know the function count() of php,
but what's the function for counting how often a value appear in an array?
Example:
$array = array(
[0] => 'Test',
[1] => 'Tutorial',
[2] => 'Video',
[3] => 'Test',
[4] => 'Test'
);
Now I want to count how often "Test" appears.
Hi,
Does anyone know of a good function out there for filtering generic input from forms? Zend_Filter_input seems to require prior knowledge of the contents of the input and I'm concerned that using something like HTML Purifier will have a big performance impact.
What about something like : http://snipplr.com/view/1848/php--sacar-xss/
Many thanks for any input.
What are the best places for freelancers or small companies to get code reviewed for PHP and JavaScript? Forums are an option, but are there any sites dedicated specifically to code reviews?
Edit: Just for clarification, I'm looking more for a website to get the code critiqued by others than a tool that helps perform internal code reviews. I do appreciate the responses that offered a tool, though, and will keep those in mind for future use.
in PHP i used session and cookie not urlrewriting with PHPSESSID.
but when i opened cookie then i saw the key value pair.but one of them is
path : /
what does path mean,can you explain elaborately.
if i change the path value to /abc/cdddddddddd/efc then what does that mean?
What would cause a brief flash of white screen while a PHP page is loading? I just noticed it today on a WordPress theme that I am building and am wondering if this is a cause for concern. As a page loads, the screen will flash white before showing the page content. Sometimes this happens on every single page load, other times it only happens intermittently.
Right now I'm assigning HTML to a variable the usual way:
$var = <<<END
<blah>...</blah>
END;
The big disadvantage is that my IDE won't treat this as HTML, and so it won't highlight the code. Is there a way to do it that will keep the HTML outside of the <?php ?> tags so that code highlighting will work?
What is the best way to take a given PHP object and serialize it as XML? I am looking at simple_xml and I have used it to parse XML into objects, but it isn't clear to me how it works the other way around.
Is there any open source web client php application without popup server configuration ,
Am looking open source web client application ,
I dont want imap, pop3 or any protocol suppert application ,
Simply i want intra net message service applications ,
Thanks
Bharanikumar
Hi,
I'm running a CLI PHP script.
I'm requesting data from a server that only lets me in if my domain is www.mydomain.com.
It runs fine when I run through Apache, but when I run through CLI I presume my domain has now changed to the server IP, i.e. 84.123.123.123
The external server obviously rejects me now.
How can I request as if I'm www.mydomain.com using the CLI?
Using the example at the following URL: http://www.kavoir.com/2009/02/php-drop-down-list.html
How can I have that drop down menu pre-select one of the options such as 'Apple'?
I'm using JanRain's PHP OpenID library. It comes with example script which is using SReg extension. But I want it to work with Google (and it works for auth actually), but Google uses AX (attribute exchange) instead of SReg for additional data. For some reason, JanRain's library is missing AX support in example script, and code comments in AX script are out of my understanding, though comments in SReg script are clear as 1-2-3.
Does anyone know how to implement AX without too much pain?
I have a photo gallery and to have there url in there bottom. How can I do that in PHP? the location of file is in http://localhost/jordan pagaduan/user_images...
Related questions:
http://stackoverflow.com/questions/2653739/how-to-replace-characters-in-a-java-string
http://stackoverflow.com/questions/2393887/how-to-replace-special-characters-with-their-equivalent-such-as-a-for-a
As in the questions above, I'm looking for a reliable, robust way to reduce any unicode character to near-equivalent ASCII using PHP. I really want to avoid rolling my own look up table.
For example (stolen from 1st referenced question): Gracišce becomes Gracisce
What are the worst practices found in PHP code?
Some examples:
Use of $array[reference] without single quotes
Instance "hidden" variables into inclusion files, which are needed later
Lots of recursive inclusion not using "_once" functions
Note: maybe subjective or "fun" if you like.
Hi,
Not really a coding question more a little help with my idea of a Relational database.
If I have 3 tables in a SQL database. In my php script I basically query the companies which are in industry "a" and then insert a row into a seperate table with their details such as companyId , companyName etc is that a type of Relational database ?
I have explained it in a simple way so we don't get confused what I am trying to say.