RE: [PHP] putting a list of data into 3 columns?

2001-04-09 Thread Stewart Taylor
Here is a basic (untested) example. $link = mysql_connect("localhost", "username", "password"); mysql_select_db("database", $link); $result = mysql_query("SELECT product_name FROM products", $link); $num_rows = mysql_num_rows($result); // read in data while ($row = mysql_fetch_array

RE: [PHP] IF this then, move to this line...

2001-04-06 Thread Stewart Taylor
You could use continue to skip to the start of a loop. e.g. while (1) { start of code you want to jump back too . . . if (so and so is true) continue; . . . . break; // exit loop } Unlike c php does not have a goto command. However what you describe does not sound

RE: [PHP] Shell Programming with PHP, but where is the PHP?

2001-04-03 Thread Stewart Taylor
Under linux you can use lynx to run php scripts under the shell. e.g. Assuming lynx is setup correctly lynx -source your.server.com/devel/newtrlkit/test.php?param=whatevertest.txt -Stewart -Original Message- From: Brandon Orther [mailto:[EMAIL PROTECTED]] Sent: 03 April 2001 17:02 To:

RE: [PHP] split string value again

2001-03-29 Thread Stewart Taylor
$addr = "[EMAIL PROTECTED]"; $splitaddr = explode("@",$addr); resulting in $splitaddr[0] = "test"; $splitaddr[1] = "foo.com"; -Stewart -Original Message- From: Jacky [mailto:[EMAIL PROTECTED]] Sent: 29 March 2001 23:52 To: [EMAIL PROTECTED] Subject: [PHP] split string

RE: [PHP] linking classes together

2001-03-22 Thread Stewart Taylor
Your need to define $db as a property of your sessions class. e.g. class sessions { var $db; function sessions { $this-db = new mysql_connect; } function testprint() { $this-db-connect() } } $sess = new sessions; $sess- testprint(); -Original

RE: [PHP] multiple selection dropdown lists

2001-03-22 Thread Stewart Taylor
You need to add '[]' to the selects name which informs php that the select field will have more than one value. Once your form has been submitted an array called $comboResultPlan will be available containing the selected options. -Stewart select name="multi[]" size="5" multiple

RE: [PHP] please help with this simple problem

2001-03-22 Thread Stewart Taylor
fixed that it said wrong perameter count for fopen() on the third line, and "Warning: Supplied argument is not a valid File-Handle resource" for the remaining lines below that in that block of code. i'm sorry, i'm kinda new to this : ( "Stewart Taylor" [EMAIL PROTECTED] wrote in me

RE: [PHP] Unwanted signs!

2001-03-22 Thread Stewart Taylor
You can use the strip_tags function to remove HTML tags from the user inputted data e.g. $name = strip_tags($name) -Stewart -Original Message- From: Brian Rosenkrantz [mailto:[EMAIL PROTECTED]] Sent: 22 March 2001 15:50 To: [EMAIL PROTECTED] Subject: [PHP] Unwanted signs! I'm new to

RE: [PHP] PDF reading via IE5.5

2001-03-21 Thread Stewart Taylor
Try, header("Content-type: application/pdf"); header("Location:$filename"); -Stewart -Original Message- From: Dennis Moore [mailto:[EMAIL PROTECTED]] Sent: 21 March 2001 04:14 To: [EMAIL PROTECTED] Subject: [PHP] PDF reading via IE5.5 I have searched long and hard to resolve this

RE: [PHP] Optional Parameter ?

2001-03-21 Thread Stewart Taylor
You can give $maybe3 a default value which will be used if it is not passed in the function call. You can only do this for the last parameter in the function. function print_this ($value1, $value2, $maybe3=false) { do whatever if ($maybe != false) do whatever with $maybe } -Stewart

RE: [PHP] Post -vs- Get

2001-03-21 Thread Stewart Taylor
It would be better to use randomly generated strings for your client ids e.g. md5(uniqid(rand())); This would be must harder for another use to guess. Even better would be to store your users details in a session variable so that the id will never appear in the url at all. e.g. a very basic

RE: [PHP] Editing Variables from another script.

2001-03-20 Thread Stewart Taylor
include "database.inc" . . . . $dbhost='localhost'; -Stewart -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 20 March 2001 09:26 To: Jason Stechschulte Cc: 'PHP General List. (E-mail)' Subject: Re: [PHP] Editing Variables from another script. Okay,

RE: [PHP] use strict alternative

2001-03-19 Thread Stewart Taylor
php variables are local by default. -Original Message- From: Costas [mailto:[EMAIL PROTECTED]] Sent: 19 March 2001 10:27 To: [EMAIL PROTECTED] Subject: [PHP] use strict alternative Is there a PHP alternative to Perls use strict command. For anyone who doesnt know Perl, use strict

RE: [PHP] POST conversion.

2001-03-15 Thread Stewart Taylor
PHPLIB http://phplib.netuse.de/ has a Query class in sql_query.inc which is used in conjunction with the DB_Sql class. It can be used to create dynamic insert and update queries by assuming that global variables exist which map onto a paricular tables field. You basically name the table and it

RE: [PHP] Using sessions

2001-03-14 Thread Stewart Taylor
An idea is to put the session id in your web page addresses. e.g. http://level1/level2/12123234234234234234/test.php Then setup your web server to filter all addresses to remove the session id from the address before it is displayed in the browser window (you can set apache to do this) so the