[PHP] Re: Using Google's new SOAP based API in PHP

2002-04-12 Thread Simon Willison
Stefen Lars wrote: > Hello all > > CodingTheWeb.com has several reports of Google's new SOAP based > application programming interface: > > http://www.codingtheweb.com/projects/newslog/index.php?filter=Google > > Has anyone tries using this in PHP yet??? Yup - http://toys.incutio.com/php/php-

Re: [PHP] Reuse variables?

2002-02-28 Thread Simon Willison
Tim Thorburn wrote: > I've setup a form that users to our site fill out to request to be > added to our listings. Currently its setup so that the user fills out > the form, and the information is emailed to me for reviewing - however > I'd like to carry it a step further and enter only some o

Re: [PHP] OMG your right ... $REMOTE_ADDR don't work in Samber 5.1, PHP4

2002-02-28 Thread Simon Willison
Philip J. Newman wrote: >OK yah, this is a pain in the butt, $REMOTE_ADDR Dose not work in Sambar 5.1. Anyone >have anyone have any solutions that can be used insteard? > Whenever you have a problem like this run phpinfo(); and have a look at the available environment variables. Useing print_r

Re: [PHP] Variables containing HTML?

2002-02-28 Thread Simon Willison
Erik Price wrote: > > What's the difference between this and the serialize() function? > > Erik It solves a different problem to serialize(). serialize can take pretty much any PHP object / array / data structure and convert it into a string, but the resulting string will still need addslashe

Re: [PHP] just wanna know

2002-02-28 Thread Simon Willison
eoghan wrote: >whats the difference between >print and echo ? > From memory, print() is a function while echo is a language construct. The major difference is that you can use echo with a comma seperated list of arguments, while print requires you to concatenate strings. For example: echo "h

Re: [PHP] getting a files time and date.

2002-02-28 Thread Simon Willison
Philip J. Newman wrote: >Is there any way that PHP can grab the time and date of a file ?? > If you mean a file's last-access and last-modified date then yes, you need the stat() function: www.php.net/stat For example: $stat = stat('file.txt'); $modified = date('l, F dS', $stat[9]); $lastacc

Re: [PHP] Help me!!!Can I use PHP to send SMS message???

2002-02-28 Thread Simon Willison
hei wrote: >Help me!!!Can I use PHP to send SMS message???If yes, how can I use it??? > > >(((Please e-mail the answer to me [EMAIL PROTECTED]))) > One very cheeky way of doing this would be to sign up to one of the free SMS services on the web (such as lycos mobile) and set up a PHP script tha

Re: [PHP] if(isset($submit))

2002-02-28 Thread Simon Willison
jtjohnston wrote: >I can't get this to work: >if(isset($submit)) > >with: > >src=\"next.gif\" border=\"0\" align=\"ABSCENTER\"> > >I'm not coding correctly? > If you are testing for $submit a work around is to have a hidden field in your form that looks like this: That way any tests for $subm

Re: [PHP] Where can I learn?

2002-02-28 Thread Simon Willison
Sean Kennedy wrote: >I know the basic basics of PHP that I learned from the PHP 4 Bible book, but I >would like to learn ALOT more. I'm going to continue in my book, but does >anyone have a suggestion on where to learn more? > Read EVERY article in the archive of www.phpbuilder.com - it'll take

Re: [PHP] Array or SQL?

2002-02-28 Thread Simon Willison
Here is a way of doing it with arrays - I don't know enough advanced mySQL syntax to see how it could be done just in mySQL: $resultsArray = array(); while ($results = mysql_fetch_array($article_query)) { $art_name = $results["article_name"]; $art_text = $results["article_text"]; $q

Re: [PHP] d: Security problem with PHP

2002-02-28 Thread Simon Willison
It's a new problem - www.php.net has a fix available though. Nick Wilson (E-mail) wrote: >-BEGIN PGP SIGNED MESSAGE- >Hash: SHA1 > > >Hi everyone, a potential client just sent me this. Is it an old problem? >or a new one? > >- --begin forwarded worrier--- > >Hi Nick > >Di

Re: [PHP] Hi

2002-02-28 Thread Simon Willison
dharmavatar wrote: >Hi everybody, >I am new in this group,so could any one tell me how to start learn PHP? >I had install PHP in IIS so where is good place to start. >Thanks in advance. >Regards >Dharmavatar > www.devshed.com has some excellent beginners tutorials in their PHP section (the PHP 1

Re: [PHP] class effeciency

2002-02-28 Thread Simon Willison
Nick Wilson wrote: >Is there a better way? It just seems like overkill to include 6-700 >lines of methods /twice/ > Use inheritance. Define a "base" class with all of the methods in it. Then define the two other classes to extend this base class, meaning they will have all of the methods you ha

Re: [PHP] CGI

2002-02-26 Thread Simon Willison
bvr wrote: >Still this wouldn't prevent a visitor from passing something like : > >../../../../bin/cat /etc/passwd > >bvr. > Erk good point - I should have mentioned that it's a very good idea to run basename() on user input as well as this will knock off any directory paths they may have attem

Re: [PHP] CGI

2002-02-26 Thread Simon Willison
bvr wrote: >Please note that plain this: > >>or >>>if (action=="cgi") echo `./cgi-bin/cgiscripts/${scripts} 2&>1`; >>?> >> >is not a good idea, because it allows a visitor to run arbitrary >commands on your server. > >bvr. > If you still want to use that method have a look at these two functions

Re: [PHP] extending a class?

2002-02-26 Thread Simon Willison
} } You can now create you object with the following code: $form = Form::getFormObject('en'); or $form = Form::getFormObject('dk'); Cheers, Simon Willison -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Is there a way to put a scroll in a table ???

2002-02-26 Thread Simon Willison
J.F.Kishor wrote: >1. Is there any other solution to solve it out ? >2. Is there a way to put a scroll in a table ? > >I tried using layers and its working fine in Internet explorer, and in >Netscape the scroll does'nt work. > Try using iframes - they are supported in IE, Netscape 6 / Mozilla and

Re: [PHP] Converting arrays

2002-02-25 Thread Simon Willison
Gary wrote: > Hi All, > I am not too bad at building arrays in php but I need to convert a > javascript form into php. How wuld I conver the small snippit here? > > var d = new Array(), l = new Array(); > l[0] = new Array(1, -360, 1, "CHICAGO"); > l[1] = new Array(1, -420, 1, "EDMONTON"); > l[2

Re: [PHP] Substr and HTML tags - Problem...

2002-02-25 Thread Simon Willison
Sascha Ragtschaa wrote >I need to limit a teaser-text via substr($teaser,0,100). The Problem I now >have is, if the last 4 string chars are a html tag like and this tag >will be cut by the substr to something like that: webpage... > >How can I avoid that the html tags are cut by the substr funct

Re: [PHP] Email Verification

2002-02-24 Thread Simon Willison
Steven Walker wrote: > Does anybody know any good ways (or available code) for verifying > email addresses? > > Checking syntax is not enough.. I'd like to actually be able to test > whether the email address exists. The only way to be sure is to send them an e-mail with a link or validation

Re: [PHP] sending form values in http header?

2002-02-21 Thread Simon Willison
I have no idea why your code isn't working, but if you are interested there is a class called Snoopy which can do exactly qhat you are attempting (posting values to a form, as well as grabbing pages from URLs and other neat tricks): http://snoopy.sourceforge.net/ marcbey wrote: >is it possib

Re: [PHP] text files instead of mySQL

2002-02-20 Thread Simon Willison
M.E. Suliman wrote > Is it possible to convert a PHP script that writes and pulls data from a >mySQL database to use text files / database instead. > Yes it is but you could have a job on your hands depending on the complexity of the script. Personally I favour PHP's serialization capabilities

Re: [PHP] Retaining data across multiple sites

2002-02-20 Thread Simon Willison
Ben Sinclair wrote: >I want to retain some data across my sites, which have different domain names. >I can't use cookies because they rely on the domain name, and I'd rather not >pass the information on every link Any suggestions? > I've been thinking about this recently and here's what I came up

Re: [PHP] Help for passing variable to all pages

2002-02-20 Thread Simon Willison
> > >test link > You can't pass resource types like database connection IDs in URLs as they are only relevant for the instance of the script in which they are created. The same goes for things like file identifiers (from fopen) and other stuff like that. Simon -- PHP General Mailing List (

Re: [PHP] explode? (table field to a variable of same name)

2002-02-19 Thread Simon Willison
First grab an associative array of the variables from the database with mysql_fetch_array() Then use extract($array); to extract all of the variables in the array to the symbol table: www.php.net/extract Simon Baloo :0) wrote: >How can I assign automatically all fields of a database to a va