Similar Threads:
1.[PHP] PHP timeout doing fread from Apache Coyote
* Thus wrote Robert Fitzpatrick ( XXXX@XXXXX.COM ):
> I am trying to communicate with an API of a vendors of ours. They provide a
> Perl example that works fast and well. I am trying to do the same thing with
> a PHP class. The response takes over a minute before the response comes
> back. I see from the response text that the API is running on Apache
> Coyote/1.0. Does anyone know of issues with this match-up, here is the
> snippet of code that seems to be hanging. Using my Komodo debugger, it
> points to the line with 'while($data=fread($fp, 32768))' while waiting for
> execution to continue. Using a Perl script provided by them, I get a
> response in seconds. Basically, my PHP page prepares content and variables
> and then uses this class to send XML formatted content to receive a
> response.
>
> ...
> $fp=fsockopen($this->server, $this->port, &$this->errno,
> &$this->errstr, $this->timeout);
>
> if(!$fp) {
> $this->errstr="Cant Connect to Service ($this->server:$this->port,
> $this->errno, $this->errstr)";
> return;
> }
>
> if (!fputs($fp, $op, strlen($op))) {
which HTTP version are you requesting? I know that if you send a
HTTP/1.1 then a lot of servers send the data in chunks, thus your
retrieval code needs to be different. If it is HTTP/1.1 try using
HTTP/1.0 instead.
> $this->errstr="Write error";
> return;
> } else {
>
> $ipd = "";
> while($data=fread($fp, 32768)) {
Have you tried smaller requests mabey 512? although that shouldn't
matter, but you might be able to see if it is getting data back at
all.
> $ipd.=$data;
> }
HTH,
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
2.[PHP] REVISED: PHP timeout doing fread from Apache Coyote
3.can we embedd perl script and Html, like we r doing in php
4.Who here has done PHP shopping carts before?
I need a back-to-basics shopping cart tutorial in PHP/mySQL. I thought I
had it down and I failed, as usual. Here is what I mapped out as a spec:
3) initial work on bestilling.php to contain the following plan:
1) Cookie: 'nordicnet_bestilling' to contain unique, random 16-char string
2) Table: nnet_produkt_bestilling to contain ordering information bundled
by
unique bestilling_id (16-char string)
a) produkt_id
b) farge_id
c) storrelse_id
d) quantity ordered
e) bestilling_id
f) nordicnet_registration_number
3) *PROPOSAL* To make cookie a timed cookie - if user does not check out in
X hours
the cookie will be deleted
4) *PROPOSAL* CRON-based PHP script to systemically wipe out any stray rows
in
nnet_produkt_bestilling that have not yet been checked out
5) Idea plan for bestilling:
a) User will order produkt in vis_varegruppen.php
b) bestilling.php will do server-side checking of produkt, farge,
storrelse
and quantity based upon entry in nnet_produkt_farge_storrelse_assoc
c) bestilling.php will then check if $_COOKIE['nordicnet_bestilling']
already exists (meaning you have an order # - or, a cart ('bestill')
d) If you have a cart then check if there is already a row in
nnet_produkt_bestilling with same produkt_id/farge_id/storrelse_id with
your
matching bestilling_id
e) If so then increase quantity ordered by the quantity you ordered and
check
quantity totals against nnet_produkt_farge_storrelse_assoc
f) If NOT then add new row with produkt_id, farge_id, storrelse_id and
quantity with your bestilling_id and registration number
g) -- If you do NOT have a cart (no cookie) then generate a new cart
(bestilling)
id into a cookie
h) If other people ordered the same item be sure to check their quantities
ordered against yours and what is in stock before proceeding
So far this is what happens:
1) I enter products into the cart
2) If I delete items from the cart, they can be deleted; if I delete all
items from my cart, the cart cookie is deleted, I think.
3) I try to re-enter the same item into the cart, it inserts into the db w/
a NULL value for 'nnet_user_bestilling_id' which is
the cart id (which it's not supposed to do) and browser-side logic
fails, you get the wrong screen and all kinds of garbage I cannot even go
into because it's in Norwegian
I have tried for nearly 24 hours to build a cart and I can't seem to get it
done. I really need some help.
Phil
5.while php is doing its thing..
iv got a script that uploads 2 jpegs that the user defines..
which can get quite large.. avrage about 2 * 700kb images
so it can take a while.
i have a html form that posts the imagesto a php script.
i then go like this
$path = '/home/username/public_html/upload/';
$tempName1 = $_FILES['userFile1']['tmp_name'];
$realName1 = $_FILES['userFile1']['name'];
$path1 = $path.$realName1
if (move_uploaded_file($tempName1, $path1)){
// the above is repeated for image 2 but i cant be arsed to show
it
// rest of the page here
}else{
echo "could not move image";
}
this works fine but it can take ages for the page to be displayed..
is there any way i can display a page while the mages are being moved and
then update
to the actual page when that part of the script has run?
so i could have a "please wait. your images are being uploaded" and then it
would change to my content
when the script has run successfully
6. need small PHP job done
7. How should i done this in PHP?
8. help on integrating RSS in site done in php