Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Launching Several CURL Posts Without Waiting To Download Pages..


Hy there, ok, i`ll get to the problem:

My php script has a function named curl(some curl options and instructions), it doesn`t matter that, what it matters:

$var1 = curl("http://www.somedomain.com/somepage1.php");
$var2 = curl("http://www.somedomain.com/somepage2.php");
$var3 = curl("http://www.somedomain.com/somepage3.php");
$var4 = curl("http://www.somedomain.com/somepage4.php");

Ok, so it downloades the content of somepage_.php to the $vars, however somepage_s_.php contains several scripts which takes a verry long time for the page to download, so my script waits for each page to download, one by one, as line by line, what i would like do rezolve is to start the curl without waiting to download the first page, then the second and so on, it should start the download of all the pages at almoust the same time. That would be all, please help, i`ve lost 4 nights trying to get this fixed but no luck.




View Complete Forum Thread with Replies

Related Forum Messages:
Getting Download Progress Using Curl
is there a way i can get the download progress in cURL. i dont want to use the cURL progress bar.

View Replies !
Getting Pages With Curl
I've been using a really basic implementation of cURL to get some remote pages I use to generate some of my pages, I was wondering if it would be possible to get some that were in a password protected members area too.

The password entry box is one of the ones that pops up as a dialogue box in windows as opposed to entering it on a page. Let me know if you have any more questions, I know that was a particularly poor description.

View Replies !
Image File Download Using CURL
I need to copy an image file (e.g. a ,jpg) from an http: address to my
web server using PHP. I have been trying to get CURL to work, but for
reasons that aren't clear to me, I can't get it to work properly.

The code I'm trying to use is ($source and $dest are passed in):

$ch = curl_init(rawurlencode($source));
$fp = fopen($dest, "w");

curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);

curl_exec($ch);

$isok = true;
$errno = curl_errno($ch);
if ($errno != 0)
{
echo "CURL: ".$errno;
$isok = false;
}

curl_close($ch);
fclose($fp);

I keep getting error 28 (timeout). But if I put the web address of
$source right into my browser, up pops the image (instantly).

Does anybody a) see anything wrong with the above, and/or b) know of
another alternative to CURL to get the job done?

View Replies !
Curl Download Image File
I am trying to download image files from another server (about 2000 of them). I am using a mysql database to retrieve the file name/location. the below code works fine but it has the file name hard coded into it.

<?php
        $a=0;
        $timevalue = substr(time(),3,11);
$photoname = $timevalue.$a.'.jpg';
$ch = curl_init("http://www.somedomain.com/images/some%20folder/some%20image%20file.jpg");
$fp = fopen($photoname, "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
?>

but when trying to get the file name from the database it does not work

<?php
$a=0;
while($row = mysql_fetch_array($result)){
$timevalue = substr(time(),3,11);
$photoname = $timevalue.$a.'.jpg';
$ch = curl_init($row['imagefile']);
$fp = fopen($photoname, "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
$a++;
}
?>

anyideas why it will not work?

the $row['imagefile'] is the exact link to the file on the remote server

View Replies !
Curl Receiving Different Pages
I'm using a simple php+curl script to fetch a users feedback profile from
eBay...

for example from the following url:

http://feedback.ebay.ca/ws1/eBayISA...d=parkers9-half

and the script will then take the page and strip out the relevant data
(name, date, comments, etc), using regular expressions.

I wrote the script on my local machine (xp + apache 2) and tested it out,
and its working fine. However when I upload the exact same script to my
off-site linux machine, it wouldn't work anymore.

And then i discovered that it wasnt able to strip out the data because ebay
is sending a slightly different page to the linux machine than it is to my
machine, even though they are both using the exact same script. The page
looks identical at first... but little tiny things are different, for
example in the one sent to the linux machine, certain image attributes like
'height' are not sent.

Does anyone know why this could be, and how I could trick ebay into sending
the same page to the linux machine?

View Replies !
CURL And Loading Pages
I'm working on a program the goes out to a website and pulls down some
data using cURL. The page I'm pulling from has a loading screen
before the data I want is displayed. The code I have so far is
grabing this loading page instead of the fullly loaded page. Is there
anything I can do? Below is the code I have so far.

$ch= curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER,0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL,$url);
$result = curl_exec($ch);

View Replies !
Anyone Know How To Create Automatic Download Using CURL And Creating A New Folder Every Day???
I want to save a zip file daily. The file is named the same thing
each day so I would like to create a folder and name it with today's
date and then save the zip file into that folder.

I'm using this code and can't seem to figure out how to create the new
folder and save the file there.
Any help is appreciated!

$todays_date = date("Ymd");

$fp = fopen (dirname(__FILE__) . '/file.zip', 'w+');//This is the file
where we save the information
$ch = curl_init('http://www.downloadhere.com/file.zip');//Here is the
file we are downloading
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
curl_setopt($ch, CURLOPT_FILE, $fp);

So each day I should have something like 20070807file.zip.

View Replies !
Curl - Resume Http Download - Apache Log Files. Gz
I am writing a Php script to run on my home PC (Windows) that downloads an Apache access log file and inserts new entries into a database.. The only way I can access these log files is through a cPanel URL that delivers a gzipped copy of the log file with all entires for the current month (up to the current date and time).

I want to run this script once a day (at night) and would like to download the gzipped file by resuming from where I left off the day before (instead of always downloading the entire gzipped file).

I have tried using CURL with the option - curl_setopt($ch, CURLOPT_RESUME_FROM, $prev_offset) - but that always restarts the download from the beginning. ($prev_offset is the previous days file size).

I'm not sure what the structure of a gzip file is, so I don't even know if it is possible to resume a gzip file download when the file has been rebuilt in the mean time (cPanel creates a gzipped file with the same name from the raw log files every time you access that page in cPanel). My guess is that this is probably not possible. ... But .... I am trying to make the resume work to find out for myself and I can not make
the resume work.

The bottom line is that I am trying to avoid downloading the entire gzipped log file every time I need to download it.

As an alternate, I have been successful using gzopen, and then I can gzseek to the previous offset, but I am unable to use a secure URL (https) with the Zlib functions (gzopen) with my Windows version of Php (the username and password have to be included in the cPanel URL to access the log file, so I'd like to use SSL.)

(I have started another thread to figure out how to get a Php Windows binary with https and ftps as registered streams (built with --with-openssl in the ./configure command), but so far I have gotten no replies).

Question: When using gzread, where does the decompression take place - on the server where the file is located, or on my PC after the compressed data is downloaded? Does gzseek work on a compressed file, or must it be uncompressed on the server first? The point being; when I use gzopen and gzread, am I downloading compressed or uncompressed data from the server where the log files are located?

I can use either method, but want to meet two requirements.

1. I do not want to download redundant (old) data every day (I want to resume where I left off) ... and ...

2. I want to send the request for the log file (containing a username and password) using SSL.

View Replies !
Parse Multiple Pages With Curl Session
I'm having trouble parsing multiple pages in a curl session..

I am using curl to parse a page that requires a cookie, I can do that fine and store the information that I need using
$result=curl_exec($ch);

and then parsing $result

after doing that, I want to go to another page and parse that one, I change the variable $url and then use

curl_setopt($ch, CURLOPT_URL,$url); 
$result=curl_exec($ch);

but $result is the same page as the first one :-(

why am I getting the same contents for $result?

View Replies !
Script Pages To Download Fast
I have created personal blog using php and mysql every thing seems fine except my pages take more then 15 seconds to appear. any idea about how I can make pages to appear less then 5 seconds or less.

View Replies !
How To Make Web Site Or Pages Not Possible To Download?
I need help how to do professional code to make secure web site from download. How to do it with PHP and professional. Is there any software to do this best as possible?

View Replies !
Waiting For Completion
I have written a little php script which creates a jpeg image based on MySql data (a pie chart). Calculations usually take up to 15 seconds and during that time the place where the picture will be in is shown as a broken link.

Can anyone tell me how to change this to show some 'Wait while loading...' message before showing the completed picture?

View Replies !
Executable Without Waiting
i want to run a backup of data and this may time a few minutes. is there any way of starting this task and not wait for it to end?

c:"program files"7-zip7z.exe a -tzip backup.zip datafile.dat -psecret


View Replies !
Waiting List
how i can create a waiting list? For example a user signs up, and then clicks the 'join' link. He gets put into a waiting list and updates are done every few days to let in new users.

View Replies !
Launching A URL
When I am executing a PHP routine, I would like to start a page on
a server. Could be also interesting to receive back the answer so
I can use it contents in my program.

In other words as a sample when I am at some point of execution of
a my PHP routine I would like to send to the network:

http://www.someserver.com/somefunction.php?&user=$auser

Eventually I would like to receive in some way the answer page from
the server.

It's possible to do this?

View Replies !
How Do You Do No New Posts/new Posts Function
On forums you have the little image at the side.  Usually one is faded which means no new posts and the other is the same image but darker which means new posts.

How do you go about logging when people have looked in a forum. Surely you can't have a table with an activity time for every forum as this would be imense.

View Replies !
Programmed Waiting In A Script?
In a script i would like to send many emails. So after sending a email i would like to wait a second then sending the next email. Now my problem is that i know the function how tell's the script to waiting a defined time.

View Replies !
Sending Mail Without Waiting
While using mail(), the php engine is waiting for the mail to be delivered and then proceeding to next step. Is there any way to skip this "waiting",
i.e. just send the mail, and dont wait for response and proceed to next
step?

View Replies !
Launching Application
I developed an internal website (hosted in a company server), which contains a few php scripts (forms users fill out and e-mail to others upon send). I have an e-mail instruction in the scripts, with a list of e-mail addresses. I would like to change this so users can launch Lotus Notes from the script upon sending, and choose to who send the form (instead of having fixed e-mails in the script). The company has given me the path where the .exe program resides on the server.

View Replies !
External Processes Without Waiting For Return
In php how do I call an external script or program without having php
waiting for the return?

exec and system both seem to wait for the return, I don't want this.

View Replies !
Pause Code While Waiting For More Inputs
I was wondering if its possible to insert a while loop to wait while I get some form input from another window before proceeding PHP Code:

View Replies !
Launching Second Script When First One Finishes
I have numerous PHP scripts that connect to our Oracle database and export csv files. The amount of time it takes for each script to finish varies. Sometimes it takes 10 minutes, sometimes 30 seconds. I would like to figure out a way to have the first script run and when it finishes, launch the second script and so on and so on.

View Replies !
Launching Files Locally
I have PHP and Apache installed on a windows box that is attached to
my home theater. I wrote some code that indexes the contents of a
directory that has some video clips etc in it, and the outputted HMTL
is nothing more than a series of hyperlinks to these files, with some
CSS to liven it up a bit.

The problem is this: when I click on one of the links, rather than
launch the file, it attempts to "download" it (even though the file
resides right there on the machine anyway). In my hyperlinks, I
specified to use the "file:" protocol instead of HTTP. I really just
want it to launch the file.

View Replies !
Launching PHP From HTML Form
i build an app using PHP/MySQL/web. the APP and PHP programm are both located on the CD.

step 1:
i want it to a first interface (installation phase) to be an HTML page.

step 2:
I want it to get some informations for the installation

step 3:
i want the form to launch a PHP page (on the CD) and using the PHP.exe (on the CD)

step 4:
the PHP page send my modules using FTP

step 5:
once the FTP transfert is finished, the PHP page open a new page (that has been just uploaded) on the web server.

my problem is in step 3, how is it possible to launch a PHP script from an HTML page which is not on a web server??

I can do it easily with a SHELL script but i prefer the graphic interface of an HTML form. I know it is either possible using GTK but i don't want to use it because i'm not surre the client has a JVM.

View Replies !
Launching Community Site
I'm creating a community website, and I want the following features:

- members are able to write reviews
- members are able to post classified ads (I'd like to be able to charge money for this)
- ability in the future to create groups within the community.

Can anyone suggest a content management system (CMS) or other off-the-shelf solution? Drupal springs to mind, but then I don't have a lot of experience with these kinds of builds, so I may be missing something that is out there.

View Replies !
Launching A Background Script From Php In Windows/IIS
I'm trying to build a PHP page which launches another php script to be run
in the background. The web page should return immediately, while the
background script may run for 10 minutes or something. Unfortunately I'm
getting all kinds of weird behaviour..

In my main script I'm using exec() (also tried the other options) to start a
..bat file. This actually works, the batch file is launched and is able to
write something to disk.. Now if I put the following line in the batch file:

c:phpphp.exe -q backgroundscript.php

then instantly I'm seeing about 30 php.exe processes being created, but
nothing seems to be happening really. The processes seem to be dying
immediately and replaced by new ones. So apparently php is trying something
but fails and tries again.

Both the script and the batch file work fine from the command line. Group
'Everyone' has read/execute rights for the batch file, the php script and
php.exe. I have tried prefixing the command with START /b or cmd.exe /c but
neither seem to make any difference. Also I tried redirecting stderr, stdout
and stdin to NUL

Server is Win2k, IIS5, php4.3.0. Searched the php docs, tried suggestions
but it doesn't work, maybe because they use Apache.

My guess is that the anonymous user IUSR_* doesn't have the rights to do
something, but I can't figure out what.

View Replies !
Launching An Application: Does PHP Limit Network Connections?
I am having a problem using PHP to launch an application on the server.
All the basics work, but I cannot launch more than 4 instances of the
application. This application functions as a server itself, and I
specify the port number when I launch it, so my theory is that I am
reaching some limit on network connections.

This is my basic launch sequence:

<?php
$command = 'c:Program Files (x86)myprogmyprogram.exe'
$arguments = ' /Port:' . $port;
exec('C:PsToolspsexec.exe -accepteula -d -s "' . $command . '" ' .
$arguments . ' 2>&1', $output);
?>

Note that I am using psexec because I need to keep track of the process
ID number and kill the application when a user logs out. I can provide
more details if needed, but if there is indeed some upper limit on port
connections, that would certainly explain what I'm seeing.

Incidentally, if I try this same procedure launching "Internet
Explorer", my limit is 9 (instead of 4). If I launch a non-network
application, it seems that I can launch as many as I want without limit.

Note: I am using Windows XP Professional x64 Edition SP1

View Replies !
Launching A Program With Exec & Pstools/psexec.exe
I am trying to launch a program with PHP code. I am running Apache on Windows XP SP2. Code:

View Replies !
CURL Problem.. Comparing Output From IE/CURL Differs
I'm writing a tiny php app that will log into our bank of america
account and retrieve a file containing a list of checks that cleared
the previous day. The problem I'm running into is when I perform
actions with php/CURL the output is different than when I use IE and
I'm completely stumped as to why. The final output should list files
available for retrieval but the CURL output displays an error/empty
file message.

Here is the curl portion of my code:

View Replies !
Mass Mailing Script/waiting For Script To Finish.
I have built a newsletter/mass mailing system that loads templates, supports multiple newsletters and mailing lists, etc. The problem I have is this:

I start a query loop which pulls the persons name and email address from a mysql database, populates the template for that newsletter then sends the message using the phpmailer class. The script takes ages (hours) to execute when your sending to 10,000+ people and so the window has to stay open till the script finishes. Is there a way to start this process running and continue script execution without having to wait for all the messages to go before finishing script execution?

View Replies !
Download Files From My Site Via A Download Page And Id Variable
i want users to be able to download files from my site via a download page and id variable
eg.. download.php?file_id=24 BUT i want this to be the only way for my users to access the files, ie they shouldn't be able to type in:

http://www.mysite.com/download/myfile.zip

so ill be storing the files below the viewable area on my site. so to access the files i need a way of making the file download, i tried to look up some cleevr things to do with headers but these seem only to work if youve made a file on the server side, any ideas how i can do this ?

View Replies !
Download Button When Pressed Will Download A File From Server
I want to make a "download" button on my website that when pressed will download a file from my server. This is the code:

View Replies !
Help With Getting A Number Of Posts
Hi, I've been trying to make a message board of sorts, and I'm having trouble getting the number of posts in each forum to show correctly. The two tables in mysql im trying to use in order to do this are a table called info, and a table called forumlist. Forumlist has two columns, one with forum_id, and one with forumname. Right now it has three entries, Test Thread, Game Thread, and Discussion Thread, with forum_ids of 1, 2, and 3 respecitively. In the table info, there is a bunch of columns pertaining to the author, the description, but those don't really matter, the one column that does in info is the column forum_id which is an integer I am using to keep track of which thread is in which forum.

Right now there is only one entry in the info table, and that has a forum_id of 1. I have been trying to get it to show that there is one total post in the Test Thread, and 0 in the two others, but for some reason it keeps saying there is one in the Game Thread, and 0 in the others. I tried changing the forum_id to 2 in the info table, but then it said that I had one post in the Discussion Thread and 0 in the others. It seems to be jumping ahead by one for some reason. I could use some help, here is my code:

View Replies !
Unread Posts
I need to create an unread posts modification, and well I am not sure how to handle the unread posts. Should I store a cookie with an array (if possible), with the array containing all the post ids?

View Replies !
Latest Posts..
You know how on forum software they show the new posts, and then mark them as old.. how is this usually done? Is it via cookie, with all the ids stored in an array, or some other way?

View Replies !
Deleting Posts
How can I delete my previous post?  It's showing up in Google when I search for the url referenced in my previous post (if I put the name here, it will show this post, too).  If I can't delete it, can I make it so that Google can't pick it up?

View Replies !
Pulling Posts
I have no experience with PHP. However, I would like to set up my webpage (for a guild in an online game) to parse our "News" forum on our message board, and display the post in the main content portion of our webpage. Basically I am looking to have the webpage updated whenever I create a new post in our "News" forum, without editing the actual webpage.

View Replies !
Most Recent Posts
i have been having trouble gathering the x most recent posts with their author. if somone could help me out with a quick snippet or some other type of help i would be greatful for life.

php - 5.1.1
mysql 5
phpBB2

View Replies !
15 Posts From 3 Tables
I have three different news tables (MySQL) news1, news2 and news3, each having columns ID Date and Text. How can I, using PHP, display on a single page the 15 most recent posts.

View Replies !
Check For Age Of Posts
I have a table (t1) that stores publications data and another table (t2) that stores articles data. The articles have datestamp 000-00-00. All article are associated with publications.

I need to run a script that will check and if there were no new articles posted under a particular publication for let say 30 days, change publication status from 'active' to 'inactive'. Code:

View Replies !
Posts Forum
with my forum i want the user to be able to see different icons if the post is new, any ideas on how to do it? right now i am using

<?
if (isset($_SESSION['username']))
{
$sql_query = mysql_query("SELECT time from users WHERE username = '" . $_SESSION['username'] . "'");
$my_time = mysql_fetch_array($sql_query);
$user_time = $my_time['time'];
if ($topic_locked == 'yes' && $topic_time > $user_time) { ?>
<img src="images/new_locked_icon.gif" width="25" height="25">
<? } elseif ($topic_locked == 'yes' && $topic_time < $user_time) { ?>
<img src="images/locked_icon.gif" width="25" height="25">
<? } elseif ($topic_locked == 'no' && $topic_time > $user_time) { ?>
<img src="images/new_regular_icon.gif" width="25" height="25">
<? } elseif ($topic_locked == 'no' && $topic_time < $user_time) { ?>
<img src="images/regular_icon.gif" width="25" height="25">
<? } } ?>

View Replies !
Download File Without Knowing URL/Using Download Manager?
In some site , ex. PHP-Nuke site When you download a file , you didn't know the File's URL and cannot use the download manager. How can i do that on my site?

I saw some site that require to enter exact Referrer URL in the download manager (The referrer URL will change everyday) before downloading

Example
In the DL manager program

File URL : http://www.examples.com/files/ex.rar
Referrer : http://www.examples.com/referrer?S1H43B809B

How can they do that?

View Replies !
Avioding Expired Pages, & Carrying Data Accross Multiple Form Pages
I have a checkout/order form that consists of 6 pages, all PHP. The are linked to one another, like, after the user finishes page 1, they proceed to page 2, etc... The first two pages are submitted by a GET link, so those are not in my question. The next 4 are submitted using a <form>. Throughout all of the pages, i would probably have about 25-30 variables, things that the user has to fill out. I have two questions,

1. What would be the best way for me to keep track of all the data moving throughout the pages, like storing it from page 4, and i still need to access it on page 6.
2. I don't know if anyone could help me here, but does anyone know of a way to code around those ugly "page expired" pages, because of a submitted form. If a user needs to go back, which most likely they will, is there some sort of way for me to skip the expired page?

View Replies !
Not Alling Html In Posts
I used htmlspecialchars thing to get rid of turning HTML in forum posts into actual HTML. But there is a prob cause nl2br() messes it up. It actually prints out the <br>'s... any ideas?

View Replies !
Refresh Problem And Posts
I have a problem with refresh.

I have a contact form that sends an email when the submit button is
pressed. I have a hidden variable and the code for emailing is only
executed if the variable is set. The variable is cleared at the end of
the code. All works as expected unless the REFRESH button is pressed
by the user in which case the script is executed and the emails are
sent once more. Debugging shows the test variable is set again even
though it was unset before exiting on the previous run. How can this
be?

I know there are some things I could do like using database entries or
cookies to hold the variable or even jump to another page which I do
not want to do.

View Replies !
Using Arrays To Sort Posts
I'm trying to sort my posts so that they are grouped and seperated for every month. For example all december posts will be grouped togther and given a header with the name december, and etc for the other months. Code:

View Replies !
Form That Posts And Emails...
I have a script that is working for an individual to update a dog ad on this site I built.  What I would like to have happen is not only for the data to post to the MySQL, but also for it to email me and tell me that someone has placed an ad.  I know this is probably extra simple, but I am dumb.  Please, if you could, just tell me how it would work in the script I have, what I need to ad where... Code:

View Replies !
Forum Posts / Sql TEXT
When ive ste the mysql table row to TEXT does this mean it will only read any saved data in it as text? just asking as i dont wish to have an sql injection leak in my forum posts. Currently i validate most the characters but ones like & , ' " ; i just default it to an error and dont save it in the db.

View Replies !
How Can I Redirect Where My Form Posts To?
I have successfully submited info to a form with cURL in the past but I have a form on my website that i attempted to post to with cURL with no luck.

the form normally posts to itself. How can i change the post action so that the info is sent somewhere that will allow me to seeall data that is sent when posting?

View Replies !
Displaying Forum Posts
I've asked at a couple different communities, and can't find an answer. Let me explain what I'm trying to do. Basically, I am going to be a league commissioner of a simulation football league. People join the league and take over as an owner of a team. When that owner posts on the message board under their team news forum, I would like for that post to display on a separate html page.

I would also like to be able to display an archive of their team's news based on the posts in that forum. Is there some kind of utility or code out there that already has this? If so, can someone point me in the right direction? I can look at the php code to kind of figure out what is going on, but I wouldn't be able to code it myself.

View Replies !
Limits Posts Per 10 Minutes
im working on a homemade forum for my site and im trying to make a way to stop a person from being able to post more than 10 posts in 4 minutes (or what ever is a good time frame).

and if the user does this more than 3 times there account gets deleted can someone instruct me on how to do this.

View Replies !
PHP Forum Breaks 50K Posts
we are picking up more members daily and keeping a lively forum here.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved