Re: [PHP] How to catch the output of http:// -> text file?
Hi Simon, Try the following for reading the files, for(i=1;i<2000;i++) { $response=""; $request="kbid=$i"; //Header $header = "POST kb.html HTTP/1.0\r\n"; $header .= "Content-type: application/x-www-form-urlencoded\r\n"; $header .= "Content-length: " . strlen($request) . "\r\n\r\n"; //Open Connection $fp = fsockopen("www.mysite.com",80,&$err_num,&$err_msg, 30); if($fp) { fputs($fp, $header.$request); while(!feof($fp)) $response .= fgets($fp,2048); fclose($fp); } else { if(DEBUG) { echo "ERR_NUM: $err_num\nERR_MSG: $err_msg"; } //write response to a file echo $response; } Hope this helps you, Wieger Kraa de Simon wrote: > > Hi, > > PHP newbie. > > Can anyone help me with the following? > > Pseudo code: > > for(i=1;i<2000;i++) > { > catch the output of > http://www.mysite.com/kb.html?kbid= > and put the html code in a text file called > /www/kb/kbid .html > } > > So the end result is 2000 html files on disk "extacted" from the http:// > address... > > Thanks... > > Met vriendelijke groet / With kind regards, > > Simon de Kraa > ICL Logistic Systems > mailto:[EMAIL PROTECTED] > > --- > > Microsoft Windows 2000 Professional SP 1, Progress 9.1b, Roundtable 9.1b > SCO UnixWare 7.1.1, Progress 9.1a11 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Wieger Uffink tel: +31 20 428 6868 fax: +31 20 470 6905 web: http://www.usmedia.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Call to a member function on a non-object
Hi, $db is not an object, but a link identifier returned by mysql_connect(). Wieger Ender wrote: > > Okay I get the: Call to a member function on a non-object error when trying to >execute this script: > > It happens in this area: > > $db=mysql_connect(localhost,'***','***') or die("Unable to connect to database"); > > $edlist = new EditList("serverId", "hlstats_Servers", "server"); > $edlist->columns[] = new EditListColumn("game", "Game", 0, true, "hidden", >$gamecode); > $edlist->columns[] = new EditListColumn("address", "IP Address", 15, true, >"ipaddress", "", 15); > $edlist->columns[] = new EditListColumn("port", "Port", 5, true, "text", "27015", >5); > $edlist->columns[] = new EditListColumn("name", "Server Name", 22, true, "text", >"", 64); > $edlist->columns[] = new EditListColumn("rcon_password", "Rcon Password", 10, >false, "text", "", 48); > $edlist->columns[] = new EditListColumn("publicaddress", "Public Address", 20, >false, "text", "", 64); > $edlist->columns[] = new EditListColumn("statusurl", "Status URL", 20, false, >"text", "", 255); > > > if ($HTTP_POST_VARS) > { > if ($edlist->update()) >message("success", "Operation successful."); > else >message("warning", $edlist->error()); > } > > ?> > Enter the addresses of all servers that you want to accept data from here. > > > $result = $db->query(" > SELECT >serverId, >address, >port, >name, >publicaddress, >statusurl, >rcon_password > FROM >hlstats_Servers > WHERE >game='cstrike' > ORDER BY >address ASC, >port ASC > "); > > More specificially it happens on this line: $result = $db->query(" > > What am I doing wrong here? > > Best regards, > > Ender [Clan Leader] > [EMAIL PROTECTED] -- Wieger Uffink tel: +31 20 428 6868 fax: +31 20 470 6905 web: http://www.usmedia.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] remotely include file
Hi, I think the webserver on the remote machine parses the PHP-file. You can see this happen if you type in the url youre trying to include in your browser. No php code there, just html I dont think what youre trying to do is possible. If it were youd have one hell of a security hole on your webserver :) bye Wieger Robert Covell wrote: > > I tried the exact same thing. I have a whole slew of the classes that have > been developed and wanted to centrally locate them on one server. But every > time I included the class, it said cannot instantiate non-existent class > "Blah Blah Blah". But when I copied over the file, it worked like a charm. > Any ideas why this would occur? > > Sincerely, > > Robert T. Covell > President / Owner > Rolet Internet Services, LLC > Web: www.rolet.com > Email: [EMAIL PROTECTED] > Phone: 816.210.7145 > Fax: 816.753.1952 > > -Original Message- > From: Wico de Leeuw [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 08, 2001 9:30 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: [PHP] remotly include file > > At 15:40 8-5-2001 +0200, Dominic Brander wrote: > >Hi > >I'm trying to include some php3 files via http. > >one part of the php files is on a regular server and the other part is > >on an secure server. > >Instead of duplicating all the files for both servers I would like to > >include them via http. > >How does it work? > > Like : > > include("http://www.somehost.ext/path/to/include/include.php";); > > :) > > Greetz, > > Wico > > >thanx > > > >domnic > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Wieger Uffink tel: +31 20 428 6868 fax: +31 20 470 6905 web: http://www.usmedia.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] forcing upload instead of showing doc
Hi, Wieger Christian Dechery wrote: > > How do I force an output to be recognized by the browser by a downloadable > text file as soon as I press the submit button? > > what header(*) stuff should I add before echo-ing stuff? > > thanks > > . [ Christian Dechery ] > . Webdeveloper @ Tá Na Mesa! > . Listmaster @ Gaita-L > . http://www.tanamesa.com.br > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Wieger Uffink tel: +31 20 428 6868 fax: +31 20 470 6905 web: http://www.usmedia.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Classes and arrays
Hi, write $this->items[$id] instead of $this->$items[$id] bye Wieger Stefan Kostopoulos wrote: > > Hi! > > Can anybody explain to me why this script outputs: > > oneone > > instead of: > > zeroone > > ??? > > Thanks, > > stefan > > class Cart { > var $items; // Items in our shopping cart > > function add_item ($id,$text) { > $this->$items[$id] = $text; > } > >function output($id){ > > echo $this->$items[$id]; > } > > } > > $c = new Cart; > $c->add_item(0,"zero"); > $c->add_item(1,"one"); > $c->output(0); > $c->output(1); > > ?> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Wieger Uffink tel: +31 20 428 6868 fax: +31 20 470 6905 web: http://www.usmedia.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] removing PHP
maybe you could be a bit more specific about what kind of server your referring to. Wieger Joseph Bannon wrote: > > How do I remove PHP from my server? I need to do a fresh install. > > Joseph > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Wieger Uffink tel: +31 20 428 6868 fax: +31 20 470 6905 web: http://www.usmedia.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Converting MySQL Date (2001-05-21) to Friendly Date (21 May 2001)
You could consider using DATE_FORMAT() when pulling the date out of the MySQL Table. HAve a look in the mysql manpages for the ezxact syntax Wieger Matthew Ralston wrote: > > I've got a date stored in a MySQL database in a "DATE" field, so it is > stored as "2001-05-21". How do I convert that into a more friendly date like > "21 May 2001" or even "21st May 2001" for display on a web page? > > I've tried > > print date("jS F Y", $dbtable[date]); > > but I always get "1st January 1970" because I don't know how to convert the > MySQL date into a PHP timestamp. > > Can someone tell me how to do it please? > > -- > Thanks, > > Matt > [EMAIL PROTECTED] > < www.mralston.co.uk /> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Wieger Uffink tel: +31 20 428 6868 fax: +31 20 470 6905 web: http://www.usmedia.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how can i get local script name?
Hi $path = $HTTP_SERVER_VARS["SCRIPT_FILENAME"]; wieger elias wrote: > > hello! > I can use $PHP_SELF to get it's name. > how can i get it's name and location on the hard drive? > > -elias > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Wieger Uffink tel: +31 20 428 6868 fax: +31 20 470 6905 web: http://www.usmedia.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Get highest value of key most efficiently
Hi, SELECT MAX(column_name) FROM table_name Though for what youre trying to do its better to use an autoincrementing field. That way the database will automaticly increment the key when you do an insert regards, wieger Kraa de Simon wrote: > > Hi, > > SQL newbie... > > What is the most efficient way to get the highest value of a key value using > the odbc_* functions/SQL syntax? > > E.g. if I have a table with key values 1,2,3...1567 I need the higest value: > 1567 so I can create a new record and assign key value 1568. > > I don't want to read the whole table... > > Met vriendelijke groet / With kind regards, > > ICL Nederland B.V. Simon de Kraa > e-Applications / Logistic Systems Systems Architect > Het Kwadrant 1 Tel. +31 346 598865 > Postbus 4000Fax +31 346 562703 > 3600 KA MAARSSEN > The Netherlands mailto:[EMAIL PROTECTED] > > --- > > Microsoft Windows 2000 5.00.2195 SP 2, Progress 9.1b, Roundtable 9.1c > SCO UnixWare 7.1.1, Progress 9.1b > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Wieger Uffink tel: +31 20 428 6868 fax: +31 20 470 6905 web: http://www.usmedia.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Basic multi-dimensional array help
Hi Jeff, There probably are several ways of doing this. One is you copy $info[0] ( an array itself ) into a dummy variable, and get the values with $dummy[0] etc. Or use brackets in your variable syntax, which youll have to experiment with cause, I can never seem to remeber the right syntax :) something like ${$info[0]}[0] I think... correct me if Im wrong. Hope this helps, Wieger Jeff Gannaway wrote: > > I've got input fields in a form that look like: > > > > > > > > > > > > > The next script processes all this into a database. Here are the results I > get from various commands: > > sizeof($Info): 2 > sizeof($Info[0]): 4 > print $Info[0][0]: Array[0] > > Any help? > Jeff Gannaway > > ___ > > SUMMER ART PRINT SALE at www.PopStreet.com > Save an additional 10% off art print orders of $50 or more. > Type in coupon code jemc when checking out. > ___ > > Find the right art print for your home. > * Search by artist, color, art style and subject. > * Preview the art prints against your wall color. > * Specializing in contemporary, abstract and African > American art. > * Every day discounts on thousands of fine art prints. > > PopStreet.com is your avenue to art. > > http://www.popstreet.com > ___ > Coupon may be redeemed from June 27 through July 31, 2001. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Wieger Uffink tel: +31 20 428 6868 fax: +31 20 470 6905 web: http://www.usmedia.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] multiple entries in the same field
Hi Jamie, use explode() or split(), these will split up your string eand return the resulting elements as an array. Generally speaking its not reaally good practice to store multiple entries as a comma sepparated string in one db field, since it takes down the data integrity of your database. Better would be to just store them in three sepperate columns in your table. If the number of items is not always the same, you should store these as individual entries in a sepperate table with the primary key of your original table. This way you can use the full potential of your database. My humble opinion though, Wieger Jamie Saunders wrote: > > Hi, > > In a MySQL database I have one field that holds several entries seperated by > a comma (e.g. item1,item2,item3). What I want to do is to get these items > from the db from a PHP script and display each item on it's own line (e.g. > item1item2item3). Is there anyway of doing this easily by simply > changing each comma to a '' in the script? > > Thanks. > > Jamie Saunders > [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Wieger Uffink tel: +31 20 428 6868 fax: +31 20 470 6905 web: http://www.usmedia.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MS SQL Question
Hi Ryan, You could try REPLACE INTO in combination with a select from the second table, instead of UPDATE. For the exact syntax see http://www.mysql.com/doc/R/E/REPLACE.html Maybe you can fit it to your needs. Wieger "Conover, Ryan" wrote: > > I am trying to update a table with data from another table within the same > database with the following SQL > > UPDATE common SET common.[Extended Description] = extended.[Extended > Description] WHERE common.[id] = extended.[Extended Description] > > the id is the primary key. I keep getting the following error. > > Server: Msg 107, Level 16, State 3, Line 1 > The column prefix 'extended' does not match with a table name or alias name > used in the query. > Server: Msg 107, Level 16, State 1, Line 1 > The column prefix 'extended' does not match with a table name or alias name > used in the query. > > Anyone have any ideas. > > Ryan > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]