RE: [PHP] PHP as a web browser?

2001-12-17 Thread Lawrence . Sheed
you may want to look at the curl functions as a start. thats most of the functionality down already. otherwise you'll have to parse raw data. not too hard, but can be painful to keep stateful info. you'll also have to rewrite code when the interface changes, you'll probably want to look at

RE: [PHP] telneting sockets help..

2001-12-18 Thread Lawrence . Sheed
Have you tried setting socket blocking? Here's what I do... var $connection=0; $host = pericles.ipaustralia.gov.au; $port=23; switch( $connection=fsockopen($host,$port) ) { case -3: return(-3 socket could not be created); case -4: return(-4 dns lookup on host '$host'

RE: [PHP] Re: max # of characters for links to work in emails?

2001-12-19 Thread Lawrence . Sheed
http://www.isi.edu/in-notes/rfc1034.txt excerpted: To simplify implementations, the total number of octets that represent a domain name (i.e., the sum of all label octets and label lengths) is limited to 255. unless using one of the new extended names..., but I digress Typically URL's work

RE: [PHP] Mysql check

2001-09-24 Thread Lawrence . Sheed
Another thing to check Are your table(s) corrupted? From the MYSQL Manual Typial typical symptoms for a corrupt table is: You get the error Incorrect key file for table: '...'. Try to repair it while selecting data from the table. Queries doesn't find rows in the table or returns incomplete

RE: [PHP] A simple PHP form not working

2001-09-24 Thread Lawrence . Sheed
You have a blank line before your ?php Any output before a header or cookie is verboten. Delete any blank space, or lines before your ?php and don't output anything until *after* the header( output. Lawrence. -Original Message- From: Tshering Norbu [mailto:[EMAIL PROTECTED]] Sent:

RE: [PHP] display query results at random

2001-09-25 Thread Lawrence . Sheed
Return into an array, then loop through the array or shuffle it (easier)?. Note if you have nulls in DB, you will have to do something different. n'est pas? e.g. (untested) mysql_fetch_array ?php mysql_connect ($host, $user, $password); $result = mysql_db_query (database,select

RE: [PHP] Dated/Timed actions

2001-10-02 Thread Lawrence . Sheed
cron job. Probably something along the lines of small php code interfacing with a db with dates etc in, and another php script which checks the dates and emails details on that day. A Cron job which runs the script daily would probably do the job. do a search in google for cron job

RE: [PHP] Mirroring Website

2001-10-03 Thread Lawrence . Sheed
Webzip is ok too for downloading an entire site onto a local machine, restructuring links, although the non registered version inserts javascript html code into every page header. Its nothing that a quick regex replaces can't fix though ;) www.webzip.com -Original Message- From: Phil

RE: [PHP] mysql update query

2001-12-04 Thread Lawrence . Sheed
I concur Probably this will work $result = mysql_query(UPDATE table SET value1='$value1',value2='$value2' WHERE id=$id); remember integers id=1 are not strings id='1'; not the same! -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: December 5, 2001 11:37 AM

RE: [PHP] fopen not opening url

2001-07-31 Thread Lawrence . Sheed
Are you still having problems? Things to try: 1. Try and open the url directly in a browser. eg http://p.moreover.com/cgi-local/page?c=Music%20business%20newso=xml Does it return data (you may need to change the o=xml to o=html though). Some countries (like the one I'm in China, have

RE: [PHP] Hmmm?

2001-08-01 Thread Lawrence . Sheed
I presume you mean code layout Its there to make code easier to read. eg some silly code for ($x=1;$x100;$x++) { while ($i50) { print $i; } } This is more legible than for ($x=1;$x100;$x++) { while ($i50) { print $i; } } Indentation makes it easier to spot

RE: [PHP]Getting rows in a db...

2001-08-01 Thread Lawrence . Sheed
Bear in mind that you don't want to be doing queries like that generally. Use count(*) to get the number of rows - using mysql_num_rows is slower. eg $query=select count(*) from tablename where cat='band'; $result = mysql_query($query,$conn); etc. -Original Message- From: David

RE: [PHP] MySql help #1

2001-08-02 Thread Lawrence . Sheed
Sounds like a strange request, what are you trying to do? I don't think you can do this directly in mysql, but you could build an array of results in php. eg something like (crappy code below) //Grab results $db = mysql_connect($db_domain, $db_user,$db_password);

RE: [PHP] MySql help #1

2001-08-02 Thread Lawrence . Sheed
status to Reserved. When he buy he just tell how many and not which ones. Lawrence Sheed [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED] ... Sounds like a strange request, what are you trying to do? I don't think you can do this directly in mysql, but y

RE: [PHP] ----- BEING AN ASS CLICK HERE NOT ABOVE!!!!!

2001-08-02 Thread Lawrence . Sheed
Oops, Correction - You'll need to run apache first, leave it running, and then try the below. not enough coffee today... -Original Message- From: Sheed, Lawrence -SHNGI -AG Sent: August 2, 2001 5:51 PM To: 'Kyle Smith'; [EMAIL PROTECTED] Subject: RE: [PHP] - BEING AN ASS CLICK HERE

RE: [PHP] ----- BEING AN ASS CLICK HERE NOT ABOVE!!!!!

2001-08-03 Thread Lawrence . Sheed
Kyle, Apache runs as a background program. When you've installed apache, and php, you don't actually run them from the commmand line. What you have to do is open up a browser window, and point it to your computer. Open up Internet Explorer (you're running windows it looks like), and type in

RE: [PHP] Adopt A Newbie (ME)

2001-08-03 Thread Lawrence . Sheed
He's young. Impatience is a documented feature of the youth of today (hmmm, am I old now ;( ) I've was helping him offlist with php/mysql yesterday - he seems to have it installed now. All he needs to do now is learn php, and mysql, and courtesy. Shouldn't take more than another thousand or

RE: [PHP] caching and IE 5

2001-08-09 Thread Lawrence . Sheed
Try this head META Http-Equiv=Cache-Control Content=no-cache META Http-Equiv=Pragma Content=no-cache META Http-Equiv=Expires Content=0 /head works for me - try loading www.shanghaiguide.com/main/index.php3 - should do time, and display a different image every time. cheers, lawrence.

RE: [PHP] to include php file into html file

2001-08-14 Thread Lawrence . Sheed
Try ?php include /include/adjs.php; ? in your html file to include some php code in there [1]Javascript is a rather sh*tty client side language, it doesn't parse php very well. [2]script language='JavaScript' src='/include/adjs.php/script

RE: [PHP] to include php file into html file

2001-08-14 Thread Lawrence . Sheed
Well, It seems your web server is setup not to parse .html files as php If you are running apache, then add configure it to correctly parse the ?php in all files. php.net has ample doc's about that, as does apache. If you are running IIS or PWS, then get any of the millions of people with root

RE: [PHP] Re: `pwd` - what does this mean?

2001-08-15 Thread Lawrence . Sheed
pass working directory [or] path to working directory. PWD is a unix command See man pwd for more details. eg http://campuscgi.princeton.edu/man?pwd#toc3 -Original Message- From: Raphael Pirker [mailto:[EMAIL PROTECTED]] Sent: August 15, 2001 2:49 PM To: [EMAIL PROTECTED] Subject:

RE: [PHP] a bit off the list but should be easy

2001-08-15 Thread Lawrence . Sheed
Most people do it like this Specify the charset in the document. e.g. Simplified Chinese meta http-equiv=content-type content=text/html; charset=gb2312 Traditional Chinese meta http-equiv=content-type content=text/html; charset=big5 You can also specify the language type in the web server -

RE: [PHP] hacks we should know about

2001-08-16 Thread Lawrence . Sheed
my 2 cents Anyone with a clue doesn't use /etc/passwd anymore *shadow password file*, so thats kind of depreciated... Your php process should not be running as root - typically you will give apache its own group, and apache + php will only be able to access files which that group has

RE: [PHP] OT win95/apache/ query

2001-08-16 Thread Lawrence . Sheed
Windows is a little stupid try this from windows start/run/command echo .htaccess you now have a blank .htaccess file, copy it to wherever you need and edit it with whatever contents you need. -Original Message- From: rm [mailto:[EMAIL PROTECTED]] Sent: August 17, 2001 12:27 PM To:

RE: [PHP] hacks we should know about

2001-08-16 Thread Lawrence . Sheed
/ might be a correct path not a hack attempt. here's something normalizes a directory for a given path passed to it. eg /index.txt eg ../../../ will get parsed out. such as in the http://www.somesite.com?page=../../../../etc/passwd Originally written for a directory browse script i use for

RE: [PHP] Startup

2001-08-17 Thread Lawrence . Sheed
you're startup files are typically in /etc/rc.d/init.d on redhat be *very* careful though! Create a script which starts whatever you need in there. create a text file which starts apache. eg pico startapache #start apache apachectl start save file chmod +x it to make it executable do the

RE: [PHP] charset

2001-08-21 Thread Lawrence . Sheed
Depends on what Chinese charset you want. Simplified Chinese or Traditional. GB or BIG5 Use a meta content type for the charset type for simplified meta http-equiv=content-type content=text/html; charset=gb2312 for traditional META http-equiv=Content-Type content=text/html; charset=big5

RE: [PHP] Strings with Spaces in URLS

2001-08-21 Thread Lawrence . Sheed
$search= urlencode ($search); urlencode - have a look on the php site. -Original Message- From: Chris Aitken [mailto:[EMAIL PROTECTED]] Sent: August 22, 2001 9:05 AM To: [EMAIL PROTECTED] Subject: [PHP] Strings with Spaces in URLS I have come up with a bit of a problem I have a

[PHP] Session Problem

2001-08-23 Thread Lawrence . Sheed
I can't get session variables to work I know this has been done to death in the past, but I've looked on php.net, and google for a solution, have tried the suggestions, and seem to fix it. My php session settings are as follows: NameLocal Global settings

RE: [PHP] Session Problem

2001-08-23 Thread Lawrence . Sheed
The simple things... Now I feel stupid. Baaie dankie Rudolf. (I'm an ex Capetownian now in Shanghai,China) Note to self, read manual * C A R E F U L L Y * -Original Message- From: Rudolf Visagie [mailto:[EMAIL PROTECTED]] Sent: August 24, 2001 1:43 PM To: [EMAIL PROTECTED] Cc: [EMAIL

RE: [PHP] Pulling webpages - may be a weird question :)

2001-08-28 Thread Lawrence . Sheed
Some of us live in countries where these proxy servers are banned. I cannot access anonymiser, safesurf or any of the other open proxies. sometimes accessing cnn is useful, so I wrote some quick and very nasty code to retrieve and view webpages - also encrypts the url as well - China sometimes

RE: [PHP] mailto function to attach a photo

2001-08-28 Thread Lawrence . Sheed
You're probably going to need a mime class - Manuel Lemos makes a good one, then send as a mime attachment. http://freshmeat.net/projects/mimemessageclass/ Some sample code below that I use (and a mime class). Example.php ? if (!isset($SEND_MIME_LOADED)) { require mimeclass.php; }

RE: [PHP] Re: install error

2001-08-30 Thread Lawrence . Sheed
it usually means the apache httpd wasn't found in /usr/bin Some distributions throw things in wierd places do a 'locate httpd' (quicker) or 'find \ -name httpd' (longer) to find out where its situated then configure paths accordingly. Remember if you are going to use dso's apache must be

RE: [PHP] Problem with microtime()

2001-08-31 Thread Lawrence . Sheed
You are casting microtimes results as an integer value. It isn't an integer value, hence the 0. From the manual It returns the string the string msec sec where sec is the current time measured in the number of seconds since the Unix Epoch (0:00:00 January 1, 1970 GMT), and msec is the

RE: [PHP] refer to the same page AGAIN! Please...

2001-09-04 Thread Lawrence . Sheed
Create a file with the following. test.php ?phpinfo();? open a browser and point at test.php Look at the http variables section. Now try adding some variables to it eg : open the browser, and open a url like the following: http://localhost/test.php?x=yfoo=bar Now look at the PHP Variables

RE: [PHP] hi

2001-09-10 Thread Lawrence . Sheed
It still won't work though. (unless show_source is javascript, which I doubt) You can't embed php in html like that. HTML is for client side, and they aren't running php in their browser. Browsers generally support javascript or vbscript ECMA style scripting on client side. If you wanted to

RE: [PHP] Re: Mailing list

2001-09-12 Thread Lawrence . Sheed
Should be relatively easy. Its going to take 2 steps. Send out one of the images with a unique id per mailout, this could be the users email address if you wanted to tie in the data per user (may be illegal in some countries without users permission). eg first mail html bla blah img

RE: [PHP] limiting rows and pages like google

2001-09-13 Thread Lawrence . Sheed
2 queries is ok imho, but let the database do all the work ;) The first query should be a select count (*) QUERY for a count. The second query should be the actual QUERY. Eg something cut 'n' pasted from some code of mine (not nice, but hey ;) ) -- $db =

RE: [PHP] posted urls

2001-09-14 Thread Lawrence . Sheed
ereg_replace or str_replace perhaps? eg $something= this is a sentence; $something = ereg_replace ( ,+, $something); print $something; -Original Message- From: Egon Schmid [mailto:[EMAIL PROTECTED]] Sent: September 14, 2001 2:20 PM To: Alexander Skwar Cc: murat; [EMAIL PROTECTED]

RE: [PHP] limiting rows and pages like google

2001-09-16 Thread Lawrence . Sheed
How about limiting results? eg limit the return page value after a certain number (say 10) to every 5 pages, then 50 pages a la google. Page 1 2 3 4 5 6 7 8 9 10 ..15 ..20 ..50 ..100 This can be done relatively easily eg (untested) for ($count=1;$count=$pages;$count++) { // loop thru

RE: [PHP] Performance: PHP vs. Visual Basic

2001-09-16 Thread Lawrence . Sheed
It may not be a performance thing based on software in use, it could be coding problems with the current software. If you are having problems with 40 - 50 users, you may want to look at where things are locking up. Table locking because of badly designed update queries can freeze a good system

RE: [PHP] how to use MYSQL date type string in php?

2001-09-19 Thread Lawrence . Sheed
Not quite what you are looking for, but here are some Chinese sites on PHP to look at, they also have forums in chinese (?) www.phpuser.com www.phpx.com www.php2000.com www.phpease.com www.chinaasp.com/php ??! ??? () -- PHP General Mailing List (http://www.php.net/) To

RE: [PHP] Going blind? Plz hlp w/ parse error

2001-09-19 Thread Lawrence . Sheed
For a start use 's much easier to read eg $qry_1=select * from cust_info where username=\$username\; should be $qry_1=select * from cust_info where username='$username'; this looks like a guilty line - $qry_2=insert into cust_info (username,password,mother) values

RE: [PHP] URGENT: function mail()

2001-07-25 Thread Lawrence . Sheed
Have a look at the internet - google is good for this http://www.imc.org/mail-i18n.html#MIME Internationalized text and names appear in both parts of Internet mail messages: in the headers, and in the body of the message. RFC 2047 covers how to use international characters in some parts of

RE: [PHP] URGENT: function mail()

2001-07-25 Thread Lawrence . Sheed
Feeling a little guilty for not being that helpful (rfc's aren't that easy to use sometimes) From the top of my head Two types of encoding based on the RFC B (Base64) Q (Quoted?) so for funky foreign text, non ascii would be something like $subject= base64_encode ($subject); $subject=

RE: [PHP] html form question

2001-07-25 Thread Lawrence . Sheed
I use the following Looks a bit unwieldy to call, but does everything I need. eg, say I have a table called foo with ID, Name print OptionCreate (ID,returnID, foo order by Name, ,Name); will create me a drop down print OptionCreate (ID,returnID, foo order by Name, 1,Name); will create me

RE: [PHP] OT--PHP, MySQL, WML and GPS Tracking

2001-07-25 Thread Lawrence . Sheed
I'm of the opinion you cannot do this totally in PHP. You are going to need some client side, and some server side software - server side can be php of course. Client side ie (gps/wap device)- One possibility - write a wap browser that interfaces with your gps device and returns co-ords in

RE: [PHP] Why doesn't this simple query work?

2001-07-25 Thread Lawrence . Sheed
how about $location = addslashes($location); $query = select shoodID from shoots where location = '$location'; or $query = select shoodID from shoots where location = '. addslashes($location) .'; Both are \'clean\' :) -Original Message- From: Moriyoshi Koizumi [mailto:[EMAIL

RE: [PHP] Syntax Eyes

2001-07-25 Thread Lawrence . Sheed
Almost, but not quite. You also need to prepend a Header before any output your data to tell the browser its content type. Eg ?php Header(Content-type: image/jpg); ...rest of output code ? -Original Message- From: Mark Roedel [mailto:[EMAIL PROTECTED]] Sent: July 26, 2001 12:02 AM

RE: [PHP] how do you write queries in php codes? (was Re: [PHP] Why doesn't this simple query work?)

2001-07-25 Thread Lawrence . Sheed
Its however you prefer it (or whatever is easier to type usually). sprintf is usable, depends on if you have a c or perl background, and its second nature. For me, I use editplus on windows which gives color coding (www.editplus.com), if I do $query = select abc,def,ghi from table1,table2.

RE: [PHP] OT--PHP, MySQL, WML and GPS Tracking

2001-07-25 Thread Lawrence . Sheed
Probably necessary to have a customised browser or other solution - i haven't seen any that explicitly interface to a gps device for lat/long co-ords. You cannot triangulate position using wap - the phone company does it by triangulating the position of the cellphone (Very simplified

RE: [PHP] Headers

2001-07-25 Thread Lawrence . Sheed
To emulate a post you'll have to do something similar to the following header POST /index.php3 HTTP/1.1; header Host: $host; header Content-type: application/x-www-form-urlencoded ; header Content-length: . strlen ($data); header Connection: close\n\n; //may only need one, can't remember if

RE: [PHP] Install

2001-07-25 Thread Lawrence . Sheed
this would seem to be a php list, maybe you should look on a perl list for a complete response, hmm? Activestate make a reasonable perl interpreter for windows, have a look at activestate.com for more details. also try google and search for perl windows apache, maybe you can try reading some

RE: [PHP] Avoiding repost

2001-07-26 Thread Lawrence . Sheed
Set a flag either cookie, or db based. in your submit code, set the flag, fairly simple if ($submitted) { //error i've been posted already } else { //do form submit stuff. $submitted=1; //SetCookie or session variable... } -Original Message- From: Ashley M. Kirchner [mailto:[EMAIL