passing post data using cURL requires that the name of the input. However, I was wondering how can you do it if the input was not assigned a name?
curl -d "user=foobar&pass=12345&id=blablabla&ding=submit" http://www.formpost.com/getthis/post.cgi
...
I am trying to remove a directory with rmdir, but I received the 'Directory not empty' message, because it still has files in it.
What function can I use to remove a directory with all the files in it as well?
...
Using an adapted version of jquery.inplace.js for some page creation and use an OBDC connection in the background php file to query for content. Everything works, BUT...
I am surprised that IE6, 7, or 8 are all pretty quick, as is chrome, but firefox seems to take quite a few seconds for exactly the same task, in this case.
This is wit...
I have a search box on my site. If a student enters some text, the script must search for files with that type of name in a folder.
How to read folder and search for files?
...
I have a C executable (named myprogram). When I run it by ./myprogram I get some output statements on the standard output of my Linux shell.
I used run.php to get access to whatever is being printed to the standard output:
#run.php
<?php
$output = shell_exec('./myprogram');
echo $output;
?>
Then I called an HTTPService having id="ser...
I have start date and end date.
I need to find out the day that is Sunday or Monday etc dependent upon user click on check box.
How can I find/calculate that in PHP?
...
I've just started to use PHPUnit, but I've run into a bit of a snag.
My code uses $_SERVER['DOCUMENT_ROOT'] to compute paths for includes, which works when my apache server is the one running PHP, but DOCUMENT_ROOT is not set when I run phpunit from the command line with "phpunit Tests", so these includes don't work.
Am I missing somet...
Hi All, I developed a program on windows xp and I used exec to run a ".bat" file and it worked fine. I copied the exact program on windows 2003 and the bat file didn't run.
I used echo before the exec function and it seemed to work fine, I mean it echoed :
D:\xampp\htdocs\x>RunDLL32.EXE printui.dll,PrintUIEntry /y /n "HP LaserJet P2015 ...
Hello,
I have a question.
How could I get the data from a google search response?
I.e.:Results 1 - 100 of about 230,533,709 for blogs. (0.25 seconds)
I want to get the value 230,533,709.
I use php to get the html response from the url.
I.e.: http://blogsearch.google.com/blogsearch?hl=en&ie=UTF-8&q=blogs&btnG=Search+Blog...
header("Content-type: image/gif");
readfile($filename);
The above can only be used to show gif images.
Is there a header that can be used to show jpg/png/gif?
...
A function header looks like this
function doit($theparam){
//$theparam is untrimmed
$theparam = trim($theparam);
//$theparam is now trimmed
}
Is it possible to do the trimming on the first line itself? I tried those 2 but neither worked.
function doit( trim($theparam) ){
//access trimmed version
}
function doit( $thepara...
in PHP while using a form the details what we enter has to be stored in the database... is it like the data gets stored using any encoding scheme in the database...bcoz when i use a different language except English the storage shows some absurd codes in the DB...but when I retrieve the data..it comes as I had enetered in standard Englis...
I'm parsing a json feed routinely and need to insert only the newest users from the feed and ignore existing users.
I think what I need is ON DUPLICATE KEY UPDATE or INSERT IGNORE based on some searching but I'm not quite sure which is why I'm asking - so for example:
users
1 John
2 Bob
Partial JSON:
{ userid:1, name:'John' ...
Hi
I want to match strings like those below.
abc|q:1,f:2
cba|q:1,f:awd2,t:3awd,h:gr
I am using php and have tried both preg_match and preg_match_all with this expression.
/^([a-z]+)\|([a-z]+:[a-z0-9]+,?)+$/iU
This only returns the first part before the pipe, and one a:1. What am I doing wrong, why is it behaving this way and how c...
HI,
i need to order a list in PHP that looks like:
B1200
120A81
00A12
00A22
C100B
C100C
ordered list would be:
00A12
00A22
120A81
B1200
C100B
C100C
I was thinking about splitting each line in multidimensional arrays and order it but i am stuck and maybe theres a completely different way for that.
Thanks!
...
How can you sort the following word by the given rule?
Example data is saapas which I want to be either
aaapss
or in the array
s
a
a
p
a
s
and then somehow
a
a
a
p
s
s
The function arsort with sort_flags SORT_REQULAR and SORT_STRING did not work for me.
...
Hello There,
For a new project I need to load big XML files (200MB+) to a mySQL database. There are +- 20 feeds i need to match with that (not all fields are the same).
Now when i want to catch the XML I get this error:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 171296569 bytes) in E:\UsbWebserve...
I have .net code that need to be converted to PHP but I got value $bytearray[] in php need to do sha1 how to do that in PHP....
Pls help
...
I want to mimic the trim behavior of Photoshop (crop the area that is covered by the same color on all sides) with GD and PHP but I'm lacking ideas on how to accomplish this.
If someone has any idea on how to do this I would very much like to hear it.
Thanks in advance.
...
Why is the output of sqrt not an integer for "16" in PHP?
Example
php > $fig = 16;
php > $sq = sqrt($fig); //should be 4
php > echo $sq;
4
php > echo is_int($sq); // should give 1, but gives false
php >
I feel that the problem is in the internal presentation which PHP hides similarly as Python.
How can you then know when t...