Re: [PHP] Printing line x in a file

2002-05-12 Thread Austin Gonyou

On Sun, 2002-05-12 at 00:10, Miguel Cruz wrote:
 On Sat, 11 May 2002, Andrew Conner wrote:
  I have a script where I need to get the text from line number
 $line in
  file $filename then save it to a var ($text) and then print it.
 For
  example, in the file lamb.txt (just an example file):
  Mary was
  a little lamb, whose
  fleece
  was as
  white as snow.
  I need to get line number 3 (fleece) and print it (print
 $text).
  How would I go about this?
 
Perhaps you might say, using a for loop, with x=$somelineno, type of
format might be the easiest way to do this from user input or some such
thing. 
 fopen() the file and call fgets() three times. The return from the
 third 
 fgets call will contain the third line (including the terminating
 newline, 
 so strip() it if you don't want that).
 
 miguel
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 
Austin Gonyou
Systems Architect, CCNA
Coremetrics, Inc.
Phone: 512-698-7250
email: [EMAIL PROTECTED]

One ought never to turn one's back on a threatened danger and 
try to run away from it. If you do that, you will double the danger. 
But if you meet it promptly and without flinching, you will 
reduce the danger by half.
Sir Winston Churchill



signature.asc
Description: This is a digitally signed message part


[PHP] .vcf files and PHP Email Form(Newbie)

2002-05-12 Thread webmaster

I want to create an e-mail form that writes a (person's name).vcf(vCard)
file and attaches it to the message. This would allow me to eaisly add
people to my address book.

The source of a sample .vcf(vCard) file is shown below:
BEGIN:VCARD
VERSION:2.1
N:Harrison;JJ
FN:Harrison, JJ
ORG:TecEco Pty. Ltd.;IT
TITLE:Webmaster
ADR;WORK:;;497 main road Glenorchy;Hobart;Tasmania;7010;Australia
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:497 main road Glenorchy=0D=0AHobart,
Tasmania 7010=0D=0AAustralia
ADR;HOME:;;12 Harbinger Lane Austin's Ferry;Hobart;Tasmania;7011;Australia
LABEL;HOME;ENCODING=QUOTED-PRINTABLE:12 Harbinger Lane Austin's
Ferry=0D=0AHobart, Tasmania 7011=0D=0AAustralia
X-WAB-GENDER:2
URL;WORK:http://www.tececo.com
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20020512T063717Z
END:VCARD

Does anyone have any ideas or know of a pre-built script to do this?

Thanks,

JJ Harrison
[EMAIL PROTECTED]
www.tececo.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] .vcf files and PHP Email Form(Newbie)

2002-05-12 Thread Miguel Cruz

Use any of about 10 billion available MIME mail classes/functions (or 
write your own; there's really nothing to it) and attach the vcard as 
content-type: text/x-vcard.

miguel

On Sun, 12 May 2002 [EMAIL PROTECTED] wrote:
 I want to create an e-mail form that writes a (person's name).vcf(vCard)
 file and attaches it to the message. This would allow me to eaisly add
 people to my address book.
 
 The source of a sample .vcf(vCard) file is shown below:
 BEGIN:VCARD
 VERSION:2.1
 N:Harrison;JJ
 FN:Harrison, JJ
 ORG:TecEco Pty. Ltd.;IT
 TITLE:Webmaster
 ADR;WORK:;;497 main road Glenorchy;Hobart;Tasmania;7010;Australia
 LABEL;WORK;ENCODING=QUOTED-PRINTABLE:497 main road Glenorchy=0D=0AHobart,
 Tasmania 7010=0D=0AAustralia
 ADR;HOME:;;12 Harbinger Lane Austin's Ferry;Hobart;Tasmania;7011;Australia
 LABEL;HOME;ENCODING=QUOTED-PRINTABLE:12 Harbinger Lane Austin's
 Ferry=0D=0AHobart, Tasmania 7011=0D=0AAustralia
 X-WAB-GENDER:2
 URL;WORK:http://www.tececo.com
 EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
 REV:20020512T063717Z
 END:VCARD
 
 Does anyone have any ideas or know of a pre-built script to do this?
 
 Thanks,
 
 JJ Harrison
 [EMAIL PROTECTED]
 www.tececo.com
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Variable Prob

2002-05-12 Thread Jason Soza

Argh!

I hate it when one little annoying thing starts up right when I think I have
the coding finished! I have the following code:

if($last_name) {
printf(%s
%s'sbrb%s/bbr%s\n/td,$first_name,$last_name,$year,$color);
} else {
printf(%s'sbrb%s/bbr%s\n/td,$first_name,$year,$color);
}

So if the person has a last name in the database, print John Doe's 1990
Red and if they don't, print John's 1990 Red.

This is in a while() statement, and it works except that on one particular
query, the last record that comes up has a NULL value for the last name, but
rather than printing $first_name's it prints $first_name $last_name using
the last name of the previous record!

Am I missing something there? Do I need to clear out a variable somewhere?
It seems like since $last_name isn't even called in the else statement, it
shouldn't even be showing up!

Jason Soza


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Variable Prob

2002-05-12 Thread Miguel Cruz

It would seem the only way this could happen is if $last_name evaluates to 
true. Two suggestions:

1) Make some extra change in one of the printf statements so you can see 
which one is really being called.

2) If that doesn't illuminate anything, show a little more code.

miguel

On Sat, 11 May 2002, Jason Soza wrote:
 Argh!
 
 I hate it when one little annoying thing starts up right when I think I have
 the coding finished! I have the following code:
 
 if($last_name) {
   printf(%s
 %s'sbrb%s/bbr%s\n/td,$first_name,$last_name,$year,$color);
   } else {
   printf(%s'sbrb%s/bbr%s\n/td,$first_name,$year,$color);
   }
 
 So if the person has a last name in the database, print John Doe's 1990
 Red and if they don't, print John's 1990 Red.
 
 This is in a while() statement, and it works except that on one particular
 query, the last record that comes up has a NULL value for the last name, but
 rather than printing $first_name's it prints $first_name $last_name using
 the last name of the previous record!
 
 Am I missing something there? Do I need to clear out a variable somewhere?
 It seems like since $last_name isn't even called in the else statement, it
 shouldn't even be showing up!
 
 Jason Soza
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Variable Prob

2002-05-12 Thread Jason Soza

Thanks for the debugging tip... Seems that the 'else' statement wasn't being
called at all, so for some reason $last_name was evaluating to true even
though there's a NULL entry for that record/field. I used a different query,
where a person with a NULL last_name showed up first, and the 'else'
statement still wasn't being called but there was no $last_name showing.

Anyway, I added ORDER BY last_name to my mysql_query() statement and for
some reason the 'else' statements started working. Any ideas on why that
would be? I'm glad it works now, but I'm a little confused as to why it
works.

Thanks again.

-Original Message-
From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 11, 2002 11:06 PM
To: Jason Soza
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Variable Prob


It would seem the only way this could happen is if $last_name evaluates to
true. Two suggestions:

1) Make some extra change in one of the printf statements so you can see
which one is really being called.

2) If that doesn't illuminate anything, show a little more code.

miguel

On Sat, 11 May 2002, Jason Soza wrote:
 Argh!

 I hate it when one little annoying thing starts up right when I think I
have
 the coding finished! I have the following code:

 if($last_name) {
   printf(%s
 %s'sbrb%s/bbr%s\n/td,$first_name,$last_name,$year,$color);
   } else {
   printf(%s'sbrb%s/bbr%s\n/td,$first_name,$year,$color);
   }

 So if the person has a last name in the database, print John Doe's 1990
 Red and if they don't, print John's 1990 Red.

 This is in a while() statement, and it works except that on one particular
 query, the last record that comes up has a NULL value for the last name,
but
 rather than printing $first_name's it prints $first_name $last_name using
 the last name of the previous record!

 Am I missing something there? Do I need to clear out a variable somewhere?
 It seems like since $last_name isn't even called in the else statement, it
 shouldn't even be showing up!

 Jason Soza


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] .vcf files and PHP Email Form(Newbie)

2002-05-12 Thread webmaster

I don't have much experiance with MIME. where could I find a tutorial or
ready made class?

- Original Message -
From: Miguel Cruz [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, May 12, 2002 4:41 PM
Subject: Re: [PHP] .vcf files and PHP Email Form(Newbie)


 Use any of about 10 billion available MIME mail classes/functions (or
 write your own; there's really nothing to it) and attach the vcard as
 content-type: text/x-vcard.

 miguel

 On Sun, 12 May 2002 [EMAIL PROTECTED] wrote:
  I want to create an e-mail form that writes a (person's name).vcf(vCard)
  file and attaches it to the message. This would allow me to eaisly add
  people to my address book.
 
  The source of a sample .vcf(vCard) file is shown below:
  BEGIN:VCARD
  VERSION:2.1
  N:Harrison;JJ
  FN:Harrison, JJ
  ORG:TecEco Pty. Ltd.;IT
  TITLE:Webmaster
  ADR;WORK:;;497 main road Glenorchy;Hobart;Tasmania;7010;Australia
  LABEL;WORK;ENCODING=QUOTED-PRINTABLE:497 main road
Glenorchy=0D=0AHobart,
  Tasmania 7010=0D=0AAustralia
  ADR;HOME:;;12 Harbinger Lane Austin's
Ferry;Hobart;Tasmania;7011;Australia
  LABEL;HOME;ENCODING=QUOTED-PRINTABLE:12 Harbinger Lane Austin's
  Ferry=0D=0AHobart, Tasmania 7011=0D=0AAustralia
  X-WAB-GENDER:2
  URL;WORK:http://www.tececo.com
  EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
  REV:20020512T063717Z
  END:VCARD
 
  Does anyone have any ideas or know of a pre-built script to do this?
 
  Thanks,
 
  JJ Harrison
  [EMAIL PROTECTED]
  www.tececo.com
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Sending Html Pages

2002-05-12 Thread Salman Ahmed

Hi,

I am trying to send html pages via email, that is instead of sending plain text format 
to the client I am trying to send Rich Text using mail function of PHP. At first I was 
sending 

--
Hello Bob,

Thanks for downloading this from my site 
--

BUT for Rich Text I am doing
 
--
!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'

html

head
meta content=text/html; charset=iso-8859-1 http-equiv=Content-Type
/head

body
div align=left
table border=0 cellpadding=10 cellspacing=0 width=500
tr
td
font face=Verdana size=2
Hi, 
br
Thanks for downloading this from my site 
/font
/td
/tr
/body
/html
--

But what happens is instead of sending html page it sends as a text with all code 
displayed as it is without being parsed.

Please tell what can I do to send rich text emails as the this one u are reading to 
the clients using PHP mail function.

Kind Regards
Salman



php-general Digest 12 May 2002 10:20:39 -0000 Issue 1340

2002-05-12 Thread php-general-digest-help


php-general Digest 12 May 2002 10:20:39 - Issue 1340

Topics (messages 97166 through 97211):

an sql_layer
97166 by: http://www.promoozz.org [*]
97171 by: Austin Marshall

PHP Hosting ...
97167 by: Tim Thorburn

PHP 5??
97168 by: Tim Thorburn
97169 by: Rasmus Lerdorf

RE:[PHP]PHP Hosting
97170 by: r

Re: Using function in PHP script n DOCROOT in PHP script in subfolder
97172 by: Phil Powell

PHP can't access txt files (but TCL can..??)
97173 by: Phil Powell
97174 by: Lars Torben Wilson
97175 by: Phil Powell

read all files in directory
97176 by: Andreas Indahl
97177 by: Rasmus Lerdorf
97178 by: Stuart Dallas
97180 by: Lars Torben Wilson
97181 by: olinux
97183 by: Lars Torben Wilson

Re: Best way for date/time
97179 by: olinux

Re: MySQL and RH 7.2
97182 by: David Freeman

Send html email
97184 by: Alex Shi
97185 by: Nookie
97186 by: Liam MacKenzie
97187 by: Michael Geier
97189 by: Alex Shi
97201 by: Miguel Cruz

preg_grep Help (Regular expresion)
97188 by: Brian C. Doyle

Authentication with register_globals OFF
97190 by: Mike P
97192 by: Stuart Dallas
97193 by: Mike P

Printing line x in a file
97191 by: Andrew Conner
97202 by: Miguel Cruz
97204 by: Austin Gonyou

Serialize/URLencode query...
97194 by: Glenn Sieb
97196 by: John Holmes
97199 by: Glenn Sieb

Yahoo/Cobalt servers/PHP
97195 by: Todd Cary
97197 by: John Holmes
97198 by: Austin Marshall

Re: setcookie()
97200 by: Miguel Cruz

[FYI] DNS resolver library
97203 by: Moriyoshi Koizumi

.vcf files and PHP Email Form(Newbie)
97205 by: webmaster.tececo.com
97206 by: Miguel Cruz
97210 by: webmaster.tececo.com

Variable Prob
97207 by: Jason Soza
97208 by: Miguel Cruz
97209 by: Jason Soza

Sending Html Pages
97211 by: Salman Ahmed

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

---BeginMessage---

i'm sweating on this one :

function sql_fetch_row($res, $nr)
{
global $dbtype;  
switch ($dbtype) {   
 
case MySQL:
$row = mysql_fetch_row($res);
return $row;
break;;
...
}

it iz used in a php_layer.php from phpnuke, but somehow it gives errors... if i put a 
@ like this:

$row = @mysql_fetch_row($res);

i get no errors, but no result either. Where stands the @ for? I can't find any info 
on thizz, what's wrong?

   [ProMoozz signature script initiated]
 [Sharon equalzz Hitler]
[msg written - msg read]
  [ProMoozz signature script terminated]
http://www.kotbelasting.be - http://www.kotbelasting.be

---End Message---
---BeginMessage---

Http://Www.Promoozz.Org wrote:
 i'm sweating on this one :
 
 function sql_fetch_row($res, $nr)
 {
 global $dbtype;  
 switch ($dbtype) {   
  
 case MySQL:
 $row = mysql_fetch_row($res);
 return $row;
 break;;
 ...
 }
 
 it iz used in a php_layer.php from phpnuke, but somehow it gives errors... if i put 
a @ like this:
 
 $row = @mysql_fetch_row($res);
 
 i get no errors, but no result either. Where stands the @ for? I can't find any info 
on thizz, what's wrong?
 
[ProMoozz signature script initiated]
  [Sharon equalzz Hitler]
 [msg written - msg read]
   [ProMoozz signature script terminated]
 http://www.kotbelasting.be - http://www.kotbelasting.be
 

First off, anyone using phpnuke is on their own, try phpnuke.org for 
help.  But an @ before a function suppresses error messages, it doesn't 
make errors go away, so it's doing precisely what it is supposed to.  I 
also see two ;'s in a row, perhaps that is the problem, or perhaps the 
query was bad and that renders fetch_row useless.

We or anyone would have a far better chance of helping out if you 
explained what the error is... it will be alot easier than debunking the 
  code of phpnuke on our own.




---End Message---
---BeginMessage---

Hi,

I've about had it with my current hosting company as they've turned off SSH 
for the past month due to security reasons which means I can no longer 
add/remove tables from my MySQL database.  Looking at two other hosting 
companies - SBC Webhosting - www.webhosting.com and Verio - www.verio.com

Does anyone here use either of these companies?  If so, could 

Re: [PHP] Sending Html Pages

2002-05-12 Thread Liam MacKenzie

If you read up about 10 messages you'll get the answer.
Also, RTFM.   (Don't ask what that means, because if you read up 10 messages
you'll find out)

http://www.php.net/manual/en/function.mail.php




- Original Message -
From: Salman Ahmed [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, May 12, 2002 9:25 PM
Subject: [PHP] Sending Html Pages


Hi,

I am trying to send html pages via email, that is instead of sending plain
text format to the client I am trying to send Rich Text using mail function
of PHP. At first I was sending

--
Hello Bob,

Thanks for downloading this from my site
--

BUT for Rich Text I am doing

--
!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'

html

head
meta content=text/html; charset=iso-8859-1 http-equiv=Content-Type
/head

body
div align=left
table border=0 cellpadding=10 cellspacing=0 width=500
tr
td
font face=Verdana size=2
Hi,
br
Thanks for downloading this from my site
/font
/td
/tr
/body
/html
--

But what happens is instead of sending html page it sends as a text with all
code displayed as it is without being parsed.

Please tell what can I do to send rich text emails as the this one u are
reading to the clients using PHP mail function.

Kind Regards
Salman




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] setcookie()

2002-05-12 Thread Olexandr Vynnychenko

Hello jtjohnston,

Saturday, May 11, 2002, 11:42:52 PM, you wrote:

j This is a bug Feature/Change Request I made to:
j http://bugs.php.net/bug.php?id=17158

j setcookie() states cookies must be sent before any other headers
j are sent (this is a restriction of cookies, not PHP).

j I argue this is a restriction of PHP, not cookies.

j Here is my proof:

j http://www.collegeSherbrooke.qc.ca/languesmodernes/cookie.htm

j I can do this any time in body :

j script
jsetCookie(TestCookie,first time,expdate);
jvar DisplayData = getCookie(TestCookie);
jdocument.write(DisplayData);
jsetCookie(TestCookie,second time,expdate);
jvar DisplayData = getCookie(TestCookie);
jdocument.write(DisplayData);
j  /script

j I want to be able to setcookie() anytime I want, before and after I
j declare any HTML.
j This will never get changed, unless we ask for it.

j I would appreciate your vote of support at:

j http://bugs.php.net/bug.php?id=17158

j before the bug people close this thread.

Are you kidding?



-- 
Best regards,
 Olexandrmailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] GD (Image generator) {?!}

2002-05-12 Thread Liam MacKenzie

Hi guys,

Got a little prob that's got me stumped.
This simple image generator script:
http://scripts.operationenigma.net/image_generator.php
Source: http://scripts.operationenigma.net/image_generator.phps
works, I know because it was working on my system before I recompiled PHP.
Feel free to have a play, but just clicking submit as-is should generate a
black box with the text in it.

Now, however, it doesn't work...
Here's my phpinfo():
http://scripts.operationenigma.net/phpinfo.php
It says GD's compiled in there, but it doesn't work!

Surely there's a logical explanation for this...
Any help is appreciated  :-)

Cheers,
Liam



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Apache rewrite engine and $REQUEST_URI

2002-05-12 Thread Jason Morehouse

$SCRIPT_URI works sweet.

-J

On Fri, 10 May 2002 02:47:39 +1200, Peterv wrote:

 Hi,
 I'm using apache rewrite and I need to get the URL that I see in the
 browser. When using $REQUEST_URI I get the page where the rewrite is
 being redirected to. How can I get my hands on the actual URL that I see
 in the browser?
 
 Thanks for any hints. I haven't coded for a while and am a bit out of
 it... Peter
 
--
 Jason Morehouse ([EMAIL PROTECTED])
 Netconcepts LTD, Auckland, New Zealand
 * Linux: because rebooting is for adding hardware.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Send html email

2002-05-12 Thread Thomas Seifert

On Sun, 12 May 2002 00:07:57 -0500 (CDT)
[EMAIL PROTECTED] (Miguel Cruz) wrote:

 On Sat, 11 May 2002, Alex Shi wrote:
  Thanks for all of you who answered my question. But another of
  my stupid question is: what is RTFM?
 
 RTFM == Read The Flurking Manual

Or Read the fine manual 

(or replace fine with every word which begins with f ;-)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: preg_grep Help (Regular expresion)

2002-05-12 Thread Jason Morehouse

$file needs to be an array:

$file = file(myfile.txt);

On Sun, 12 May 2002 12:56:08 +1200, Brian C. Doyle wrote:

 Hello all,
 
 I have a file that has ip address in it.. I need to pull those ip
 addresses out.
 Currently I am trying:
 
 $ips=preg_grep(/^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/,$file);
 print_r(array_values ($ips));
 
 And well i am getting nothing!
 
 Anyone?
 

-- 
 Jason Morehouse ([EMAIL PROTECTED])  
 Netconcepts LTD, Auckland, New Zealand
 - Linux: because rebooting is for adding hardware.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Raising a custom error -- how?

2002-05-12 Thread Sqlcoders.com Programming Dept

Hiya,
I want to be able to raise an error in some code I'm creating for reuse,
most parts of this code deals with errors and just uses defaults as
appropriate,
but I need to be able to raise an error that will stop the PHP script
interpreter and throw an error back to the developer.

I've tried searching the manual for user defined error, throw error,
raise error etc,
but I guess it's just one of those functions that it's hard to find without
already knowing where to find it.

Any help would be appreciated!,
Dw.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: preg_grep Help (Regular expresion)

2002-05-12 Thread Brian C. Doyle

Hello all,

I did foget to mention that I had $file as
$file=file(Status.htm);
and it reads the file as 1 line it seams.


At 11:31 PM 5/12/02 +1200, Jason Morehouse wrote:
$file needs to be an array:

 $file = file(myfile.txt);

On Sun, 12 May 2002 12:56:08 +1200, Brian C. Doyle wrote:

  Hello all,
 
  I have a file that has ip address in it.. I need to pull those ip
  addresses out.
  Currently I am trying:
 
  $ips=preg_grep(/^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/,$file);
  print_r(array_values ($ips));
 
  And well i am getting nothing!
 
  Anyone?


--
  Jason Morehouse ([EMAIL PROTECTED])
  Netconcepts LTD, Auckland, New Zealand
  - Linux: because rebooting is for adding hardware.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Raising a custom error -- how?

2002-05-12 Thread John Holmes

How about looking through the table of contents... ??

XXVII: Error Handling and Logging Functions

http://www.php.net/manual/en/ref.errorfunc.php

---John Holmes...

 -Original Message-
 From: Sqlcoders.com Programming Dept [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, May 12, 2002 5:55 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Raising a custom error -- how?
 
 Hiya,
 I want to be able to raise an error in some code I'm creating for
reuse,
 most parts of this code deals with errors and just uses defaults as
 appropriate,
 but I need to be able to raise an error that will stop the PHP script
 interpreter and throw an error back to the developer.
 
 I've tried searching the manual for user defined error, throw
error,
 raise error etc,
 but I guess it's just one of those functions that it's hard to find
 without
 already knowing where to find it.
 
 Any help would be appreciated!,
 Dw.
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] MySQL and RH 7.2

2002-05-12 Thread Chris Hewitt

Todd,

/usr/bin/mysqladmin

HTH
Chris

Todd Cary wrote:

I tried locate and find and both come up empty for mysqladmin.

Am I missing something stupid here?

Todd

--
Todd Cary
Ariste Software
2200 D Street Extension
Petaluma, CA 94952
707-773-4523
[EMAIL PROTECTED]






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] help with sort problem

2002-05-12 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi all, 
I hope someone might help me with a little puzzle...

I have bunch of db results and one of the fields is 'name', 
I want to see if there are 2 parts to it like FirstName LastName and if
so order by the last name.

I can see explode() being the php function I need here but am a little
lost as to what will happen if there is only one word in the name var.

If someone can suggest what I might do that would be great! 
many thanks...
- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE83pbjHpvrrTa6L5oRAv5XAJsFAXLb0puFyeknXoaGL7rYUHGxVACdHxt8
ej2/Y56p75z5jZ43DvSbDzo=
=8rzj
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] XML: Similiar Multiple Tags With Different Data

2002-05-12 Thread Sebastian A.

Hello
 I have recently been trying to parse an XML document that has different
content in the same tags. Here is an example:

LIST_ITEM1/LIST_ITEM
LIST_ITEM2/LIST_ITEM
LIST_ITEM3/LIST_ITEM
...

I am trying to get the content from LIST_ITEM into an array. I want the
content of the first LIST_ITEM to go into $p-ART_ID[0] and the next to go
into $p-ART_ID[1] and so on. Here is what my Element Content Function looks
like:

-

function elementContent($parser, $data, $attrs='') {
global $tag, $data, $test;
global $p;

$ti = sizeof( $tag ) - 1;


if ( $tag[$ti] == 'LIST_ITEM' ) {

$p-ART_ID[] .= $data;
}


}



When I type in echo $p-ART_ID[0]  I should get 1 however I get 1 2 3. For
some reason all the content goes only into one section of the array. Does
anyone know how I can fix this?


Thanks.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] random order

2002-05-12 Thread Jule

Hey guys and gals,
I have a problem: 
I have a mysql databse with 4 rows, and each row (row1, row2, row3, and row4) 
contains a sentence. now i want these sentences to appear in random order:
instance: 1 2etc.
 row2  row4
 row4  row2
 row1  row1
 row3  row3

how do i go about that??
any ideas apreciated.
thanks

Jule
-- 
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Your Open Source Projects wanted.

2002-05-12 Thread David Duong

Hello,

I'm David Duong of the CGI open source Foundry.  We are looking for a script
to produce.  If you have a good script an would like some programmers to
help develop it I invite you to visit http://cosf.sourceforge.net.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] help with sort problem

2002-05-12 Thread Jason Wong

On Monday 13 May 2002 00:23, Nick Wilson wrote:
 Hi all,
 I hope someone might help me with a little puzzle...

 I have bunch of db results and one of the fields is 'name',
 I want to see if there are 2 parts to it like FirstName LastName and if
 so order by the last name.

 I can see explode() being the php function I need here but am a little
 lost as to what will happen if there is only one word in the name var.

 If someone can suggest what I might do that would be great!
 many thanks...

Not knowing exactly what it is you want I'm assuming the following: if there 
is a lastname use that in the sort, otherwise use the firstname. Thus your 
sorted list will look something like:

  Bryan Adams (Adams, Bryan)
  Arnold
  Brian
  John Butcher (Butcher, John)

If that is what you want then:
while (names) {
  explode the name
  if there is more than one element swap it, then join
  add this processed name onto a new array
}

use one of the array sort functions to sort the new array.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Wagner's music is better than it sounds.
-- Mark Twain
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] MySQL and RH 7.2

2002-05-12 Thread Miguel Cruz

Also, try locate again now that it's been a day. The locate database 
usually gets updated overnight, so it doesn't immediately reflect new 
additions.

miguel

On Sun, 12 May 2002, Chris Hewitt wrote:
 Todd,
 
 /usr/bin/mysqladmin
 
 HTH
 Chris
 
 Todd Cary wrote:
 
 I tried locate and find and both come up empty for mysqladmin.
 
 Am I missing something stupid here?
 
 Todd
 
 --
 Todd Cary
 Ariste Software
 2200 D Street Extension
 Petaluma, CA 94952
 707-773-4523
 [EMAIL PROTECTED]
 
 
 
 
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Send html email

2002-05-12 Thread Jason Wong

On Sunday 12 May 2002 08:45, Michael Geier wrote:
 While I understand the necessity in not answering every question that a
 newbie may post, a more pleasant approach would have been:

 the following is documented at
 http://www.php.net/manual/en/function.mail.php; or
 see the Content-Type: header for instructions on how to do this.

 Do you think someone who won't read the docs, or search the archives, prior
 to the question understands what RTFM means?

One has to draw the line somewhere. We can't assume everytime that a newbie 
know absolutely nothing. I hope we can at least assume they know how to use a 
(THE) search engine:

google - rtfm

 RTFM
   ... RTFM /RTFM/ imp. [Unix] Abbreviation for `Read The Fucking
   Manual'. 1. Used by gurus to brush off questions they consider
   trivial or annoying. Compare Don't do ...

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Some circumstantial evidence is very strong, as when you find a trout in
the milk.
-- Thoreau
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Problem with new variable system in 4.2

2002-05-12 Thread andy

Hi there,

I did upgrade to 4.2 and now I am recoding :-(  my whole application.

So I did get behind the basic idea, but there is one case, where I just dont
know how to solve it:

Im a doing something similar like on php.net when you type in
php.net/functionname. In my .htaccess file I do redirect in case of a 404 to
a php page where I do redirect to a page called /profiles/8001.html
In the file profiles (which is a php file not a dir) I do grab the
8001.html and extract the 8001 to explode it into parameters. Then I
do grab the functionname (or in my case user name) to redirect him to the
propper site.

In php4.1.1 it worked fine. Now I changed the first function to:
 $PATH_INFO = $_SERVER[REQUEST_URI];  (was $PATH_INFO in 4.1.1)

The username was fetched in 4.1.1 with ( I know I have to change this as
well):
$parameter = explode('/', $REQUEST_URI);
$user_name = $parameter[1];

So now I do get as $PATH_INFO the username which is mixing up my whole idea!
How can I get both parameters like in good old former times :-)

Do u see my trouble?

I appreciate every help on that,

Thanx, Andy



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] random order

2002-05-12 Thread John Holmes

Nothing to do with PHP...

SELECT * FROM table ORDER BY RAND();

---John Holmes...

 -Original Message-
 From: Jule [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, May 12, 2002 9:49 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] random order
 
 Hey guys and gals,
 I have a problem:
 I have a mysql databse with 4 rows, and each row (row1, row2, row3,
and
 row4)
 contains a sentence. now i want these sentences to appear in random
order:
 instance: 1 2etc.
row2  row4
row4  row2
row1  row1
row3  row3
 
 how do i go about that??
 any ideas apreciated.
 thanks
 
 Jule
 --
 |\/\__/\/|
 |   Jule Slootbeek |
 |   [EMAIL PROTECTED]  |
 |   http://blindtheory.cjb.net |
 |   __ |
 |/\/\/\|
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Problem with new variable system in 4.2

2002-05-12 Thread andy

basicly this problem seems to result of the new way I do get the string from
the url

I used to get it with $PATH_INFO
Now I do a  $PATH_INFO = $_SERVER[REQUEST_URI];

which is not the same result.

Does anybody know a equal command for $PHP_INFO ?

ANdy


Andy [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi there,

 I did upgrade to 4.2 and now I am recoding :-(  my whole application.

 So I did get behind the basic idea, but there is one case, where I just
dont
 know how to solve it:

 Im a doing something similar like on php.net when you type in
 php.net/functionname. In my .htaccess file I do redirect in case of a 404
to
 a php page where I do redirect to a page called /profiles/8001.html
 In the file profiles (which is a php file not a dir) I do grab the
 8001.html and extract the 8001 to explode it into parameters. Then
I
 do grab the functionname (or in my case user name) to redirect him to the
 propper site.

 In php4.1.1 it worked fine. Now I changed the first function to:
  $PATH_INFO = $_SERVER[REQUEST_URI];  (was $PATH_INFO in 4.1.1)

 The username was fetched in 4.1.1 with ( I know I have to change this as
 well):
 $parameter = explode('/', $REQUEST_URI);
 $user_name = $parameter[1];

 So now I do get as $PATH_INFO the username which is mixing up my whole
idea!
 How can I get both parameters like in good old former times :-)

 Do u see my trouble?

 I appreciate every help on that,

 Thanx, Andy





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Is This Possible? (Database - PHP)

2002-05-12 Thread r

Hey there guys,
I have a slight problem which i could not solve via Java servlets and now
that I am migrating to PHP I was wondering if its possible...

I am hosting with a company that has given me a database (MySql) I am using
the database for all my apps which are only being accessed via my
servlets... I want to change that and convert all my servlets to PHP.
Being new to PHP i am sure to make a lot of mistakes and instead of
uploading my PHP page, getting errors/ redoing it, uploading etc I was kinda
hoping i could connect to the remote database via my local machine?
I already have PHP installed on my machine. on the remote host the
details are

Localhost
jimmy*** (Username)
gunsand* (Password)
umace_com (Database name)

Is this possible?
Any help and comments appreciated.
Cheers,
-Ryan

/* Whats the difference between the pope and your boss? The pope only wants
you to kiss his ring! */



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] help with sort problem

2002-05-12 Thread John Holmes

You really want to handle this in your database. If you need data to be
in two fields, first name and last name, then put it in your database
that way. Save yourself some time. How easy is it to just add another
text field in your form, and insert one more variable into the
database??? 

Whatever kind of hack you come up with in PHP is going to be a waste
of time and memory. 

---John Holmes...

 -Original Message-
 From: Nick Wilson [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, May 12, 2002 9:23 AM
 To: php-general
 Subject: [PHP] help with sort problem
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Hi all,
 I hope someone might help me with a little puzzle...
 
 I have bunch of db results and one of the fields is 'name',
 I want to see if there are 2 parts to it like FirstName LastName and
if
 so order by the last name.
 
 I can see explode() being the php function I need here but am a little
 lost as to what will happen if there is only one word in the name var.
 
 If someone can suggest what I might do that would be great!
 many thanks...
 - --
 Nick Wilson //  www.explodingnet.com
 
 
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)
 
 iD8DBQE83pbjHpvrrTa6L5oRAv5XAJsFAXLb0puFyeknXoaGL7rYUHGxVACdHxt8
 ej2/Y56p75z5jZ43DvSbDzo=
 =8rzj
 -END PGP SIGNATURE-
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Problem with new variable system in 4.2

2002-05-12 Thread Philip Olson


 In php4.1.1 it worked fine. Now I changed the first function to:
  $PATH_INFO = $_SERVER[REQUEST_URI];  (was $PATH_INFO in 4.1.1)

$PATH_INFO worked fine because register_globals was on 
which essentially created $PHP_INFO from $_SERVER['PHP_INFO'] 
so how about you do this:

  if (!ini_get('register_globals')) {
extract($HTTP_SERVER_VARS);
  }

So if register_globals = off, $PHP_INFO will exist as will 
all web server predefined variables, like $DOCUMENT_ROOT.

If you are unsure what predefined variable to use, make 
a call to phpinfo() and it'll show you exactly what is 
available to the script.  And print_r() will also be helpful 
for various activities too.

Regards,
Philip Olson


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Is This Possible? (Database - PHP)

2002-05-12 Thread Jason Wong

On Monday 13 May 2002 15:05, r wrote:
 Hey there guys,
 I have a slight problem which i could not solve via Java servlets and now
 that I am migrating to PHP I was wondering if its possible...

 I am hosting with a company that has given me a database (MySql) I am using
 the database for all my apps which are only being accessed via my
 servlets... I want to change that and convert all my servlets to PHP.
 Being new to PHP i am sure to make a lot of mistakes and instead of
 uploading my PHP page, getting errors/ redoing it, uploading etc I was
 kinda hoping i could connect to the remote database via my local machine? I
 already have PHP installed on my machine. on the remote host the
 details are

 Localhost
 jimmy*** (Username)
 gunsand* (Password)
 umace_com (Database name)

 Is this possible?

It depends on whether your hosting company allows remote connections to the 
mysql server. Speak to them.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
You can tell how far we have to go, when FORTRAN is the language of
supercomputers.
-- Steven Feiner
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Is This Possible? (Database - PHP)

2002-05-12 Thread John Holmes

Yes, it's certainly possible. You will have to talk your host into
giving you remote access though, which could be hard. 

How permissions work in MySQL is that your username is given permission
to connect from a specific host. Generally, the host is listed as
'localhost' meaning the script has to be on the same server as MySQL.
You can also have '%' as your host, meaning you can connect from
anywhere. Or, when your ISP assigns you an IP, the first 2 or 3 octets
are generally the same. So you could put something like '123.123.%' or
'123.123.123.%' in your host. 

You hosting provider, if they're any good, will know all about this.
It's hard to talk people into giving you access, though, because they
are generally pretty paranoid. 

---John Holmes...

 -Original Message-
 From: r [mailto:[EMAIL PROTECTED]]
 Sent: Monday, May 13, 2002 12:05 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Is This Possible? (Database - PHP)
 
 Hey there guys,
 I have a slight problem which i could not solve via Java servlets and
now
 that I am migrating to PHP I was wondering if its possible...
 
 I am hosting with a company that has given me a database (MySql) I am
 using
 the database for all my apps which are only being accessed via my
 servlets... I want to change that and convert all my servlets to
PHP.
 Being new to PHP i am sure to make a lot of mistakes and instead of
 uploading my PHP page, getting errors/ redoing it, uploading etc I was
 kinda
 hoping i could connect to the remote database via my local machine?
 I already have PHP installed on my machine. on the remote host the
 details are
 
 Localhost
 jimmy*** (Username)
 gunsand* (Password)
 umace_com (Database name)
 
 Is this possible?
 Any help and comments appreciated.
 Cheers,
 -Ryan
 
 /* Whats the difference between the pope and your boss? The pope only
 wants
 you to kiss his ring! */
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Problem with new variable system in 4.2

2002-05-12 Thread andy

thanx, this worked

Andy
Philip Olson [EMAIL PROTECTED] schrieb im Newsbeitrag
Pine.BSF.4.10.10205121820290.61243-10@localhost">news:Pine.BSF.4.10.10205121820290.61243-10@localhost...

  In php4.1.1 it worked fine. Now I changed the first function to:
   $PATH_INFO = $_SERVER[REQUEST_URI];  (was $PATH_INFO in 4.1.1)

 $PATH_INFO worked fine because register_globals was on
 which essentially created $PHP_INFO from $_SERVER['PHP_INFO']
 so how about you do this:

   if (!ini_get('register_globals')) {
 extract($HTTP_SERVER_VARS);
   }

 So if register_globals = off, $PHP_INFO will exist as will
 all web server predefined variables, like $DOCUMENT_ROOT.

 If you are unsure what predefined variable to use, make
 a call to phpinfo() and it'll show you exactly what is
 available to the script.  And print_r() will also be helpful
 for various activities too.

 Regards,
 Philip Olson




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Debugger

2002-05-12 Thread Michael Kimsal

Jose Leon wrote:

 
 It would be nice that php itself incoporates a system to debug php 
 programs, like in PHP 3, in that way a development tool for php would 
 be enabled to debug modifying the php.ini with debug.enabled=true and 
 listening to a port. The system will work on any php distribution 
 because will be part of php itself. Why the debugger was removed from 
 PHP 3?


I think it's pretty obvious it was removed during the PHP4
development so that Zend would have a 'value add' to sell later.

That's the cynical part of me answering, obviously, and I've
never heard an answer one way or another why it was removed,
but the timing seems pretty remarkable.

Michael Kimsal
http://www.logicreate.com
734-480-9961


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: To all who replied to :Newbie question to everybody...PHP

2002-05-12 Thread Michael Kimsal

R wrote:
 Hey Guys,
 I thank each and everyone one of you who replied, yeah, i got flamed a
 couple of times from some of you for the sleep bit but need i remind you
 that i am a newbie?


You didn't get flamed because you're a newbie, you got flamed
because it appeared you didn't do ANY research at all - you have
a book but didn't seem to read it (I'd guess there's at least a mention
of it there) but more importantly you didn't seem to even hit a basic
search engine.  Search google.com or the php.net site for 'sleep' and 
you'd have gotten exactly what you were looking for. You may have well 
asked if PHP has a way to do something if a condition is true.

Abstract issues about arrays are a bit harder to get across in a search 
engine, because you're not looking for syntax but perhaps more a 
tutorial (I'd guess searching for 'php array tutorial' would net you 
exactly what you want though too).

Use search engines first - you're bounch to find exactly what you're 
looking for in a fraction of a time it takes people multiple people to 
read and respond, then for you to get those responses.



Michael Kimsal
http://www.logicreate.com
734-480-9961




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] help with sort problem

2002-05-12 Thread Jason Soza

I actually asked this same type of question not too long ago. Just separate
the name field into first_name and last_name - it'll be better in the long
run. It's not as hard as it sounds - dump your table, use some program that
will read comma delimited stuff and export as tab-delimited (I used Excel),
separate the first and last names, modify your table to have the correct
columns, clear it, add the data back in (LOAD DATA...)

It may require some modification of your scripts you already have, but
really it's just much cleaner this way. I didn't want to do it simply
because I was lazy and using PHP to do this for me seemed to be the easier
choice. It's not, and doing it that way is far from efficient.

HTH,

Jason Soza

-Original Message-
From: John Holmes [mailto:[EMAIL PROTECTED]]
Sent: Sunday, May 12, 2002 1:26 PM
To: 'PHP-General'
Subject: RE: [PHP] help with sort problem


You really want to handle this in your database. If you need data to be
in two fields, first name and last name, then put it in your database
that way. Save yourself some time. How easy is it to just add another
text field in your form, and insert one more variable into the
database???

Whatever kind of hack you come up with in PHP is going to be a waste
of time and memory.

---John Holmes...

 -Original Message-
 From: Nick Wilson [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, May 12, 2002 9:23 AM
 To: php-general
 Subject: [PHP] help with sort problem

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hi all,
 I hope someone might help me with a little puzzle...

 I have bunch of db results and one of the fields is 'name',
 I want to see if there are 2 parts to it like FirstName LastName and
if
 so order by the last name.

 I can see explode() being the php function I need here but am a little
 lost as to what will happen if there is only one word in the name var.

 If someone can suggest what I might do that would be great!
 many thanks...
 - --
 Nick Wilson //  www.explodingnet.com



 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)

 iD8DBQE83pbjHpvrrTa6L5oRAv5XAJsFAXLb0puFyeknXoaGL7rYUHGxVACdHxt8
 ej2/Y56p75z5jZ43DvSbDzo=
 =8rzj
 -END PGP SIGNATURE-


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] random order

2002-05-12 Thread Jule

hmm it got a little more complicated now,
i have a table with: id title question answer1 answer2 answer3 answer4.
how can i use all of those in a php page but only randomize the answers?

so i get

title   title

questionquestion

answer3 answer4
answer2 answer1
answer4 answer3
answer1 answer2

any ideas?
thanks,

Jule
On Sunday 12 May 2002 17:30, you wrote:
 Add on a LIMIT to restrict it to return a certain number of rows.

 If you had a table of say, 100 rows, and you wanted four random ones out
 of the 100, then you'd use this:

 SELECT * FROM table ORDER BY RAND() LIMIT 4;

 ---John Holmes...

  -Original Message-
  From: Jule [mailto:[EMAIL PROTECTED]]
  Sent: Sunday, May 12, 2002 11:22 AM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] random order
 
  Thanks John,
  I thought that that command only selected a random row..
  must've read wrong.
  thanks.
 
  Jule
 
  On Sunday 12 May 2002 17:21, you wrote:
   Nothing to do with PHP...
  
   SELECT * FROM table ORDER BY RAND();
  
   ---John Holmes...
  
-Original Message-
From: Jule [mailto:[EMAIL PROTECTED]]
Sent: Sunday, May 12, 2002 9:49 AM
To: [EMAIL PROTECTED]
Subject: [PHP] random order
   
Hey guys and gals,
I have a problem:
I have a mysql databse with 4 rows, and each row (row1, row2,

 row3,

   and
  
row4)
contains a sentence. now i want these sentences to appear in

 random

   order:
instance: 1 2etc.
 row2  row4
 row4  row2
 row1  row1
 row3  row3
   
how do i go about that??
any ideas apreciated.
thanks
   
Jule
--
   
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 
  --
 
  |\/\__/\/|
  |   Jule Slootbeek   |
  |   [EMAIL PROTECTED]|
  |   http://blindtheory.cjb.net   |
  |   __   |
  |/\/  \/\|

-- 
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] E-mail Confirmation script?

2002-05-12 Thread Andre Dubuc

I've looked about for an 'Email Confirmation' script that many sites use for 
verifcation of wannabee new members. That is, the person subscribes, is sent 
a 'confirmation' number to which they must have in the 'Subject' area of 
their reply. 

I would like to implement this on my site, but I haven't discovered a source 
for a script, or how to go about doing it. That is, how do you retrieve items 
from an incoming e-mail, and is it possible to parse the same?

If anyone who has seen such a script could point me to where I could find 
one, I would greatly appreciate it, or in the Manual, what it would be listed 
under. The 'mail()' function doesn't seem to include how to access received 
e-mails, and to parse individual copmponents of a message.

Btw, does anyone know what's up with the 'Search' function of the PHP-general 
lst? It always seems to be 'offline'. Rather hard to search the archives for 
previously asked questions.

Tia, 
Andre


-- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the Holy Souls in Purgatory.

May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP Boolean Interpreter - Need to search a mySQL database

2002-05-12 Thread SpamSucks86

I was wondering if anyone knew of any good Boolean interpreters (NOT,
AND, OR, +, -, |, )? I've found three, but they're VERY buggy and I
wouldn't put them into production. Frankly, I don't have the time,
patience, or ability to write a good one from scratch. Here are the
three I've found in case anyone's interested:
 
http://www.evolt.org/article/Boolean_Fulltext_Searching_with_PHP_and_MyS
QL/18/15665/index.html
http://www.phpbuilder.com/snippet/detail.php?type=snippet
http://www.phpbuilder.com/snippet/detail.php?type=snippetid=474
id=474
http://sourceforge.net/projects/phpsqlbool/
 
Thanks to anyone and everyone! =)



RE: [PHP] E-mail Confirmation script?

2002-05-12 Thread SP

I would suggest just sending them an email with a
link like this and telling them to click on it to
confirm their membership.

http://www.mysite.com/confirm.php?uniqueid=2i3k238
s9sd0s99d

The confirm.php page would look up the uniqueid
and try to find it in your database.  If it's
there then that means the email address they gave
you exists and they have access to that email
account cuz they know that uniqueid.

After confirming, you could send a welcome user
email and include another link that they can use
for all other account management like
unsubscribing, changing password, changing
personal info ...

http://www.mysite.com/account.php




-Original Message-
From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
Sent: May 12, 2002 4:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] E-mail Confirmation script?


I've looked about for an 'Email Confirmation'
script that many sites use for
verifcation of wannabee new members. That is, the
person subscribes, is sent
a 'confirmation' number to which they must have in
the 'Subject' area of
their reply.

I would like to implement this on my site, but I
haven't discovered a source
for a script, or how to go about doing it. That
is, how do you retrieve items
from an incoming e-mail, and is it possible to
parse the same?

If anyone who has seen such a script could point
me to where I could find
one, I would greatly appreciate it, or in the
Manual, what it would be listed
under. The 'mail()' function doesn't seem to
include how to access received
e-mails, and to parse individual copmponents of a
message.

Btw, does anyone know what's up with the 'Search'
function of the PHP-general
lst? It always seems to be 'offline'. Rather hard
to search the archives for
previously asked questions.

Tia,
Andre


--
Please pray the Holy Rosary to end the holocaust
of abortion.
Remember in your prayers the Holy Souls in
Purgatory.

May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet:
http://www.webhart.net/csrb/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] E-mail Confirmation script?

2002-05-12 Thread Andre Dubuc

Thanks,

Now why didn't that ever occur to me? It's simple and very effective.
Thanks for the idea! 

Regards,
Andre


On Sunday 12 May 2002 04:51 pm, you wrote:
 I would suggest just sending them an email with a
 link like this and telling them to click on it to
 confirm their membership.

 http://www.mysite.com/confirm.php?uniqueid=2i3k238
 s9sd0s99d

 The confirm.php page would look up the uniqueid
 and try to find it in your database.  If it's
 there then that means the email address they gave
 you exists and they have access to that email
 account cuz they know that uniqueid.

 After confirming, you could send a welcome user
 email and include another link that they can use
 for all other account management like
 unsubscribing, changing password, changing
 personal info ...

 http://www.mysite.com/account.php




 -Original Message-
 From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
 Sent: May 12, 2002 4:36 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] E-mail Confirmation script?


 I've looked about for an 'Email Confirmation'
 script that many sites use for
 verifcation of wannabee new members. That is, the
 person subscribes, is sent
 a 'confirmation' number to which they must have in
 the 'Subject' area of
 their reply.

 I would like to implement this on my site, but I
 haven't discovered a source
 for a script, or how to go about doing it. That
 is, how do you retrieve items
 from an incoming e-mail, and is it possible to
 parse the same?

 If anyone who has seen such a script could point
 me to where I could find
 one, I would greatly appreciate it, or in the
 Manual, what it would be listed
 under. The 'mail()' function doesn't seem to
 include how to access received
 e-mails, and to parse individual copmponents of a
 message.

 Btw, does anyone know what's up with the 'Search'
 function of the PHP-general
 lst? It always seems to be 'offline'. Rather hard
 to search the archives for
 previously asked questions.

 Tia,
 Andre

-- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the Holy Souls in Purgatory.

May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] E-mail Confirmation script?

2002-05-12 Thread r

Hey,
Why dont you just add a link to a script and validate it like that?
eg:
Click below to confirm you email id
**
http://yoursite.tld/confirm.php?[EMAIL PROTECTED]confirmno=5675678
**

Once you get the confirm id and no just check it within your database and
flag it as true.
Simple.

I have been using the above example for yearsthough not in PHP, but i'm
sure it will work.

Cheers,
-Ryan

/*A conclusion is the place where you got tired of thinking.*/








- Original Message -
From: Andre Dubuc [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, May 12, 2002 1:36 PM
Subject: [PHP] E-mail Confirmation script?


 I've looked about for an 'Email Confirmation' script that many sites use
for
 verifcation of wannabee new members. That is, the person subscribes, is
sent
 a 'confirmation' number to which they must have in the 'Subject' area of
 their reply.

 I would like to implement this on my site, but I haven't discovered a
source
 for a script, or how to go about doing it. That is, how do you retrieve
items
 from an incoming e-mail, and is it possible to parse the same?

 If anyone who has seen such a script could point me to where I could find
 one, I would greatly appreciate it, or in the Manual, what it would be
listed
 under. The 'mail()' function doesn't seem to include how to access
received
 e-mails, and to parse individual copmponents of a message.

 Btw, does anyone know what's up with the 'Search' function of the
PHP-general
 lst? It always seems to be 'offline'. Rather hard to search the archives
for
 previously asked questions.

 Tia,
 Andre


 --
 Please pray the Holy Rosary to end the holocaust of abortion.
 Remember in your prayers the Holy Souls in Purgatory.

 May God bless you abundantly in His love!
 For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] help with sort problem

2002-05-12 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then John Holmes declared
 Whatever kind of hack you come up with in PHP is going to be a waste
 of time and memory. 

Depends on your view point, the client was happy with one field for the
name and now wants the records returned sorted by last name. Bastard.
There is loads of stuff to edit in the 'admin' program and it's
interaction with other tables and processes in the site so the PHP fix
was actually simpler.

Cheers...
- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE83tmtHpvrrTa6L5oRAlgcAKCu8NX7YxiCR7TNpOjJH7zoN6cuZQCfU4X/
UQL3OADFu+TALFr+FOnpdEE=
=QbVn
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] help with sort problem

2002-05-12 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Jason Wong declared
 If that is what you want then:
 while (names) {
   explode the name
   if there is more than one element swap it, then join
   add this processed name onto a new array
 }
 
 use one of the array sort functions to sort the new array.

Yep, cheers Jason, here's what I came up with 

function sort_teachers() {

global $teach;

$array_2_sort=array();

foreach($teach-list_teachers() as $key = $val) {
$split=explode( , $val[name]);
$array_2_sort[$key]=end($split);
}
asort($array_2_sort);
return($array_2_sort);
}
- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE83toJHpvrrTa6L5oRApkiAJ0YwgusbS4uBaJWOo2eory16FnM7ACfcPS0
JXjm2JXTWeN22KTs7dJwrWI=
=Z7zE
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] E-mail Confirmation script?

2002-05-12 Thread SP

Just make sure the url fits on one line in the
email which mine doesn't.

-Original Message-
From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
Sent: May 12, 2002 5:06 PM
To: SP
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] E-mail Confirmation script?


Thanks,

Now why didn't that ever occur to me? It's simple
and very effective.
Thanks for the idea!

Regards,
Andre


On Sunday 12 May 2002 04:51 pm, you wrote:
 I would suggest just sending them an email with
a
 link like this and telling them to click on it
to
 confirm their membership.


http://www.mysite.com/confirm.php?uniqueid=2i3k238
 s9sd0s99d

 The confirm.php page would look up the uniqueid
 and try to find it in your database.  If it's
 there then that means the email address they
gave
 you exists and they have access to that email
 account cuz they know that uniqueid.

 After confirming, you could send a welcome
user
 email and include another link that they can use
 for all other account management like
 unsubscribing, changing password, changing
 personal info ...

 http://www.mysite.com/account.php




 -Original Message-
 From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
 Sent: May 12, 2002 4:36 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] E-mail Confirmation script?


 I've looked about for an 'Email Confirmation'
 script that many sites use for
 verifcation of wannabee new members. That is,
the
 person subscribes, is sent
 a 'confirmation' number to which they must have
in
 the 'Subject' area of
 their reply.

 I would like to implement this on my site, but I
 haven't discovered a source
 for a script, or how to go about doing it. That
 is, how do you retrieve items
 from an incoming e-mail, and is it possible to
 parse the same?

 If anyone who has seen such a script could point
 me to where I could find
 one, I would greatly appreciate it, or in the
 Manual, what it would be listed
 under. The 'mail()' function doesn't seem to
 include how to access received
 e-mails, and to parse individual copmponents of
a
 message.

 Btw, does anyone know what's up with the
'Search'
 function of the PHP-general
 lst? It always seems to be 'offline'. Rather
hard
 to search the archives for
 previously asked questions.

 Tia,
 Andre

--
Please pray the Holy Rosary to end the holocaust
of abortion.
Remember in your prayers the Holy Souls in
Purgatory.

May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet:
http://www.webhart.net/csrb/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Debugger

2002-05-12 Thread Rasmus Lerdorf

That's just not the case.  The debugger in PHP 3 would not work at all in
PHP 4 and would need a complete rewrite.  So, being cynical you might say
that someone should have written a debugger for PHP 4 and the fact that
nobody did was the conspiracy, but it makes no sense to say it was removed
for conspiracy reasons.  I mean if the PHP 3 debugging code worked with
PHP 4, then you could just take the code from PHP 3 and use it.  It's not
like it is deleted from CVS.

-Rasmus

On Sun, 12 May 2002, Michael Kimsal wrote:

 Jose Leon wrote:

 
  It would be nice that php itself incoporates a system to debug php
  programs, like in PHP 3, in that way a development tool for php would
  be enabled to debug modifying the php.ini with debug.enabled=true and
  listening to a port. The system will work on any php distribution
  because will be part of php itself. Why the debugger was removed from
  PHP 3?


 I think it's pretty obvious it was removed during the PHP4
 development so that Zend would have a 'value add' to sell later.

 That's the cynical part of me answering, obviously, and I've
 never heard an answer one way or another why it was removed,
 but the timing seems pretty remarkable.

 Michael Kimsal
 http://www.logicreate.com
 734-480-9961


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] XML: Similiar Multiple Tags With Different Data

2002-05-12 Thread Kjartan Mannes

Sunday, May 12, 2002, 6:39:31 PM, Sebastian A. wrote:
 Hello
  I have recently been trying to parse an XML document that has different
 content in the same tags. Here is an example:

 LIST_ITEM1/LIST_ITEM
 LIST_ITEM2/LIST_ITEM
 LIST_ITEM3/LIST_ITEM
 ...

 I am trying to get the content from LIST_ITEM into an array. I want the
 content of the first LIST_ITEM to go into $p-ART_ID[0] and the next to go
 into $p-ART_ID[1] and so on. Here is what my Element Content Function looks
 like:

Without the rest of the code I would suspect this to work:

function elementContent($parser, $data, $attrs='') {
global $tag, $p;

$ti = sizeof( $tag ) - 1;

if ( $tag[$ti] == 'LIST_ITEM' ) {
$p-ART_ID[] = $data;
}
}

Basically when you are assigning content to a new part of the array you
don't use .= but just =

-- 
Kjartan [EMAIL PROTECTED] (http://natrak.net/)
:: A program is a spell cast over a computer, turning input
into error messages.
:: Drupal (www.drupal.org)



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] php script for backlinks?

2002-05-12 Thread PeterV

http://www.iawiki.net/ReferrerLinking
I'm looking for existing PHP scripts that generate a list of pages linking 
to your page. Anything already written out there?
Thanks,
Peter



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Debugger

2002-05-12 Thread Michael Kimsal

Rasmus Lerdorf wrote:
 That's just not the case.  The debugger in PHP 3 would not work at all in
 PHP 4 and would need a complete rewrite.  So, being cynical you might say
 that someone should have written a debugger for PHP 4 and the fact that
 nobody did was the conspiracy, but it makes no sense to say it was removed
 for conspiracy reasons.  I mean if the PHP 3 debugging code worked with
 PHP 4, then you could just take the code from PHP 3 and use it.  It's not
 like it is deleted from CVS.
 


I'll stand corrected on that.  I'd not looked at the code closely enough 
to know if there were major compatibility problems.

Are there any movements to get things like the stack trace module and 
the Russian dbg debugger module into the standard PHP distribution?

If there was at least some links on the PHP.net site, that would help
people to know they're available.







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: an sql_layer

2002-05-12 Thread M.oozzuzz ([-_-])

tnx for the response,

it was the query which caused the errors (wrong result-link).

grtzz,
me.
   [ProMoozz signature script initiated]
 [Sharon equalzz Hitler]
[msg written - msg read]
  [ProMoozz signature script terminated]
http://www.kotbelasting.be - http://www.kotbelasting.be
- Oorspronkelijk bericht -
Van: Austin Marshall [EMAIL PROTECTED]
Aan: Http://Www.Promoozz.Org; [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Verzonden: zaterdag 11 mei 2002 23:41
Onderwerp: Re: an sql_layer


Http://Www.Promoozz.Org wrote:
 i'm sweating on this one :

 function sql_fetch_row($res, $nr)
 {
 global $dbtype;
 switch ($dbtype) {

 case MySQL:
 $row = mysql_fetch_row($res);
 return $row;
 break;;
 ...
 }

 it iz used in a php_layer.php from phpnuke, but somehow it gives errors... if
i put a @ like this:

 $row = @mysql_fetch_row($res);

 i get no errors, but no result either. Where stands the @ for? I can't find
any info on thizz, what's wrong?

[ProMoozz signature script initiated]
  [Sharon equalzz Hitler]
 [msg written - msg read]
   [ProMoozz signature script terminated]
 http://www.kotbelasting.be - http://www.kotbelasting.be


First off, anyone using phpnuke is on their own, try phpnuke.org for
help.  But an @ before a function suppresses error messages, it doesn't
make errors go away, so it's doing precisely what it is supposed to.  I
also see two ;'s in a row, perhaps that is the problem, or perhaps the
query was bad and that renders fetch_row useless.

We or anyone would have a far better chance of helping out if you
explained what the error is... it will be alot easier than debunking the
  code of phpnuke on our own.







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: PHP Hosting ...

2002-05-12 Thread Matthew Ward

Instead of switching hosting companies, why don't you just install
phpMyAdmin on your webspace, that way you can control your mySQL databases
in a far more user-friendly way than SSH will let you do

Tim Thorburn [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 I've about had it with my current hosting company as they've turned off
SSH
 for the past month due to security reasons which means I can no longer
 add/remove tables from my MySQL database.  Looking at two other hosting
 companies - SBC Webhosting - www.webhosting.com and Verio - www.verio.com

 Does anyone here use either of these companies?  If so, could you please
 let me know your opinions of each?

 Thanks
 -Tim





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] MySQL and RH 7.2

2002-05-12 Thread Jason Morehouse

Check to see that you have the mysql client package installed:

`rpm -q MySQL-client`

If not, grab it!
-J

On Sun, 12 May 2002, Chris Hewitt wrote:

 Todd,
 
 /usr/bin/mysqladmin
 
 HTH
 Chris
 
 Todd Cary wrote:
 
 I tried locate and find and both come up empty for mysqladmin.
 
 Am I missing something stupid here?
 
 Todd
 
 --
 Todd Cary
 Ariste Software
 2200 D Street Extension
 Petaluma, CA 94952
 707-773-4523
 [EMAIL PROTECTED]
 
 
 
 
 
 
 

-- 

.--- .- ... --- -. /  -- --- .-. .  --- ..- ... .

 Jason Morehouse
 [EMAIL PROTECTED]
 
 Netconcepts LTD
 Auckland, New Zealand

 - Linux: free your mind and your OS will follow


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] using cookies and flash problem

2002-05-12 Thread Deadsam

I'm having a problem with using cookies and flash, I'm new to php so it's
more then likely my coding, I have a forum made from flash/php/mysql, and
I'm trying to use cookies for the username and password so they dont have to
log in, I have manage to create the cookies no problem, its the rest thats
wrong, I'll post the code to read the cookies:
?
$time = (time() + 3600 * 24 * 30 * 12);
$cookiepath = /;
$cookiedomain = www.deadsam.com;
$cookiesecure = false;
setcookie(username, $username, $time, $cookiepath, $cookiedomain,
$cookiesecure);
setcookie(password, $password, $time, $cookiepath, $cookiedomain,
$cookiesecure);


//get number of set cookies
$cookieCount = count($HTTP_COOKIE_VARS);

//if more than 1 cookie
if ($cookieCount  0) {
//Loop through all the cookies...
foreach($HTTP_COOKIE_VARS as $cookieName = $cookieValue){
//output name and value
print $cookiename=$cookieValue;
}
} else {
//otherwise out no cookies
print userStatus=you are not logged in;
}
?

In flash I used a loadVariableNum(http://www.deadsam.com/cookiescript.php;,
this, POST);

I keep getting errors with this.
If anyone has an answer to this I'd appreciate it very much.
Thank you in advance
Deadsam



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] random order

2002-05-12 Thread David Freeman


  hmm it got a little more complicated now,
  i have a table with: id title question answer1 answer2 
  answer3 answer4. how can i use all of those in a php page 
  but only randomize the answers?

You have multiple questions with the same answers?  Then split your
table into two tables and put all your answers in one and your questions
in the other.  Then include another table that contains question and
answer id equivalents.

CYA, Dave



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] random order

2002-05-12 Thread David Freeman


  I have a mysql databse with 4 rows, and each row (row1, 
  row2, row3, and row4) 
  contains a sentence. now i want these sentences to appear in 
  random order:

I've always found mysql's RAND() function to be of use.  Specifically:

SELECT * FROM MyTable WHERE Some='Condition' ORDER BY RAND() LIMIT 4

CYA, Dave



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Search Engine With Boolean Support --Please help

2002-05-12 Thread Matthew Ward

This is a bit of a tricky one, as a search engine isn't just some 10 line
code you can quickly type and expect to work. It'd be quite complex, because
you have to run several queries for each of the boolean types, and you also
have to account somehow for case-sensitivity.

I'm currently working on a search engine to incorporate into my Content
Management System (more info at http://www.inspirationstudios.co.uk/dot/cms)
that incorporates all your requirements so I'll get back to you with some
more coding info once I've worked on it there.

Spamsucks86 [EMAIL PROTECTED] wrote in message
01c1f924$1b35bcd0$ea553944@cc1966780a">news:01c1f924$1b35bcd0$ea553944@cc1966780a...
 I don't want to use a module though. I just want to take what a person
 types and parse it so I can put it into a mysql query and search my
 database of data. I share the server and I can't get mnoGoSearch
 compiled in with PHP, so unless there's PHP code I can borrow from it, I
 don't think it will help me.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Stronge Session Variable Problem with PopUP windows

2002-05-12 Thread Dennis Moore



I am running mod PHP 4.0.6 with Apache 
1.3x.

I am using session variables to pass various access 
information. Everything works like a charm until I popup a new window 
using Javascript. The session variable is set but to the wrong 
value. 

Has anyone else run into this issue or have any 
ideas?

TIA 
/dkm


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


php-general Digest 12 May 2002 22:31:35 -0000 Issue 1341

2002-05-12 Thread php-general-digest-help


php-general Digest 12 May 2002 22:31:35 - Issue 1341

Topics (messages 97212 through 97262):

Re: Sending Html Pages
97212 by: Liam MacKenzie

Re: setcookie()
97213 by: Olexandr Vynnychenko

GD (Image generator) {?!}
97214 by: Liam MacKenzie

Re: Apache rewrite engine and $REQUEST_URI
97215 by: Jason Morehouse

Re: Send html email
97216 by: Thomas Seifert
97228 by: Jason Wong

Re: preg_grep Help (Regular expresion)
97217 by: Jason Morehouse
97219 by: Brian C. Doyle

Raising a custom error -- how?
97218 by: Sqlcoders.com Programming Dept
97220 by: John Holmes

Re: MySQL and RH 7.2
97221 by: Chris Hewitt
97227 by: Miguel Cruz
97257 by: Jason Morehouse

help with sort problem
97222 by: Nick Wilson
97226 by: Jason Wong
97233 by: John Holmes
97240 by: Jason Soza
97247 by: Nick Wilson
97248 by: Nick Wilson
97249 by: Nick Wilson

Re: Similiar Multiple Tags With Different Data
97223 by: Sebastian A.
97252 by: Kjartan Mannes

random order
97224 by: Jule
97230 by: John Holmes
97241 by: Jule
97259 by: David Freeman
97260 by: David Freeman

Your Open Source Projects wanted.
97225 by: David Duong

Problem with new variable system in 4.2
97229 by: andy
97231 by: andy
97234 by: Philip Olson
97237 by: andy

Is This Possible? (Database - PHP)
97232 by: r
97235 by: Jason Wong
97236 by: John Holmes

Re: Debugger
97238 by: Michael Kimsal
97251 by: Rasmus Lerdorf
97254 by: Michael Kimsal

Re: To all who replied to :Newbie question to everybody...PHP
97239 by: Michael Kimsal

E-mail Confirmation script?
97242 by: Andre Dubuc
97244 by: SP
97245 by: Andre Dubuc
97246 by: r
97250 by: SP

PHP Boolean Interpreter - Need to search a mySQL database
97243 by: SpamSucks86

php script for backlinks?
97253 by: PeterV

Re: an sql_layer
97255 by: M.oozzuzz ([-_-])

Re: PHP Hosting ...
97256 by: Matthew Ward

using cookies and flash problem
97258 by: Deadsam

Re: Search Engine With Boolean Support --Please help
97261 by: Matthew Ward

Stronge Session Variable Problem with PopUP windows
97262 by: Dennis Moore

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

---BeginMessage---

If you read up about 10 messages you'll get the answer.
Also, RTFM.   (Don't ask what that means, because if you read up 10 messages
you'll find out)

http://www.php.net/manual/en/function.mail.php




- Original Message -
From: Salman Ahmed [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, May 12, 2002 9:25 PM
Subject: [PHP] Sending Html Pages


Hi,

I am trying to send html pages via email, that is instead of sending plain
text format to the client I am trying to send Rich Text using mail function
of PHP. At first I was sending

--
Hello Bob,

Thanks for downloading this from my site
--

BUT for Rich Text I am doing

--
!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'

html

head
meta content=text/html; charset=iso-8859-1 http-equiv=Content-Type
/head

body
div align=left
table border=0 cellpadding=10 cellspacing=0 width=500
tr
td
font face=Verdana size=2
Hi,
br
Thanks for downloading this from my site
/font
/td
/tr
/body
/html
--

But what happens is instead of sending html page it sends as a text with all
code displayed as it is without being parsed.

Please tell what can I do to send rich text emails as the this one u are
reading to the clients using PHP mail function.

Kind Regards
Salman




---End Message---
---BeginMessage---

Hello jtjohnston,

Saturday, May 11, 2002, 11:42:52 PM, you wrote:

j This is a bug Feature/Change Request I made to:
j http://bugs.php.net/bug.php?id=17158

j setcookie() states cookies must be sent before any other headers
j are sent (this is a restriction of cookies, not PHP).

j I argue this is a restriction of PHP, not cookies.

j Here is my proof:

j http://www.collegeSherbrooke.qc.ca/languesmodernes/cookie.htm

j I can do this any time in body :

j script
jsetCookie(TestCookie,first time,expdate);
jvar DisplayData = getCookie(TestCookie);
jdocument.write(DisplayData);
jsetCookie(TestCookie,second time,expdate);
jvar DisplayData = getCookie(TestCookie);
jdocument.write(DisplayData);
j  /script

j I want to be able to setcookie() anytime I want, before and after I
j declare any HTML.
j This will never get changed, unless we ask for it.

j I would 

RE: [PHP] Search Engine With Boolean Support --Please help

2002-05-12 Thread Miguel Cruz

Well, a search engine is not a trivial proposition. If you just have a few
hundred records without huge amounts of text, you can build SQL queries
and it's no big deal.

But if you expect it to scale, you need to turn the problem upside down 
and index the words. This means you build a table of words and a table 
that cross-references the word table to your text by saying which word 
appears at which position in which item. Every time you insert text, you 
update these other two tables accordingly. Then you can easily query 
against them to find any combination of words without waiting for it to 
crawl through all the text in your database. 

I don't know whether there's available PHP code, but it's a 
well-understood problem that has been solved countless times before, so 
you should be able to find a book that breaks it down into pseudocode you 
can rewrite as PHP. Or maybe you'll find something pre-made. How useful 
that will be depends on how peculiar your requirements are.

miguel

On Sat, 11 May 2002, SpamSucks86 wrote:
 I don't want to use a module though. I just want to take what a person
 types and parse it so I can put it into a mysql query and search my
 database of data. I share the server and I can't get mnoGoSearch
 compiled in with PHP, so unless there's PHP code I can borrow from it, I
 don't think it will help me.
 
 -Original Message-
 From: Miguel Cruz [mailto:[EMAIL PROTECTED]] 
 Sent: Saturday, May 11, 2002 2:23 PM
 To: SpamSucks86
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Search Engine With Boolean Support --Please help
 
 On Sat, 11 May 2002, SpamSucks86 wrote:
  I need to have an internal search engine for my site. It needs to
  support Boolean (not, or, and). Are there any fairly simple scripts
 out
  there that will help me with this? Even if it's just to give me an
 idea
  of where to start. I'm using mySQL, and Boolean support isn't
  implemented until v4.0. Thanks for any and all help! =)
 
 Have a look at http://mnogosearch.ru/
 
 and the accompanying functions in the PHP manual.
 
 miguel
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] forever cookie

2002-05-12 Thread Larry Linthicum

is it possible to set a cookie that never expires?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: forever cookie

2002-05-12 Thread Austin Marshall

Larry Linthicum wrote:
 is it possible to set a cookie that never expires?
 
 

Not really, but be realistic.  If you want a cookie that lasts longer 
than what seems reasonable give it a lifetime of a year or longer.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Printing line x in a file

2002-05-12 Thread Thalis A. Kalfigopoulos

If the file is relatively small, then the easiest would be to use file() which reads a 
file into an array

$file_array=file($filename);
$text=$file_array[$line];

cheers,
thalis


On Sat, 11 May 2002, Andrew Conner wrote:

 I have a script where I need to get the text from line number $line in
 file $filename then save it to a var ($text) and then print it. For
 example, in the file lamb.txt (just an example file):
 Mary was
 a little lamb, whose
 fleece
 was as
 white as snow.
 I need to get line number 3 (fleece) and print it (print $text).
 How would I go about this?
 
 Andrew Conner
 (All apologies if this messes up and does a multi-post)
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] protecting downloads with php

2002-05-12 Thread Peter H. Lemieux

It can be tricky to write download wrappers that work with all browsers.
Some versions of Internet Explorer seem especially troublesome.

I've found wrappers like these seem to work fairly well:

initialization();
authorization($user,$pw);
$info=get_file_info($filepointer);
### SEND HEADERS ###
header(Content-Type: .$info[mimetype]);
header(Content-Disposition: inline; filename=.$info[filename]);
### NO TEXT CAN BE ECHOED BEFORE HERE ###

### Open the file and display it
$fp=fopen($filepath./.$info[filename],r);
fpassthru($fp);
fclose($fp);

### END

A few observations:

PHP will complain if you send any text to the browser before calling
header() (since HTTP headers can't be sent once the data segment begins).
Sometimes this problem can be hard to track down.  I've left invisible
whitespace after the closing ? tag in a file included above the calls to
the header function().  The PHP parser naturally views this whitespace as
HTML content and echoes it to the browser.

The filename portion of the second header usually points to the name of
the file itself without any leading path component.

Some versions of Internet Explorer fail to initiate the download unless a
separate window is opened.

Most modern *nix systems have a mime.types file.  A quick scan of one
RedHat Linux 7.1 machine finds the Apache mime.types file stored as
/etc/mime.types along with some sample mime.types files installed by
applications like lynx and mutt.  The file is delimited by white space
(usually a tab) between the type and list of extensions making it easy to
write a function that converts it into an array $mimetype[$extension].

If you collect inbound files by mail (as I do) or by HTTP upload, you'll
find the file's MIME type in the session headers.  Since most people's
mail or web client runs on the same machine as their application, these
headers are usually pretty accurate.

Peter


- Original Message -
From: Nick Wilson [EMAIL PROTECTED]
To: php-general [EMAIL PROTECTED]
Sent: Saturday, May 11, 2002 4:58 AM
Subject: [PHP] protecting downloads with php


 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hi all
 I've been asked to protect an area containing 'course material' (pdf's
 etc) and have just thought of a gaping hole in what I've done.

 I use an class to handle all the auth stuff and each page checks the
 value of $obj-logged_in :: No problem.

 but what if someone links to www.thesite/theProtectedArea/file.tar.gz

 that file cannot check if the downloader is logged in can it.

 So, any suggestions or words of wisdom would be much appreciated :-)

 - --
 Nick Wilson //  www.explodingnet.com



 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)

 iD8DBQE83N09HpvrrTa6L5oRAlSZAJwNVHXfeP3w8aaJTtRUmPH2v/nvNwCfaqp4
 HpXVvWLn87rkhCQxnBtszAc=
 =St/c
 -END PGP SIGNATURE-

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Generate inline image

2002-05-12 Thread Engineering Software Center


Hi:
How do I generate gif inline images using PHP's image functions using GD
libs.  Everything I have seen so far requires a header before generating
the image.  But I want the image embedded into a table with other
texts.  Thank you for the help.

Frank


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP Boolean Interpreter - Need to search a mySQLdatabase

2002-05-12 Thread Richard Archer

At 4:50 PM -0400 12/5/02, SpamSucks86 wrote:

I was wondering if anyone knew of any good Boolean interpreters (NOT,
AND, OR, +, -, |, )? I've found three, but they're VERY buggy and I
wouldn't put them into production. Frankly, I don't have the time,
patience, or ability to write a good one from scratch. Here are the
three I've found in case anyone's interested:

http://www.evolt.org/article/Boolean_Fulltext_Searching_with_PHP_and_MySQL/18/15665/index.html


Thanks for that link... that's a great piece of code!

With error reporting cranked right up it throws a few warnings,
but no errors. It certainly performs as described.

The only thing it doesn't seem to do is check for +.
But adding that is a 30 second task.

If this isn't good enough for you, just what are you looking for?

 ...R.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] sessions

2002-05-12 Thread Jas

I am a little confused on how to keep a variable registered on more than one
page.  For example you log into a page which queries the database.  Form
code is as follows...
?php
session_start();
?
html
body bgcolor=#FF text=#00
?php print(session_id()); ?
form name=login method=post action=auth_done.php
User Name:
  input type=text name=u_name maxlength=25
Password:
  input type=password name=p_word maxlength=25
input type=submit name=login value=login
/form
/body
/html
The auth_done.php then checks to see if the user entered anything for the
username and password and if it doesnt it will re-direct them to the login
page.  If the un and pw has been entered it will then query the database for
a valid entry, code is as follows...
?php
if ((!$u_name) || (!$p_word)){
 header(Location: index.php);
 exit;
}
$db_name = authentication;
$table_name = accounts;
$connection = mysql_connect(localhost,,) or die(Could not connect to
Database, please try again later);
$db = mysql_select_db($db_name, $connection) or die(Could not select
Database, please try again later);
$sql = SELECT * from $table_name
WHERE u_name = \$u_name\ AND p_wordd = password(\$p_word\);
$result = mysql_query($sql,$connection) or die(Couldn't execute query);
$num = mysql_numrows($result);
if ($num !=0) {
$msg = p class=\content\You have been authorized to make changes to the
web site./p;
session_is_registered('u_name');
session_is_registered('p_word');
session_start();
} else {
header(Location: index.php);
exit;
}
?
html
body bgcolor=#FF text=#00
?php echo $msg; ?br
?php print (session_id()); ?br
?php echo $u_name; ?br
?php echo $p_word; ?br
?php print (session_is_registered('u_name')); ?br
?php print (session_is_registered('p_word')); ?br
a href=edit.phpedit pages/a
/body
/html
The problem I am having is if the user clicks the link for edit.php the
session variables u_name and p_word are not being passed and I can't do
any other checking with out that.  Please help, good tutorials on this are
very appreciated!
Thanks in advance,
Jas



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] header problems

2002-05-12 Thread baldey_uk

Hi all,

Can anyone tell me if there is any reason why this would not be working?

mysql_connect($DBhost,$DBuser,$DBpass) or die(header(Location:
error.php));

What im trying to do is connect to the database and if that fails send the
browser to the error page. But the browser just sits there on the page that
fails to connect Thanks for any advice/help in advance

Cheers From

baldey_uk



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] header problems

2002-05-12 Thread Jason Murray

 Can anyone tell me if there is any reason why this would not 
 be working?
 
 mysql_connect($DBhost,$DBuser,$DBpass) or die(header(Location:
 error.php));

Why bother calling die() at all there?

?
   if ($mysql != mysql_connect($DBhost,$DBuser,$DBpass))
   {
 Header(Location: error.php);
 Exit();
   }
?

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Generate inline image

2002-05-12 Thread Justin French

Your IMG tag calls a script (imagemaker.php) which generates the image for
you the parent script (eg home.php) doesn't generate the image inline,
to the best of my knowledge.

Justin French


on 13/05/02 10:01 AM, Engineering Software Center
([EMAIL PROTECTED]) wrote:

 
 Hi:
 How do I generate gif inline images using PHP's image functions using GD
 libs.  Everything I have seen so far requires a header before generating
 the image.  But I want the image embedded into a table with other
 texts.  Thank you for the help.
 
 Frank
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Generate inline image

2002-05-12 Thread Martin Towell

HTML docs only contain text. If you want images inline then you use the
img tag.

-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 10:31 AM
To: [EMAIL PROTECTED]; php
Subject: Re: [PHP] Generate inline image


Your IMG tag calls a script (imagemaker.php) which generates the image for
you the parent script (eg home.php) doesn't generate the image inline,
to the best of my knowledge.

Justin French


on 13/05/02 10:01 AM, Engineering Software Center
([EMAIL PROTECTED]) wrote:

 
 Hi:
 How do I generate gif inline images using PHP's image functions using GD
 libs.  Everything I have seen so far requires a header before generating
 the image.  But I want the image embedded into a table with other
 texts.  Thank you for the help.
 
 Frank
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] How can obtain referer's name?

2002-05-12 Thread Alex Shi

Hi!

I want to know how can a script obtain the page name where 
it was linked. e.g., there's a link on page.html, and the link 
points to script.php, how can script.php know the name of
page.html? Thanks in advance for all answer!

Alex

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] How can obtain referer's name?

2002-05-12 Thread Martin Towell

if you have the globals setting in your ini file set to on then you can
use: $HTTP_REFERER
otherwise, I think, it's found in $_SERVER[HTTP_REFERER] - just check for
something like that in phpinfo();

-Original Message-
From: Alex Shi [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 10:48 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How can obtain referer's name?


Hi!

I want to know how can a script obtain the page name where 
it was linked. e.g., there's a link on page.html, and the link 
points to script.php, how can script.php know the name of
page.html? Thanks in advance for all answer!

Alex

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: MySQL or FlatFile

2002-05-12 Thread David Duong

I am referring to whole PHP/Perl files.  It is necessary to load them as
much as 20+ times within the same hour what would be better MySql or
Flatfile?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] restricting extentions at install

2002-05-12 Thread Andrew DeFever

Just would like to know how you restrict php to certain extentions before
you compile.

/=\
/ Andrew DeFever  \
/ Terraworld Inc. \
/ 888 332 1616\
/=\


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Re: MySQL or FlatFile

2002-05-12 Thread Martin Towell

If the content is going to be the same each time, then loading from a
flat-file would probably be better, because accessing a database would
require the connection to be established, the database to parse and execute
your query, then send that data back. Where as reading from the file, it's
just open file, read file, close file, a lot quicker.

-Original Message-
From: David Duong [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 10:46 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: MySQL or FlatFile


I am referring to whole PHP/Perl files.  It is necessary to load them as
much as 20+ times within the same hour what would be better MySql or
Flatfile?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] How can obtain referer's name?

2002-05-12 Thread Richard Archer

At 10:49 AM +1000 13/5/02, Martin Towell wrote:
if you have the globals setting in your ini file set to on then you can
use: $HTTP_REFERER

Watch out though... the HTTP_REFERER data is provided by the user
and cannot be trusted. It can't even be guaranteed to exist.

If all the pages are on the same site, you could embed the form
filename in a hidden field on the form so it is passed to the script.

Or since that's also open to abuse by malicious users, you could
track where the user is in the site using session variables.

 ...R.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] sessions

2002-05-12 Thread Chris Knipe

Ok,

Let's see if I learned anything


- Original Message -
From: Jas [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, May 13, 2002 2:30 AM
Subject: [PHP] sessions


SNIP
 $msg = p class=\content\You have been authorized to make changes to
the
 web site./p;
 session_is_registered('u_name');
 session_is_registered('p_word');

$_SESSION['u_name'] = $u_name;
$_SESSION['p_word'] = $p_word;

 session_start();

^^ Not to sure if you need this again, I doub't it.

 } else {
 header(Location: index.php);
 exit;
 }
 ?
 html
 body bgcolor=#FF text=#00
 ?php echo $msg; ?br
 ?php print (session_id()); ?br
 ?php echo $u_name; ?br
 ?php echo $p_word; ?br
 ?php print (session_is_registered('u_name')); ?br
 ?php print (session_is_registered('p_word')); ?br

print ($_SESSION['u_name']);
print ($_SESSION['p_word']);



Syntax has not been double checked, so there might be a few errors, but you
should be using $_SESSION['varname']; :)

See, I actually do learn things aswell over time :)   Thanks again for
everyone who has helped me!!!  My next set of questions will prob be on
GDLib (I can feel this coming)...

--
me




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] How can obtain referer's name?

2002-05-12 Thread Philip Olson


 if you have the globals setting in your ini file set to on 
 then you can use: $HTTP_REFERER otherwise, I think, it's found 
 in $_SERVER[HTTP_REFERER] - just check for something like 
 that in phpinfo();

Just to be picky, predefined reserved server variables will 
always exist in both $HTTP_SERVER_VARS and $_SERVER.  So, 
everyone could go through one of these predefined variables 
regardless of the register_globals value.

Of course HTTP_REFERER may or may not exist.  And $_SERVER 
became available in PHP 4.1.0.  $HTTP_SERVER_VARS has been 
around since the 90's :)

A related faqt on HTTP_REFERER in PHP can be seen here:

  Why does $HTTP_REFERER return an empty string?
  http://www.faqts.com/knowledge_base/view.phtml/aid/31

So regarding the question, do something like so 
in script.php

  print $_SERVER['HTTP_REFERER'];
  print $HTTP_SERVER_VARS['HTTP_REFERER'];

Personally I love registering server vars in the 
scope and many times will do this (on top of the 
script):

  if (!ini_get('register_globals')) {
  extract($HTTP_SERVER_VARS);
  }

In this case, it's safe to use $HTTP_REFERER even if 
register_globals = off as it will then be created.

See also:
  http://www.php.net/manual/en/language.variables.predefined.php

Regards,
Philip Olson


 -Original Message-
 From: Alex Shi [mailto:[EMAIL PROTECTED]]
 Sent: Monday, May 13, 2002 10:48 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] How can obtain referer's name?
 
 
 Hi!
 
 I want to know how can a script obtain the page name where 
 it was linked. e.g., there's a link on page.html, and the link 
 points to script.php, how can script.php know the name of
 page.html? Thanks in advance for all answer!
 
 Alex
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: PhpMyAdmin

2002-05-12 Thread David Robley

In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 I am using the latest phpMyAdmin and MySQL 2.23.37.   I have installed and
 compiled it on a Sun Cobalt RAQ4r.  I need to have it set up so that
 customers with different websites cannot see or work on other cutomers DB's,
 but each virtual site has its one phpMyAdmin
 
 So each user needs to have his own phpMyAdmin to work in with his own DB's.
 
 Can anyone please explain how this is done.  If this is the wrong list I
 apologize but I did not know which one to post to.  If it si the wrong list
 does any one know of a phpMyAdmin list.
 
 Any help would be really great.  I'll even throw in a free web hosting
 account.
 
 Bernie--

I think you need to set the 

$cfgServers[1]['only_db'] = '';  // If set to a db-name, only this db is 
accessible

line in their respective config.inc.php and of course have the appropriate 
grants set on the various dbs.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Generate inline image

2002-05-12 Thread David Freeman


  How do I generate gif inline images using PHP's image 
  functions using GD libs.  Everything I have seen so far 
  requires a header before generating the image.  But I want 
  the image embedded into a table with other texts.  Thank you 
  for the help.

Write the php to generate the image as a separate file.  Then call that
file from an image tag.

Eg. img src=generate_image.php

CYA, Dave



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] GD (Image generator) {!?}

2002-05-12 Thread Liam MacKenzie

Hi guys,

Got a little prob that's got me stumped.
This simple image generator script:
http://scripts.operationenigma.net/image_generator.php
Source: http://scripts.operationenigma.net/image_generator.phps
works, I know because it was working on my system before I recompiled PHP.
Feel free to have a play, but just clicking submit as-is should generate a
black box with the text in it.

Now, however, it doesn't work...
Here's my phpinfo():
http://scripts.operationenigma.net/phpinfo.php
It says GD's compiled in there, but it doesn't work!

Surely there's a logical explanation for this...
Any help is appreciated  :-)

Cheers,
Liam


P.S.  Resent this cause the first one bounced, I think...



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: function over loading?

2002-05-12 Thread Smileyq

In article 
[EMAIL PROTECTED],
 [EMAIL PROTECTED] (Kris Vose) wrote:

 Can you practice function over-loading in php?
  
 Kris

No you cannot overload in PHP.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Re: function over loading?

2002-05-12 Thread Jason Murray

  Can you practice function over-loading in php?
 
 No you cannot overload in PHP.

You can achieve the same effect (having the same function do
something else in a different circumstance) by making
parameters optional:

?
   Function functionName($param1, $param2 = )
   {
 ...
   }
?

$param1 is required, $param2 is optional - if its not
supplied when the function is called, it will be .

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: function over loading?

2002-05-12 Thread Rasmus Lerdorf

Well, not in the procedural sense, but you can do method and property
overloading on objects.  See http://php.net/overload

-Rasmus

On Sun, 12 May 2002, Smileyq wrote:

 In article
 [EMAIL PROTECTED],
  [EMAIL PROTECTED] (Kris Vose) wrote:

  Can you practice function over-loading in php?
 
  Kris

 No you cannot overload in PHP.

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Header function not working header('Window-target: _top');

2002-05-12 Thread Michael P. Carel

Hi to all,

Sorry for bringing back this type of topic, But this type of header call
really doesnt work for me here. I've tested many time's the example below
that was given by Dan but it really doesnt work. Im already using php4.2 in
apache 1.3.24 . Based on the example below i've just removed/uncomment the
header function for left.php to test if it realy jump out of the frame.

Is there any idea why header('Window-target: _top'); doesnt work for me.
Please help.



Regards,
Mike

- Original Message -
From: Analysis  Solutions [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Sent: Friday, March 15, 2002 11:27 PM
Subject: Re: [PHP] Targetted redirection?


 Hi Folks:

 Okay, here's what I'm talking about...  A sample system.  Four files.

 index.php main page holding the frameset.  frameset has two
   frames.  one on left.  one on right.
 left.php  navigation menu that goes in the left hand frame
 right.php content in right hand frame.  this page is the default
   one that comes up in the initial frameset.
 right2.phpanother page for the right hand frame


 * index.php **

 ?php
 #   This has no effect.
 #   header('Window-target: _top');
 ?

 html
 headtitleindex page/title/head
 frameset COLS=120,*
 FRAME SRC=left.php name=menu scrolling=no
 frame src=right.php name=content
 /frameset
 /html


 * left.php **

 ?php
 #   Turning this on will jump this page out of the frames.
header('Window-target: _top');
 ?

 htmlheadtitlethe menu/title/headbody
 a href=right.php target=contentright/a
 br /a href=right2.php target=contentright 2/a
 /body/html


 * right.php **

 ?php
 #   Turning this on will jump this page out of the frames.
 #   header('Window-target: _top');
 ?

 HTMLHEADTITLERight/TITLE/HEADBODY
 Hi there. This is the main content page in the right frame.
 /BODY/HTML


 * right2.php **

 ?php
 #  This has no effect.
 #  header('Window-target: _top');
 ?

 HTMLHEADTITLERight 2/TITLE/HEADBODY
 Hi there. This is the secondary content page in the right frame.
 /BODY/HTML



 Now, put all those files on your machine.  Hit index.php and you'll see
 everything normally.  Then, uncomment the header function in left.php or
 right.php and you'll see that page jump out of the frames.  But, turn
 the header on in index.php or index2.php and you'll still be in the
 frames.

 Enjoy,

 --Dan

 --
 PHP scripts that make your job easier
   http://www.analysisandsolutions.com/code/
  SQL Solution  |  Layout Solution  |  Form Solution
  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Getting substring of text for first paragraph

2002-05-12 Thread Steven Jarvis

I want to do the following:

Big chunk of text is stored in variable $a. Paragraph breaks are 
signalled by two line breaks.

I want to just extract the first paragraph (i.e., all the text up to the 
first set of two line breaks) from $a.

How would I do this?

I tried exploding $a into an array, then doing a while loop inside a for 
loop, but it was taking WAY too long to execute (it was timing out).

Is there an easy way to do this that I'm just overlooking?

Thanks,

Steven


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Getting substring of text for first paragraph

2002-05-12 Thread Miguel Cruz

On Sun, 12 May 2002, Steven Jarvis wrote:
 I want to do the following:
 
 Big chunk of text is stored in variable $a. Paragraph breaks are 
 signalled by two line breaks.

How big is big? 100 lines? 10,000 lines? 1,000,000 lines?

 I want to just extract the first paragraph (i.e., all the text up to the 
 first set of two line breaks) from $a.
 
 How would I do this?
 
 I tried exploding $a into an array, then doing a while loop inside a for 
 loop, but it was taking WAY too long to execute (it was timing out).
 
 Is there an easy way to do this that I'm just overlooking?

The easiest would be

  $first_graf = substr($big_text, 0, strpos($big_text, \n\n));

The manual is your friend. There's a function for almost anything. While 
you are eating your corn flakes in the morning you should be reading 
through them and filing them away in your brain.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: WELCOME to php-general@lists.php.net

2002-05-12 Thread Manisha

I am having a form, I want to write the form values into csv file.

I just want to know whether it is necessary (compulsory) to have file lock 
before writing to file?

There is only my program which is writing in the file - no other program. 
But many users can connect to web at a time - So is it necessary to have 
file lock ?

thanks in advance
manisha


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: function over loading?

2002-05-12 Thread Miguel Cruz

On Sun, 12 May 2002, Smileyq wrote:
 [EMAIL PROTECTED] (Kris Vose) wrote:
 Can you practice function over-loading in php?

 No you cannot overload in PHP.

In a particularly masochistic project, we achieved function overloading by 
creating a global array $F that linked public to hidden names of all our 
functions. To overload, just change the hidden name.

  $F['list_items'] = 'main_list_items';

Then later, if we wanted to overload list_items, just do

  $F['list_items'] = 'substitute_list_items';

This functions would be called like:

  $F['list_items']($param1, $param2, $etc);

It worked fine but sure took some getting used to.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: WELCOME to php-general@lists.php.net

2002-05-12 Thread Miguel Cruz

On Mon, 13 May 2002, Manisha wrote:
 I am having a form, I want to write the form values into csv file.
 
 I just want to know whether it is necessary (compulsory) to have file lock 
 before writing to file?
 
 There is only my program which is writing in the file - no other program. 
 But many users can connect to web at a time - So is it necessary to have 
 file lock ?

It is definitely a good idea if you don't want corruption. You may find a 
database is easier in the long run.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: WELCOME to php-general@lists.php.net

2002-05-12 Thread Manisha

At 10:06 PM 5/12/02 -0500, Miguel Cruz wrote:

  I just want to know whether it is necessary (compulsory) to have file lock
  before writing to file?
 

It is definitely a good idea if you don't want corruption. You may find a
database is easier in the long run.


Do you mean to say that even if it is not compulsory - it is advisable to 
do so ?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] random order

2002-05-12 Thread John Holmes

I don't know if this will work or not, but try

SELECT * FROM table ORDER BY id, RAND();

That should keep all of the questions and answers together, but give a
random order for the answers.. ?? Like I said, not exactly sure on it
though.

Best option, like someone else said, is to split this up into two
tables. 

---John Holmes...

 -Original Message-
 From: Jule [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, May 12, 2002 1:28 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Subject: Re: [PHP] random order
 
 hmm it got a little more complicated now,
 i have a table with: id title question answer1 answer2 answer3
answer4.
 how can i use all of those in a php page but only randomize the
answers?
 
 so i get
 
 title title
 
 question  question
 
 answer3   answer4
 answer2   answer1
 answer4   answer3
 answer1   answer2
 
 any ideas?
 thanks,
 
 Jule
 On Sunday 12 May 2002 17:30, you wrote:
  Add on a LIMIT to restrict it to return a certain number of rows.
 
  If you had a table of say, 100 rows, and you wanted four random ones
out
  of the 100, then you'd use this:
 
  SELECT * FROM table ORDER BY RAND() LIMIT 4;
 
  ---John Holmes...
 
   -Original Message-
   From: Jule [mailto:[EMAIL PROTECTED]]
   Sent: Sunday, May 12, 2002 11:22 AM
   To: [EMAIL PROTECTED]
   Subject: Re: [PHP] random order
  
   Thanks John,
   I thought that that command only selected a random row..
   must've read wrong.
   thanks.
  
   Jule
  
   On Sunday 12 May 2002 17:21, you wrote:
Nothing to do with PHP...
   
SELECT * FROM table ORDER BY RAND();
   
---John Holmes...
   
 -Original Message-
 From: Jule [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, May 12, 2002 9:49 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] random order

 Hey guys and gals,
 I have a problem:
 I have a mysql databse with 4 rows, and each row (row1, row2,
 
  row3,
 
and
   
 row4)
 contains a sentence. now i want these sentences to appear in
 
  random
 
order:
 instance: 1 2etc.
row2  row4
row4  row2
row1  row1
row3  row3

 how do i go about that??
 any ideas apreciated.
 thanks

 Jule
 --

 |\/\__/\/|
 |   Jule Slootbeek |
 |   [EMAIL PROTECTED]  |
 |   http://blindtheory.cjb.net |
 |   __ |
 |/\/\/\|

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
  
   --
  
   |\/\__/\/|
   |   Jule Slootbeek |
   |   [EMAIL PROTECTED]  |
   |   http://blindtheory.cjb.net |
   |   __ |
   |/\/\/\|
 
 --
 |\/\__/\/|
 |   Jule Slootbeek |
 |   [EMAIL PROTECTED]  |
 |   http://blindtheory.cjb.net |
 |   __ |
 |/\/\/\|


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] inserting data to mutliple mysql tables

2002-05-12 Thread Peter

Hi,

I have a table that's full of references to indexs in other tables if I want
to insert a new record do I have to make a script to insert into all the
tables ie:

insert script for table 1
insert script for table 2
insert script for table 3
insert script for table 4

or can I have it all in one insert statement like you can with the SELECT
statement ie

INSERT INTO table1, table2, table3, table4 (blah, blah1, blah2, blah3,
blah4, blah5) VALUES('$blah', '$blah1', '$blah2', '$blah3', '$blah4',
'$blah5');


and if i can do it that way how do i get the table referencing the indexes
to show the reference number rather than the actual inputted data ie: say
table1 is the reference table and table 2 is the table that matches up the
username with the real name where i want the actual full information to be
stored.

eg table 1

id userid
1 10

table 2

id username nameid
10 boo 15

table 3

id name extra fields in here
15 bob Smith

now when i add a new record I want table one to be have the new userid added
to it table 2 to have the full user name matched to their nameid inserted
and table 3 to get the full name of the person...

any ideas?

Cheers

Peter
the only dumb question is the one that wasn't asked



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: WELCOME to php-general@lists.php.net

2002-05-12 Thread Miguel Cruz

On Mon, 13 May 2002, Manisha wrote:
 At 10:06 PM 5/12/02 -0500, Miguel Cruz wrote:
 I just want to know whether it is necessary (compulsory) to have file lock
 before writing to file?

 It is definitely a good idea if you don't want corruption. You may find
 a database is easier in the long run.
 
 Do you mean to say that even if it is not compulsory - it is advisable to 
 do so ?

Yes, because otherwise you may have processes overwriting each others' 
data.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] inserting data to mutliple mysql tables

2002-05-12 Thread Martin Towell

Isn't this more of a database question than a PHP question?

-Original Message-
From: Peter [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 1:38 PM
To: Php
Subject: [PHP] inserting data to mutliple mysql tables


Hi,

I have a table that's full of references to indexs in other tables if I want
to insert a new record do I have to make a script to insert into all the
tables ie:

insert script for table 1
insert script for table 2
insert script for table 3
insert script for table 4

or can I have it all in one insert statement like you can with the SELECT
statement ie

INSERT INTO table1, table2, table3, table4 (blah, blah1, blah2, blah3,
blah4, blah5) VALUES('$blah', '$blah1', '$blah2', '$blah3', '$blah4',
'$blah5');


and if i can do it that way how do i get the table referencing the indexes
to show the reference number rather than the actual inputted data ie: say
table1 is the reference table and table 2 is the table that matches up the
username with the real name where i want the actual full information to be
stored.

eg table 1

id userid
1 10

table 2

id username nameid
10 boo 15

table 3

id name extra fields in here
15 bob Smith

now when i add a new record I want table one to be have the new userid added
to it table 2 to have the full user name matched to their nameid inserted
and table 3 to get the full name of the person...

any ideas?

Cheers

Peter
the only dumb question is the one that wasn't asked



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] inserting data to mutliple mysql tables

2002-05-12 Thread Miguel Cruz

This is a MySQL question, not a PHP question.

Anyway, with MySQL you can't do this as a single operation. Do your
inserts one after the other.  You can use mysql_insert_id() after each one
to get the value of an auto_increment field that was created, and feed
that into your next SQL statement.

miguel

On Mon, 13 May 2002, Peter wrote:
 I have a table that's full of references to indexs in other tables if I want
 to insert a new record do I have to make a script to insert into all the
 tables ie:
 
 insert script for table 1
 insert script for table 2
 insert script for table 3
 insert script for table 4
 
 or can I have it all in one insert statement like you can with the SELECT
 statement ie
 
 INSERT INTO table1, table2, table3, table4 (blah, blah1, blah2, blah3,
 blah4, blah5) VALUES('$blah', '$blah1', '$blah2', '$blah3', '$blah4',
 '$blah5');
 
 
 and if i can do it that way how do i get the table referencing the indexes
 to show the reference number rather than the actual inputted data ie: say
 table1 is the reference table and table 2 is the table that matches up the
 username with the real name where i want the actual full information to be
 stored.
 
 eg table 1
 
 id userid
 1 10
 
 table 2
 
 id username nameid
 10 boo 15
 
 table 3
 
 id name extra fields in here
 15 bob Smith
 
 now when i add a new record I want table one to be have the new userid added
 to it table 2 to have the full user name matched to their nameid inserted
 and table 3 to get the full name of the person...
 
 any ideas?
 
 Cheers
 
 Peter
 the only dumb question is the one that wasn't asked
 
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: WELCOME to php-general@lists.php.net

2002-05-12 Thread Manisha

Thanks Miguel,

Manisha




At 10:38 PM 5/12/02 -0500, Miguel Cruz wrote:
On Mon, 13 May 2002, Manisha wrote:
  At 10:06 PM 5/12/02 -0500, Miguel Cruz wrote:
  I just want to know whether it is necessary (compulsory) to have file 
 lock
  before writing to file?
 
  It is definitely a good idea if you don't want corruption. You may find
  a database is easier in the long run.
 
  Do you mean to say that even if it is not compulsory - it is advisable to
  do so ?

Yes, because otherwise you may have processes overwriting each others'
data.

miguel


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] inserting data to mutliple mysql tables

2002-05-12 Thread John Holmes

You have to do separate inserts...you can't JOIN inserts like that...

---John Holmes...

 -Original Message-
 From: Peter [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, May 12, 2002 8:38 PM
 To: Php
 Subject: [PHP] inserting data to mutliple mysql tables
 
 Hi,
 
 I have a table that's full of references to indexs in other tables if
I
 want
 to insert a new record do I have to make a script to insert into all
the
 tables ie:
 
 insert script for table 1
 insert script for table 2
 insert script for table 3
 insert script for table 4
 
 or can I have it all in one insert statement like you can with the
SELECT
 statement ie
 
 INSERT INTO table1, table2, table3, table4 (blah, blah1, blah2, blah3,
 blah4, blah5) VALUES('$blah', '$blah1', '$blah2', '$blah3', '$blah4',
 '$blah5');
 
 
 and if i can do it that way how do i get the table referencing the
indexes
 to show the reference number rather than the actual inputted data ie:
say
 table1 is the reference table and table 2 is the table that matches up
the
 username with the real name where i want the actual full information
to be
 stored.
 
 eg table 1
 
 id userid
 1 10
 
 table 2
 
 id username nameid
 10 boo 15
 
 table 3
 
 id name extra fields in here
 15 bob Smith
 
 now when i add a new record I want table one to be have the new userid
 added
 to it table 2 to have the full user name matched to their nameid
inserted
 and table 3 to get the full name of the person...
 
 any ideas?
 
 Cheers
 
 Peter
 the only dumb question is the one that wasn't asked
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




  1   2   >