Re[2]: [PHP] Spam Bots/E-mail Addys

2002-06-13 Thread Stuart Dallas

On Thursday, June 13, 2002 at 6:30:11 PM, you wrote:
 So basically, to keep the address away from bots, keep it away from
 normal users. Okay, so something like this would be more effective:

 Have a form with a hidden input of the user's alias, and an input of E-
 mail me!, that form posts to an email.php script that uses the user's 
 alias to pull the e-mail address out of the db and I suppose I could 
 use JavaScript to popup a new window to enter the text of the e-mail 
 and use mail() to send. Would displaying the e-mail address in that new 
 window again be just as bad as displaying it on the main page?

 I realize this isn't a new idea, but I'm assuming it's more secure than 
 just keeping a mailto:[EMAIL PROTECTED] link around.

Yes, that's one common way to 'hide' the email addresses.

-- 
Stuart


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




[PHP] [arrays] reading from a form.

2002-06-13 Thread Àlex Camps

I have a example.html
---
script
function add()
{
 var res=0;
 for(x=0;x3;x++)res=res+parseFloat(example.text[x].value);
 example.result.value=res;
}
/script
html
form name=example action=show.php
 input type=text name=text value=1br
 input type=text name=text value=2br
 input type=text name=text value=3br
 input type=text name=result value=0br
 input type=button value=add OnClick=add()
 input type=submit value=show
/form
/html
---
and show.php
---
html
?
echo $text[0].+.$text[1].+.$text[2].=;
echo $result;
?
/html

PHP return the error:
Notice: Uninitialized string offset: 1 in show.php on line 4

How could I know the values of the text? without modify example.html







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




Re: [PHP] [arrays] reading from a form.

2002-06-13 Thread Stuart Dallas

On Thursday, June 13, 2002 at 6:38:10 PM, you wrote:
 I have a example.html
 ---
 script
 function add()
 {
  var res=0;
  for(x=0;x3;x++)res=res+parseFloat(example.text[x].value);
  example.result.value=res;
 }
 /script
 html
 form name=example action=show.php
  input type=text name=text value=1br
  input type=text name=text value=2br
  input type=text name=text value=3br
  input type=text name=result value=0br
  input type=button value=add OnClick=add()
  input type=submit value=show
 /form
 /html
 ---
 and show.php
 ---
 html
 ?
 echo $text[0].+.$text[1].+.$text[2].=;
 echo $result;
?
 /html

 PHP return the error:
 Notice: Uninitialized string offset: 1 in show.php on line 4

 How could I know the values of the text? without modify example.html

The easiest way would be to modify example.html and change each instance of
name=text to name=text[]. However, since you say you cannot do that, try
echoing $_SERVER['QUERY_STRING']. If that contains all 3 then you can parse
that to get the values out.

-- 
Stuart


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




RE: [PHP] PHP with No Web Server?

2002-06-13 Thread Miguel Cruz

On Thu, 13 Jun 2002, John Holmes wrote:
 In other words.. Can PHP serve as the Web Server or is another web
 server required to handle the socket connections, etc.?
 
 You can run PHP on the command line without a web server, but it doesn't
 do much good. For anyone else to see your PHP creations, yes, you need a
 web server.

If you're sufficiently masochistic you can write a web server in PHP.

miguel


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




Re: [PHP] Printer friendly version script

2002-06-13 Thread Miguel Cruz

On Thu, 13 Jun 2002, Angelo Marcos Rigo wrote:
   Anybody knows a good printer friendly version php script
   thank´s in advance 

Well, it's entirely dependent on your particular HTML; there's no 
general-purpose solution.

?
  $P = ($_GET['printerfriendly'] == 'yes') ? 1 : 0;
?htmlbody?

if ($P)
{
  ?img src=images/printerfriendly.gif?
}

else
{
  ?img src=images/printerhostile.gif?
}

?/body/html

miguel


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




[PHP] newbie question - retaining values

2002-06-13 Thread Leston Drake

Hi,

I've been creating forms that use hidden inputs to retain variables and 
values from one instance of the form to the next (by calling itself in the 
FORM ACTION).

Are there other ways to retain *global* variables and values between 
instances of loading a page?

I apologize for the newbie question, I'm still trying to grasp the concepts 
of programming for the web environment.

TIA,
Leston


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




Re: [PHP] newbie question - retaining values

2002-06-13 Thread Miguel Cruz

On Thu, 13 Jun 2002, Leston Drake wrote:
 I've been creating forms that use hidden inputs to retain variables and 
 values from one instance of the form to the next (by calling itself in the 
 FORM ACTION).
 
 Are there other ways to retain *global* variables and values between 
 instances of loading a page?

http://php.net/session

miguel


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




[PHP] confused newbie on PHP and Javascript.

2002-06-13 Thread Steve Bradwell

Hello All,

I am having a problem, mostly concept wise of how, or if I can use client
side Javascript in a server side php statement.

I have a JavaScript function that onChange of a list box, takes the value of
an option and grabs data from a MySQL table. My problem is how do I use the
JavaScript var in my sql statement?

Here is the function.

function Modify_Item_Details(){

var test =
document.forms[0].item.options[document.forms[0].item.selectedIndex].text;

?
$sql = Select i.QTY_ON_HAND, u.UNIT from items i INNER JOIN;
$sql.=  units u ON i.Unit_Index = u.Unit_Index;
$sql.=  where i.Item_Index = '.echo test\n.';

$result = mysql_query($sql);
 while ($vars = mysql_fetch_array($result)){
   echo document.forms[0].available.text='.$vars[0].';;
   echo document.forms[0].units.text='.$vars[0].';;
 }
?
}//end Modify_Item Details

Thanks for any help,

Steve.

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




RE: [PHP] possible to add a record number to a query?

2002-06-13 Thread Jeff Field

1) Yes, I'm using MySQL
2) You're right. This is not a PHP question.  My apologies to the list!

Thanks for the feedback!  I'll give it a try (and the other one in the other
email).

Jeff

 -Original Message-
 From: John Holmes [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 13, 2002 11:44 AM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [PHP] possible to add a record number to a query?


 You can do it with two queries.

 SELECT @a:=0;

 SELECT @a:=@a+1, * FROM table;

 This would be better taken to a MySQL list, though. Actually, you never
 said what DB you were using. This works in MySQL.

 ---John Holmes...

  -Original Message-
  From: Jeff Field [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, June 13, 2002 10:01 AM
  To: [EMAIL PROTECTED]
  Subject: RE: [PHP] possible to add a record number to a query?
 
  Yes, there is a particular reason.  The actual query I do pulls
  information
  from two tables and has both ORDER BY and GROUP BY clauses.  The
  auto_increment column (think of the query results as a table) will
 give
  me
  the rank of the results.  I know how to manipulate the data in PHP
 to
  accomplish what I need.  I just thought there might be a way in which
 the
  query could do it up front.  Sort of like when you want to know how
 many
  times a particular record exists, you can do a COUNT(*).  I just want
 the
  results to basically give me a column in the query that lists the
 results
  1,
  2, 3, etc.  Make sense?
 
  Thanks for your help!
 
  Jeff
 
   -Original Message-
   From: Jason Wong [mailto:[EMAIL PROTECTED]]
   Sent: Thursday, June 13, 2002 8:30 AM
   To: [EMAIL PROTECTED]
   Subject: Re: [PHP] possible to add a record number to a query?
  
  
   On Thursday 13 June 2002 20:27, Jeff Field wrote:
I would like to have a column returned in a query that tells you
 which
record I'm looking at?  Sort of like an auto_increment?  IOW, the
  query
results would look like:
   
record   first   last
   
  1  johndoe
  2  joe blow
  3  carol   fisher
   
The table only has first and last, but I want the results to
   add something
like record to tell me which record it is.  Thanks for any help!
  
   Is there any reason why you need/want to do this? Data are stored
   in a db in
   no particular order. If you want a particular order add an ORDER
   BY clause.
   If you want 'row' numbers then just fudge it in php -- assign a
   row number to
   each record you retrieve from the query.
  
   --
   Jason Wong - Gremlins Associates - www.gremlins.com.hk
   Open Source Software Systems Integrators
   * Web Design  Hosting * Internet  Intranet Applications
 Development *
  
   /*
   There's such a thing as too much point on a pencil.
 -- H. Allen Smith, Let the Crabgrass Grow
   */
  
  
   --
   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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Printer friendly version script

2002-06-13 Thread Pedro Garre

*This message was transferred with a trial version of CommuniGate(tm) Pro*
I think the only solution is to convert it to PDF. In theory, CSS2 provides 
with the possibility to configure the print format, but no browser supports 
it.

Pedro.


On Thursday 13 June 2002 19:56, Miguel Cruz wrote:
 *This message was transferred with a trial version of CommuniGate(tm) Pro*

 On Thu, 13 Jun 2002, Angelo Marcos Rigo wrote:
  Anybody knows a good printer friendly version php script
  thank´s in advance

 Well, it's entirely dependent on your particular HTML; there's no
 general-purpose solution.

 ?
   $P = ($_GET['printerfriendly'] == 'yes') ? 1 : 0;
 ?htmlbody?

 if ($P)
 {
   ?img src=images/printerfriendly.gif?
 }

 else
 {
   ?img src=images/printerhostile.gif?
 }

 ?/body/html

 miguel

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




RE: [PHP] confused newbie on PHP and Javascript.

2002-06-13 Thread Steve Bradwell

Hi thanks for the reply,

I do believe I understand what client side and server side really mean
although I have much to learn, but is there a way to accomplish what I'm
trying to do? Maybe some kind of work around a person has found when doing
this kind of thing? 

Thanks again,

Steve

-Original Message-
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 2:26 PM
To: Steve Bradwell; [EMAIL PROTECTED]
Subject: Re: [PHP] confused newbie on PHP and Javascript.


 I am having a problem, mostly concept wise of how, or if I can use client
 side Javascript in a server side php statement.

Do you know what client side and server side really mean??

For the function below...

 function Modify_Item_Details(){

 var test =
 document.forms[0].item.options[document.forms[0].item.selectedIndex].text;

 ?
 $sql = Select i.QTY_ON_HAND, u.UNIT from items i INNER JOIN;
 $sql.=  units u ON i.Unit_Index = u.Unit_Index;
 $sql.=  where i.Item_Index = '.echo test\n.';

 $result = mysql_query($sql);
  while ($vars = mysql_fetch_array($result)){
echo document.forms[0].available.text='.$vars[0].';;
echo document.forms[0].units.text='.$vars[0].';;
  }
 ?
 }//end Modify_Item Details

you do realize that the PHP runs first, on the server, right?. The output is
then sent to the client and the javascript is exectuted. You can't mix the
two. So, when you call that Javascript function, the PHP is already done,
it's not going to execute. Do a view source of your page...

You can send Javascript variables to PHP by submitting a form or creating a
URL to be clicked on. Either way, the page has to be refreshed/submitted in
order for PHP to recieve the variable.

You can send PHP variables to Javascript, too, but the PHP runs first.

? echo scriptvar test = '$test';/script; ?

---John Holmes...


-- 
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] beginner in PHP

2002-06-13 Thread Phillip Perry

Yes, here is the checkout code I used...

function chout(){
session_destroy();
unset ($mycart);
unset ($cart_items);
echo pThank you for shopping!/p;
}

Any suggestions?

-Original Message-
From: Tim Ward [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 4:18 AM
To: Martin Towell; Tom Rogers; Php; Phillip Perry
Subject: RE: [PHP] beginner in PHP


From the symptoms it sounds like you're destroying the session okay but
leaving the variables
In the script. Are you sure you're unsetting them at the appropriate scope
level. 

Tim Ward
www.chessish.com http://www.chessish.com 

--
From:  Phillip Perry [SMTP:[EMAIL PROTECTED]]
Sent:  13 June 2002 05:18
To:  Martin Towell; Tom Rogers; Php
Subject:  RE: [PHP] beginner in PHP

Thanks Martin!! That really helped out a lot. And thanks to all who
tried to
help me. I appreciate it!

I have one other question that is really not so much important as it
is
annoying, but I can't figure it out myself.

I'm practicing with sessions. What I'm making..if you couldn't tell
by the
array output from before...is a test shopping cart. Now the
annoyance is
that when I click the checkout link it's just supposed to destroy
the
session and reset everything to 0 including the shopping cart. And
also if
an item is clicked, that item gets deleted. With both choices when I
click
once the session does get destroyed, but everything stays on the
page until
I refresh the page. I want the info to get reset when I click the
link.
Here's the delete and checkout code...remember they both do actually
work,
just not as I want. Any suggestions on how to make it refresh on a
click
only?

/ DELETE SHOPPING CART ITEMS

function chout(){
session_destroy();
$mycart = array();
$cart_items = 0;
echo pThank you for shopping!/p;
}

if ($action == delnow)
{
unset($mycart[$itemid]);
}

// END DELETE SHOPPING CART ITEMS

if ($action == checkout)
{
chout();
}

-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:55 PM
To: '[EMAIL PROTECTED]'; Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


here's the revised loop


$cat_cnt = count($catalog);
while (list($key,$value) = each($mycart))
{
  for ($j = 0; $j  $cat_cnt; $j++)
if ($value == $catalog[$j][itemcd])
{
  echo $catalog[$j][unitprice];
  break;
}
}


-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:50 PM
To: '[EMAIL PROTECTED]'; Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Ah! $catalog is a 2D array - any your if statement is expecting a 1D
array...

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:52 PM
To: Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


I meant Martin :) sorry.

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:44 PM
To: Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Array ( [0] = gerainiums [1] = roses [2] = roses [3] = roses [4]
=
roses [5] = roses )

1
1

Your output is different from the last print_r that Tom had me do. I
wonder
why that is

-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:44 PM
To: [EMAIL PROTECTED]; Php
Subject: RE: [PHP] beginner in PHP


Hi
Then I guess you will have to add some debug code
try this before the while loop and make sure your if ($value ==
$catalog[itemcd]) will produce a match (and you do need the quotes
really
:)

echo pre.print_r($catalogue).br.print_r($mycart)./pre;
Tom

At 11:31 PM 12/06/2002 -0400, Phillip Perry wrote:
Thanks, but that didn't work either

-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:32 PM
To: [EMAIL PROTECTED]; Php
Subject: Re: [PHP] beginner in PHP


Hi
itemcd and unitprice should be in quotes I think if they are keys
in an
array.
$catalog[itemcd]
$catalog[unitprice]


Re[2]: [PHP] beginner in PHP

2002-06-13 Thread Stuart Dallas

On Thursday, June 13, 2002 at 7:44:39 PM, you wrote:

 Yes, here is the checkout code I used...

 function chout(){
 session_destroy();
 unset ($mycart);
 unset ($cart_items);
 echo pThank you for shopping!/p;
 }

 Any suggestions?

Try this...

function chout(){
global $mycart, $cart_items;
session_destroy();
unset ($mycart);
unset ($cart_items);
echo pThank you for shopping!/p;
 }

And if it works, read this: http://www.php.net/manual/en/language.variables.scope.php

-- 
Stuart


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




RE: [PHP] Spam Bots/E-mail Addys

2002-06-13 Thread justin cunningham

I remember a how to on this from linuxsecurity about 6 months ago-- try
a search there.  justin

-Original Message-
From: Stuart Dallas [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, June 13, 2002 10:24 AM
To: Jason Soza
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Spam Bots/E-mail Addys

On Thursday, June 13, 2002 at 6:10:35 PM, you wrote:
 If I have a site that stores information about people in a database,
 including e-mail addresses, and that information is only viewable when

 called via a user-specific variable, i.e. their alias, can spambots 
 still harvest those e-mail addresses?
snip
 Is there any way to combat this? Any PHP scripts, classes, functions
 that can 'hide' e-mail addresses? The site I'll be building needs to 
 have the e-mail addresses available, but I don't want to subject users

 to more spam than they probably already get.

Basic fact: If a normal (anonymous) visitor can get at the email
addresses, so
can a bot. It all depends on the bot, but there's no getting around that
basic
fact.

-- 
Stuart


-- 
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] php server on Windows

2002-06-13 Thread Phil Schwarzmann

So I'm thinking about setting up a little php/mysql web server here at
work and want to use Windows as my platform instead of Linux and have a
couple questions...
 
I know that PHP on Windows has some limitations as compared to Linux. 
What are these limitations?
 
Which version of Windows would be best ?
 
Is this gonna be a real pain in the ass to get PHP  MySQL  Apache 
Windows to get along well?  
 
Can I use IIS instead of Apache ?
 
Thanks!



RE: Re[2]: [PHP] beginner in PHP

2002-06-13 Thread Phillip Perry

Thank you but that didn't work. I still have to refresh the page.

-Original Message-
From: Stuart Dallas [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 2:53 PM
To: Phillip Perry
Cc: Tim Ward; Martin Towell; Tom Rogers; Php
Subject: Re[2]: [PHP] beginner in PHP


On Thursday, June 13, 2002 at 7:44:39 PM, you wrote:

 Yes, here is the checkout code I used...

 function chout(){
 session_destroy();
 unset ($mycart);
 unset ($cart_items);
 echo pThank you for shopping!/p;
 }

 Any suggestions?

Try this...

function chout(){
global $mycart, $cart_items;
session_destroy();
unset ($mycart);
unset ($cart_items);
echo pThank you for shopping!/p;
 }

And if it works, read this:
http://www.php.net/manual/en/language.variables.scope.php

--
Stuart


--
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] php server on Windows

2002-06-13 Thread Stuart Dallas

On Thursday, June 13, 2002 at 7:54:30 PM, Phil Schwarzmann wrote:
 I know that PHP on Windows has some limitations as compared to Linux.
 What are these limitations?

There are limitations? Where did you hear this? If there are any I haven't come
across them yet.

 Which version of Windows would be best ?

The most stable version for server use is currently Win2k.

 Is this gonna be a real pain in the ass to get PHP  MySQL  Apache 
 Windows to get along well?

No. It's like they were made to work together.
 
 Can I use IIS instead of Apache ?

If you really want to, but I can't think of many reasons why you would want to.
 
 Thanks!

No problem.

-- 
Stuart


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




[PHP] Editor

2002-06-13 Thread Daniele Baroncelli

Hi guys,

Although any editor should be fine when coding PHP, I find that the standard
Notepad it's a real pain in the ass. Especially when the script gives you an
error at line 222 ! Each time I have to scroll and count each single line!

Can anyone suggest me a different editor ?


Cheers

Daniele



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




Re: [PHP] Editor

2002-06-13 Thread Kurth Bemis (List Monkey)

At 09:18 PM 6/13/2002 +0200, Daniele Baroncelli wrote:

allaire homesite hands down

~kurth

Hi guys,

Although any editor should be fine when coding PHP, I find that the standard
Notepad it's a real pain in the ass. Especially when the script gives you an
error at line 222 ! Each time I have to scroll and count each single line!

Can anyone suggest me a different editor ?


Cheers

Daniele



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


Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer

Jedi business, Go back to your drinks - Anakin Skywalker, AOTC

[EMAIL PROTECTED] | http://kurth.hardcrypto.com
PGP key available - http://kurth.hardcrypto.com/pgp



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




Re: [PHP] Editor

2002-06-13 Thread Ray Hunter

Actually it is macromedia now.  And it is windows based, what about us linux
or unix or xbsd guys.

Ray Hunter



- Original Message -
From: Kurth Bemis (List Monkey) [EMAIL PROTECTED]
To: Daniele Baroncelli [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, June 13, 2002 1:24 PM
Subject: Re: [PHP] Editor


 At 09:18 PM 6/13/2002 +0200, Daniele Baroncelli wrote:

 allaire homesite hands down

 ~kurth

 Hi guys,
 
 Although any editor should be fine when coding PHP, I find that the
standard
 Notepad it's a real pain in the ass. Especially when the script gives you
an
 error at line 222 ! Each time I have to scroll and count each single
line!
 
 Can anyone suggest me a different editor ?
 
 
 Cheers
 
 Daniele
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


 Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer

 Jedi business, Go back to your drinks - Anakin Skywalker, AOTC

 [EMAIL PROTECTED] | http://kurth.hardcrypto.com
 PGP key available - http://kurth.hardcrypto.com/pgp



 --
 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] $HTTP_USER_AGENT

2002-06-13 Thread Philip Olson


The php directive register_globals = on is what 
creates $HTTP_USER_AGENT and all vars from various 
places, such as GET, POST, COOKIE, SERVER, etc.

If register_globals = off, $HTTP_USER_AGENT won't 
automagically exist.  See this faqt for related 
information:

  http://www.faqts.com/knowledge_base/view.phtml/aid/31

Regards,
Philip Olson


On Thu, 13 Jun 2002, Webmaster do Aborla.net wrote:

 Hello,
 
 Why $HTTP_USER_AGENT don't work?? I can't get it's value, but in phpinfo the
 value appears. why this???
 
 
 Thanking in advance,
 Nuno Lopes
 
 
 
 -- 
 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] Editor

2002-06-13 Thread Kurth Bemis (List Monkey)

At 01:23 PM 6/13/2002 -0600, Ray Hunter wrote:

emacs with phpmode.lisp (do a google search for it)

and on apple - pre os X we like bbedit and on X we like emacs :-)

~kurth

Actually it is macromedia now.  And it is windows based, what about us linux
or unix or xbsd guys.

Ray Hunter



- Original Message -
From: Kurth Bemis (List Monkey) [EMAIL PROTECTED]
To: Daniele Baroncelli [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, June 13, 2002 1:24 PM
Subject: Re: [PHP] Editor


  At 09:18 PM 6/13/2002 +0200, Daniele Baroncelli wrote:
 
  allaire homesite hands down
 
  ~kurth
 
  Hi guys,
  
  Although any editor should be fine when coding PHP, I find that the
standard
  Notepad it's a real pain in the ass. Especially when the script gives you
an
  error at line 222 ! Each time I have to scroll and count each single
line!
  
  Can anyone suggest me a different editor ?
  
  
  Cheers
  
  Daniele
  
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
  Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer
 
  Jedi business, Go back to your drinks - Anakin Skywalker, AOTC
 
  [EMAIL PROTECTED] | http://kurth.hardcrypto.com
  PGP key available - http://kurth.hardcrypto.com/pgp
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php


Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer

Jedi business, Go back to your drinks - Anakin Skywalker, AOTC

[EMAIL PROTECTED] | http://kurth.hardcrypto.com
PGP key available - http://kurth.hardcrypto.com/pgp



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




Re: [PHP] Editor

2002-06-13 Thread Kevin Caporaso

vi  !!


Ray Hunter [EMAIL PROTECTED] wrote in message
008d01c2130f$bb7e29c0$[EMAIL PROTECTED]">news:008d01c2130f$bb7e29c0$[EMAIL PROTECTED]...
 Actually it is macromedia now.  And it is windows based, what about us
linux
 or unix or xbsd guys.

 Ray Hunter



 - Original Message -
 From: Kurth Bemis (List Monkey) [EMAIL PROTECTED]
 To: Daniele Baroncelli [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, June 13, 2002 1:24 PM
 Subject: Re: [PHP] Editor


  At 09:18 PM 6/13/2002 +0200, Daniele Baroncelli wrote:
 
  allaire homesite hands down
 
  ~kurth
 
  Hi guys,
  
  Although any editor should be fine when coding PHP, I find that the
 standard
  Notepad it's a real pain in the ass. Especially when the script gives
you
 an
  error at line 222 ! Each time I have to scroll and count each single
 line!
  
  Can anyone suggest me a different editor ?
  
  
  Cheers
  
  Daniele
  
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
  Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone
Computer
 
  Jedi business, Go back to your drinks - Anakin Skywalker, AOTC
 
  [EMAIL PROTECTED] | http://kurth.hardcrypto.com
  PGP key available - http://kurth.hardcrypto.com/pgp
 
 
 
  --
  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] Editor

2002-06-13 Thread Ray Hunter

If color is all you want then try using vim.


Ray Hunter

- Original Message -
From: Kurth Bemis (List Monkey) [EMAIL PROTECTED]
To: Ray Hunter [EMAIL PROTECTED]
Cc: Daniele Baroncelli [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Thursday, June 13, 2002 1:29 PM
Subject: Re: [PHP] Editor


 At 01:23 PM 6/13/2002 -0600, Ray Hunter wrote:

 emacs with phpmode.lisp (do a google search for it)

 and on apple - pre os X we like bbedit and on X we like emacs :-)

 ~kurth

 Actually it is macromedia now.  And it is windows based, what about us
linux
 or unix or xbsd guys.
 
 Ray Hunter
 
 
 
 - Original Message -
 From: Kurth Bemis (List Monkey) [EMAIL PROTECTED]
 To: Daniele Baroncelli [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, June 13, 2002 1:24 PM
 Subject: Re: [PHP] Editor
 
 
   At 09:18 PM 6/13/2002 +0200, Daniele Baroncelli wrote:
  
   allaire homesite hands down
  
   ~kurth
  
   Hi guys,
   
   Although any editor should be fine when coding PHP, I find that the
 standard
   Notepad it's a real pain in the ass. Especially when the script gives
you
 an
   error at line 222 ! Each time I have to scroll and count each single
 line!
   
   Can anyone suggest me a different editor ?
   
   
   Cheers
   
   Daniele
   
   
   
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
   Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone
Computer
  
   Jedi business, Go back to your drinks - Anakin Skywalker, AOTC
  
   [EMAIL PROTECTED] | http://kurth.hardcrypto.com
   PGP key available - http://kurth.hardcrypto.com/pgp
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php


 Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer

 Jedi business, Go back to your drinks - Anakin Skywalker, AOTC

 [EMAIL PROTECTED] | http://kurth.hardcrypto.com
 PGP key available - http://kurth.hardcrypto.com/pgp



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




Re: [PHP] Editor

2002-06-13 Thread Philip Olson


Some popular editors that meet your OS requirements (win32), 
all have PHP syntax capabilities (in no particular order):

 - ultraedit
 - editplus
 - textpad
 - zend ide
 - homesite

Download and try them all :)

Regards,
Philip Olson



On Thu, 13 Jun 2002, Daniele Baroncelli wrote:

 Hi guys,
 
 Although any editor should be fine when coding PHP, I find that the standard
 Notepad it's a real pain in the ass. Especially when the script gives you an
 error at line 222 ! Each time I have to scroll and count each single line!
 
 Can anyone suggest me a different editor ?
 
 
 Cheers
 
 Daniele
 
 
 
 -- 
 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] Newbie ? on sessions

2002-06-13 Thread Vicki

I'm very new to PHP/mySQL so please forgive me if this is a silly 
question. I'm mostly trying to understand the concepts involved in 
tracking user activity with sessions, and despite hours of reading I'm 
still confused.

I have a membership site with users authenticated by a mySQL database. I 
have incorporated sessions into the login script which passes the 
session variables to a page restricted to members-only that contains 
links to articles. 

Here's the question: If a member logs out (session_destroy()) or closes 
the browser, the session data is gone, right? How, then, would I go 
about storing information about the member's activity on the site? The 
next time they log in, I'd like to greet them with a message that says 
Hi, $username. You last visited the site on $date and you viewed the 
following articles: $article1, $article2.

Do I need to store the sessionid in the database and register more 
variables to track the activity, or should I write a separate script 
that stores details of their activity, perhaps as a separate table in 
the database? What I really don't understand is whether this sort of 
tracking is done with sessions or by writing to a database. (OK that's 
more than one question.)

Also, if I do need to store the session ID in the database and I don't 
have access to the php.ini file, is there a way to set the 
session_save_handler to user through .htaccess or some other means?

Thanks very much for any help you can provide.

Vicki

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




RE: [PHP] Editor

2002-06-13 Thread Jay Blanchard

[snip]
Can anyone suggest me a different editor ?
[/snip]

PHPEdit (http://www.phpedit.com)

HTH!

Jay


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




Re: [PHP] Newbie ? on sessions

2002-06-13 Thread 1LT John W. Holmes

You shouldn't have to store the sessionID. It's going to be new each time
someone comes to the site, anyhow. Once the log in, you should know who they
are. Save the tracking information you want in your database and pull it
out based on their username.

You have to use a database or a file to remember things like this.
Sessions are only good for that browser session. Cookies last longer and you
could use them to reference things, or even to store the data, but they can
be tampered with on the user side.

---John Holmes...

- Original Message -
From: Vicki [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 13, 2002 2:51 PM
Subject: [PHP] Newbie ? on sessions


 I'm very new to PHP/mySQL so please forgive me if this is a silly
 question. I'm mostly trying to understand the concepts involved in
 tracking user activity with sessions, and despite hours of reading I'm
 still confused.

 I have a membership site with users authenticated by a mySQL database. I
 have incorporated sessions into the login script which passes the
 session variables to a page restricted to members-only that contains
 links to articles.

 Here's the question: If a member logs out (session_destroy()) or closes
 the browser, the session data is gone, right? How, then, would I go
 about storing information about the member's activity on the site? The
 next time they log in, I'd like to greet them with a message that says
 Hi, $username. You last visited the site on $date and you viewed the
 following articles: $article1, $article2.

 Do I need to store the sessionid in the database and register more
 variables to track the activity, or should I write a separate script
 that stores details of their activity, perhaps as a separate table in
 the database? What I really don't understand is whether this sort of
 tracking is done with sessions or by writing to a database. (OK that's
 more than one question.)

 Also, if I do need to store the session ID in the database and I don't
 have access to the php.ini file, is there a way to set the
 session_save_handler to user through .htaccess or some other means?

 Thanks very much for any help you can provide.

 Vicki

 --
 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] Newbie ? on sessions

2002-06-13 Thread Julie Meloni

V Here's the question: If a member logs out (session_destroy()) or closes
V the browser, the session data is gone, right?

yes

V How, then, would I go about storing information about the member's activity on the 
site?

By adding into your site, any of those custom tracking things.  For
example, if you wanted to note that they clicked on a link to an
article, then the script that serves that article would insert such a
note into a table in the db designed specifically for that purpose.

What you would be noting would be the ID of the user, not the value of
PHPSESSID, because that's just a random string for the period of time
that the user is logged in.

V The next time they log in, I'd like to greet them with a message that says
V Hi, $username. You last visited the site on $date and you viewed the 
V following articles: $article1, $article2.

Easy enough, if you have tables and little insert snippets scattered
about to handle that.


- Julie

-- Julie Meloni
-- [EMAIL PROTECTED]
-- www.thickbook.com

Find Sams Teach Yourself MySQL in 24 Hours at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


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




Re: [PHP] php server on Windows

2002-06-13 Thread Jerome Houston

Ditto on all that for me.  use apache.  the instructions on how to get them 
working together are good as long as you are diligent about reading *every* 
word.  no half-ass instruction following will do.  mysql is just as easy to 
set up, and you have to do *zero* configuration of php to get it working.

i've used this comination before, and at the time i had NEVER used php or 
mysql before, and it all worked together nonetheless.

jerome


Original Message Follows
From: Stuart Dallas [EMAIL PROTECTED]

On Thursday, June 13, 2002 at 7:54:30 PM, Phil Schwarzmann wrote:
  I know that PHP on Windows has some limitations as compared to Linux.
  What are these limitations?

There are limitations? Where did you hear this? If there are any I haven't 
come
across them yet.

  Which version of Windows would be best ?

The most stable version for server use is currently Win2k.

  Is this gonna be a real pain in the ass to get PHP  MySQL  Apache 
  Windows to get along well?

No. It's like they were made to work together.

  Can I use IIS instead of Apache ?

If you really want to, but I can't think of many reasons why you would want 
to.

  Thanks!

No problem.

--
Stuart


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


_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




[PHP] Chaching issues

2002-06-13 Thread eat pasta type fasta

is it possible that the server/browser caches the output and the code 
changes in php are not reflected. I am having wierd problems with fixing 
the code, and it often not responding for a while. When I cause a parse 
error, the php engine does inform me, however it seems to act up on bug 
fixes with variables and calulations.
Is that possible?

Thanks in advance.

R.


--__-__-__
eat pasta
type fasta


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




Re: [PHP] Editor

2002-06-13 Thread Philipp Melab

I love emacs with php-mode.el.
He's small, reliable, customizable and if you've ever worked with Komodo or 
Zend IDE you'll find out that he's damn fast.

yours Philipp


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




[PHP] Re: next and previous buttons performing on a query

2002-06-13 Thread blue

www.phpbuilder.com has an excellent article on creating a results page that
incorporates NEXT and PREVIOUS links/buttons so that one can navigate
through the results.. i'll try to find an exact link.



Wilbert Enserink [EMAIL PROTECTED] wrote in message
007001c212e1$f0f14340$0c01a8c0@pulsar">news:007001c212e1$f0f14340$0c01a8c0@pulsar...
Hi all,


I have this mySQL query giving me my result back.

The info about the current db-record is showing.
Now I want to display ' view next ' and ' view previous ' buttons on my
website. which takes you to the same page but with the next record in the
query result.
Is there a clever way to do this?

Any tips are welcome!

Many regards

Wilbert Enserink

-
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-



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




Re: [PHP] Editor

2002-06-13 Thread Liam MacKenzie

EditPlus
Small, fast and very very effective.

www.editplus.com



- Original Message -
From: Daniele Baroncelli [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 14, 2002 5:18 AM
Subject: [PHP] Editor


 Hi guys,

 Although any editor should be fine when coding PHP, I find that the
standard
 Notepad it's a real pain in the ass. Especially when the script gives you
an
 error at line 222 ! Each time I have to scroll and count each single line!

 Can anyone suggest me a different editor ?


 Cheers

 Daniele



 --
 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] Editor

2002-06-13 Thread Robin Bouwhuis

In notepad there is an option for 'goto' if you are not using wordwrap  it
is under the edit menu.  then type in the line number and it will take you
to the line you need


Robin


- Original Message -
From: Daniele Baroncelli [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 13, 2002 3:18 PM
Subject: [PHP] Editor


 Hi guys,

 Although any editor should be fine when coding PHP, I find that the
standard
 Notepad it's a real pain in the ass. Especially when the script gives you
an
 error at line 222 ! Each time I have to scroll and count each single line!

 Can anyone suggest me a different editor ?


 Cheers

 Daniele



 --
 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] Chaching issues

2002-06-13 Thread Kevin Stone

Yes it is possible.  A good suggestion is to tell the browser not to cache
PHP output by sending the following headers..

header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
header('Expires: 0');

You can also set these headers via META tags in your HTML.  You'll have to
do a search for those however.  Of course there's no guarentee this will
work with all browsers but for the most part they do their job.

-Kevin


- Original Message -
From: eat pasta type fasta [EMAIL PROTECTED]
To: PHP-GENERAL [EMAIL PROTECTED]
Sent: Thursday, June 13, 2002 1:55 PM
Subject: [PHP] Chaching issues


 is it possible that the server/browser caches the output and the code
 changes in php are not reflected. I am having wierd problems with fixing
 the code, and it often not responding for a while. When I cause a parse
 error, the php engine does inform me, however it seems to act up on bug
 fixes with variables and calulations.
 Is that possible?

 Thanks in advance.

 R.


 --__-__-__
 eat pasta
 type fasta


 --
 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] Editor

2002-06-13 Thread lherbst


If you are using XP, notepad can take you right to the line you need.
Select Edit...Go to... and enter the line number you want to go to.  Also,
Ctrl+G works.   I don't know if the XP version of notepad will work in any
prior windows or not.

Lee




   
  
Daniele   
  
Baroncelli   To: [EMAIL PROTECTED]
  
daniele@baroncc:  
  
celli.comSubject: [PHP] Editor
  
   
  
06/13/2002 
  
03:18 PM   
  
   
  
   
  



Hi guys,

Although any editor should be fine when coding PHP, I find that the
standard
Notepad it's a real pain in the ass. Especially when the script gives you
an
error at line 222 ! Each time I have to scroll and count each single line!

Can anyone suggest me a different editor ?


Cheers

Daniele



--
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: goto

2002-06-13 Thread Peter

maybe switch() would be of some use?  Your could save the values for $type
in an array and look them up to get a numbe to use with switch(). You can
also have a case else with switch.


Stephen Brewster [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I am wirting a code seperation engine for PHP, the idea of which is it
will
 remove the need for me to have to build the majority of the websites at my
 company. The designers will be able to build the html in dreamweaver or
 similar and then insert custom tags into their code. The engine will parse
 the code and insert the necessary PHP code. For the most part this engine
is
 working. However under some cirtumstances (like the one shown below) I
need
 to be able to perfom a loop or if statement. This is proving to be
 incredably difficult since I would end up with code like below. For
obvious
 reasons the compiler does not like this code. This would be simple if PHP
 had GOTO's. Does anyone know of a way around this situation?

 HTML
 
 table
products type=loop
tr
   tdproducts type=text field=name/td
   tdproducts type=text field=price/td
/tr
products type=endloop
 /tr


 PHP
 ---

 if($type == 'LOOP') {
$sql = 'SELECT * FROM products';
$result = mysql_query($sql, $db);
$record = $mysql_fetch_array($result, MYSQL_ASSOC);
{
 }

 if($type == 'TEXT')
echo($record[$field]);

 if($type == 'ENDLOOP') {
}
 }

 --

 --
 Stephen Brewster
 Email: [EMAIL PROTECTED]
 Tel: 0116 2335545
 Mobile: 07776 475849
 ICQ: 383095
 --

 UNIX SEX
 unzip; strip; touch; finger; mount; fsck; more; yes; umount; sleep






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




[PHP] Re: php server on Windows

2002-06-13 Thread Peter

Win98, Apache, PHP 4.0.6 and MySQL with a whole bunch of other apps has been
running fine at our school for ages - never crashed yet! (Doesn't get heavy
usage though either!)
We use the apache extension thingy, not the CGI version of PHP which helps a
lot.


Phil Schwarzmann [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 So I'm thinking about setting up a little php/mysql web server here at
 work and want to use Windows as my platform instead of Linux and have a
 couple questions...

 I know that PHP on Windows has some limitations as compared to Linux.
 What are these limitations?

 Which version of Windows would be best ?

 Is this gonna be a real pain in the ass to get PHP  MySQL  Apache 
 Windows to get along well?

 Can I use IIS instead of Apache ?

 Thanks!






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




[PHP] GD Questions: Please help.

2002-06-13 Thread Shane

Greetings fellow PHPers.

I am learning basic GD functionality and I have a few YES/NO questions to ask.
This should only take a few seconds of your time. PLEASE HELP!

So far I have seen several tutorials on creating graphics on the fly.
In each example the either send the image (by itself) to a browser (using the HEADER 
line) or they save it to a directory.

Can I send an image to a browser along with other HTML and PHP information, or does my 
image have to be on it's own.

If I want to send my image to a browser with other HTML do I have to save it to a file 
first?

Does my directory that I am writing to have to have write permission set to TRUE for 
me to create an image file? and if it is NOT, will I get an error something like...
Warning: imagejpeg: unable to open '/images/test.jpg' for writing!

Can anyone show me a chunk of sample code or function that shows how I can embed my 
images created on the fly into my normal HTML files.

As always, thanks in advance my friends.

- NorthBayShane

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




Re: [PHP] Editor

2002-06-13 Thread Scott

I have been using Home Site since it came out in the 90's.  Currently 
Macromedia Home Site 5.0.  It is my number one choice because I have to 
often switch between PHP and ASP at our show during our conversion over to 
LAMP.

We bought Zend Studio and I have been using more at times, but miss all 
the snippets and custom buttons I have been building in Home Site for 
years.

On the Linux side I would check out XEmacs with the PHP add on.  I think 
it was nedit that also worked well for me.

-Scott




On Thu, 13 Jun 2002, Daniele Baroncelli wrote:

 Hi guys,
 
 Although any editor should be fine when coding PHP, I find that the standard
 Notepad it's a real pain in the ass. Especially when the script gives you an
 error at line 222 ! Each time I have to scroll and count each single line!
 
 Can anyone suggest me a different editor ?
 
 
 Cheers
 
 Daniele
 
 
 
 

-- 
-
Now Playing:  Sugar Ray - Answer The Phone
  Server Uptime:  187 days

www.scottah.com



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




Re: [PHP] GD Questions: Please help.

2002-06-13 Thread Kevin Stone

Shane, absolutely you can mix HTML and dynamically generated images.  You'll
actually call the image in passively via an img tag like this...

img src=getimage.php

getimage.php will echo the appropriate image header (Content-type: image/png
or whatever) plus your image grabbing/generating code which you will simply
output to the browser.  Deceptively easy, yes?  :)

Hope this helps.
-Kevin


- Original Message -
From: Shane [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 13, 2002 2:21 PM
Subject: [PHP] GD Questions: Please help.


 Greetings fellow PHPers.

 I am learning basic GD functionality and I have a few YES/NO questions to
ask.
 This should only take a few seconds of your time. PLEASE HELP!

 So far I have seen several tutorials on creating graphics on the fly.
 In each example the either send the image (by itself) to a browser (using
the HEADER line) or they save it to a directory.

 Can I send an image to a browser along with other HTML and PHP
information, or does my image have to be on it's own.

 If I want to send my image to a browser with other HTML do I have to save
it to a file first?

 Does my directory that I am writing to have to have write permission set
to TRUE for me to create an image file? and if it is NOT, will I get an
error something like...
 Warning: imagejpeg: unable to open '/images/test.jpg' for writing!

 Can anyone show me a chunk of sample code or function that shows how I can
embed my images created on the fly into my normal HTML files.

 As always, thanks in advance my friends.

 - NorthBayShane

 --
 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] Editor

2002-06-13 Thread Greg Donald

On Thu, 13 Jun 2002, Daniele Baroncelli wrote:

Can anyone suggest me a different editor ?

Depending on my OS I amd sitting in front of:

vim - www.vim.org
editplus - www.editplus.com

-- 
---
Greg Donald
http://destiney.com/public.key
---



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




Re: [PHP] GD Questions: Please help.

2002-06-13 Thread Richard Baskett

Thank you, thank you, thank you, thank you!  I never could figure it out, so
I just had them save the files and they were recreated each time over the
old ones.. Thank you thank you thank you!

Rick

Don't dismiss a good idea simply because you don't like the source. -
Unknown

 From: Kevin Stone [EMAIL PROTECTED]
 Date: Thu, 13 Jun 2002 14:33:52 -0600
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] GD Questions: Please help.
 
 Shane, absolutely you can mix HTML and dynamically generated images.  You'll
 actually call the image in passively via an img tag like this...
 
 img src=getimage.php
 
 getimage.php will echo the appropriate image header (Content-type: image/png
 or whatever) plus your image grabbing/generating code which you will simply
 output to the browser.  Deceptively easy, yes?  :)
 
 Hope this helps.
 -Kevin
 
 
 - Original Message -
 From: Shane [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, June 13, 2002 2:21 PM
 Subject: [PHP] GD Questions: Please help.
 
 
 Greetings fellow PHPers.
 
 I am learning basic GD functionality and I have a few YES/NO questions to
 ask.
 This should only take a few seconds of your time. PLEASE HELP!
 
 So far I have seen several tutorials on creating graphics on the fly.
 In each example the either send the image (by itself) to a browser (using
 the HEADER line) or they save it to a directory.
 
 Can I send an image to a browser along with other HTML and PHP
 information, or does my image have to be on it's own.
 
 If I want to send my image to a browser with other HTML do I have to save
 it to a file first?
 
 Does my directory that I am writing to have to have write permission set
 to TRUE for me to create an image file? and if it is NOT, will I get an
 error something like...
 Warning: imagejpeg: unable to open '/images/test.jpg' for writing!
 
 Can anyone show me a chunk of sample code or function that shows how I can
 embed my images created on the fly into my normal HTML files.
 
 As always, thanks in advance my friends.
 
 - NorthBayShane
 
 --
 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




Re: [PHP] Newbie ? on sessions

2002-06-13 Thread Vicki

Thanks for both of your comments. I don't know why I was getting all 
tangled up in sessions, but now I feel MUCH more confident about how to 
proceed.

Best regards,
Vicki

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




[PHP] sessions help

2002-06-13 Thread Leston Drake

Hi again. Thanks to Miguel and Matt for pointing me to sessions for 
retaining variables.

I've got the register_globals directive set to Off. I want to store a value 
in a session variable.
I've set up two documents (one that sets a session variable, and one that 
retrieves it), with the following code.

In doc 1, I've got this code:
function sessionSetNode ($node_id) {
 return ($_SESSION['node'] = $node_id);
   }

   sessionSetNode(10.2);


Doc 2 looks like this:
   if (!empty($_SESSION)) {
   extract($_SESSION);
   } else if (!empty($HTTP_SESSION_VARS)) {
   extract($HTTP_SESSION_VARS);
   }

   function sessionGetNode () {
 return $_SESSION['node'];
   }

   $n = sessionGetNode();
   echo (Node is $n.);

First, I load Doc 1 (to set the session variable).
Then I load Doc 2 to retrieve the variable. When doc 2 runs, I get the 
following:
--
Warning: Undefined variable: _SESSION in c:\...\getsessionvar.php on line 17
Node is .
--
Line 17 is the } after the line return $_SESSION['node'];

It doesn't seem to know about $_SESSION.
Can someone help me out?

TIA,
Leston




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




Re: [PHP] Re: Email not getting

2002-06-13 Thread Manuel Lemos

Hello,


On 06/13/2002 02:17 AM, Manisha wrote:
 If it is aurica.com then it is wrong as this is the name of Live server. 

No, the query is to figure what is the address of the SMTP server to 
which your machine sendmail program should deliver the messages and it 
is failing.


 But currently I am working on local linux server. (To access the server 
 I use http://Linux-Server/index.php)
 
 Any way, following is the out put of the command
 
 
 ***Can't find server address for 'aurica.com': Host name lookup failure.
 
 Server: Linux-Server
 Address: 0.0.0.0
 
 ***Linux-Server Can't give TYPE=MX : No response from server
 
 ---


Sorry the correct command line is:

nslookup -type=MX aurica.com

Here it resolves to mail.aurica.com, but your system DNS configuration 
may not be correct. That SMTP server seems to be reachable from here too.

Regards,
Manuel Lemos



 
 Manisha
 
 At 02:06 AM 6/13/02 -0300, Manuel Lemos wrote:
 
 Hello,

 On 06/13/2002 01:59 AM, Manisha wrote:

 I gave the command at root, I got some details
 
--
 


 Q-ID Size - Q-Time- Sender/Recipient
 file name67Thu Jun 13 11.22 nobody
 (host map: look up (aurica.com): 
 deferred)
 [EMAIL PROTECTED]

 
-
 

 What's the problem exactly? As I do not know much about Linux 
 (Totally on windows), I am unable to figure out too.


 It looks like the your machine DNS does not seem to be properly 
 configured.

 Type in the shell this command and tell me what it shows:

 nslookup TYPE=MX aurica.com

 -- 

 Regards,
 Manuel Lemos


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



-- 

Regards,
Manuel Lemos


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




RE: [PHP] confused newbie on PHP and Javascript.

2002-06-13 Thread Lazor, Ed

Hi Steve,

What you're asking isn't possible.  Javascript runs client-side.  PHP runs
server-side.  You can't directly mix the two.

For example, you can use Javascript to respond when people choose menu
options, but you can't have Javascript communicate with PHP and pull
additional information from the database for your form.

You need to use a round-about approach.  Have Javascript reload the page
based on user input.  When the page is reloaded from the server, PHP can
process it (server-side).  PHP can add Javascript code / data to the page
arriving at the viewer's browser.  The Javascript runs and operates based on
this code / data.  Javascript passes information to PHP by posting forms or
including parameters in the url.

Here's another example...

You load a page for the first time...  PHP processes it...

if ($Name == )
$Name = Brian;

echo script language='Javascript';
echo \$Name = $Name;;
echo /script;



The page displays on the viewers browser and Javascript responds to user
form input.  Based on some action, Javascript reloads the page with the
following URL:

mytest.php?Name=John


Now PHP is receiving the variable Name and prints out different
JavaScript


Does this make any sense?  I'm probably not sounding very clear... someone
help describe this, please =)

-Ed


 -Original Message-
 From: Steve Bradwell [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 13, 2002 11:35 AM
 To: 1LT John W. Holmes; Steve Bradwell; [EMAIL PROTECTED]
 Subject: RE: [PHP] confused newbie on PHP and Javascript.
 
 
 Hi thanks for the reply,
 
 I do believe I understand what client side and server side really mean
 although I have much to learn, but is there a way to 
 accomplish what I'm
 trying to do? Maybe some kind of work around a person has 
 found when doing
 this kind of thing? 
 
 Thanks again,
 
 Steve
 
 -Original Message-
 From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 13, 2002 2:26 PM
 To: Steve Bradwell; [EMAIL PROTECTED]
 Subject: Re: [PHP] confused newbie on PHP and Javascript.
 
 
  I am having a problem, mostly concept wise of how, or if I 
 can use client
  side Javascript in a server side php statement.
 
 Do you know what client side and server side really mean??
 
 For the function below...
 
  function Modify_Item_Details(){
 
  var test =
  
 document.forms[0].item.options[document.forms[0].item.selected
 Index].text;
 
  ?
  $sql = Select i.QTY_ON_HAND, u.UNIT from items i INNER JOIN;
  $sql.=  units u ON i.Unit_Index = u.Unit_Index;
  $sql.=  where i.Item_Index = '.echo test\n.';
 
  $result = mysql_query($sql);
   while ($vars = mysql_fetch_array($result)){
 echo document.forms[0].available.text='.$vars[0].';;
 echo document.forms[0].units.text='.$vars[0].';;
   }
  ?
  }//end Modify_Item Details
 
 you do realize that the PHP runs first, on the server, 
 right?. The output is
 then sent to the client and the javascript is exectuted. You 
 can't mix the
 two. So, when you call that Javascript function, the PHP is 
 already done,
 it's not going to execute. Do a view source of your page...
 
 You can send Javascript variables to PHP by submitting a form 
 or creating a
 URL to be clicked on. Either way, the page has to be 
 refreshed/submitted in
 order for PHP to recieve the variable.
 
 You can send PHP variables to Javascript, too, but the PHP runs first.
 
 ? echo scriptvar test = '$test';/script; ?
 
 ---John Holmes...
 
 
 -- 
 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
 
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




Re: [PHP] sessions help

2002-06-13 Thread Stuart Dallas

On Thursday, June 13, 2002 at 9:46:10 PM, you wrote:
 First, I load Doc 1 (to set the session variable).
 Then I load Doc 2 to retrieve the variable. When doc 2 runs, I get the 
 following:
 
--
 Warning: Undefined variable: _SESSION in c:\...\getsessionvar.php on line 17
 Node is .
 
--
 Line 17 is the } after the line return $_SESSION['node'];

 It doesn't seem to know about $_SESSION.
 Can someone help me out?

Do you have a call to start_session() at the top of both files? If not, that's
what's missing.

-- 
Stuart


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




[PHP] Re: Database Abstraction Suite

2002-06-13 Thread Manuel Lemos

Helllo,

On 06/13/2002 11:04 AM, David Russell wrote:
 Hi all
 
 I am busy developing a PHP DB application. I obviously want this to be 
 as portable as possible - and then went to the Zend pages.
 
 I have looked at the DB abstraction Applications. There are five or so 
 which have all been rated as a four dot (I presume out of 5).
 
 Does anyone have any experience with DB Absteraction suites. If so, I 
 need one that supports InterBase/Firebird and also supports MySQL. I 
 would like to know what they are like in terms of ease of learning the 
 generic things, etc, etc.

You may want to try Metabase because it is the only that provides true 
database portability not only to access databases but also to install 
the schemas of tables, fields, indexes and sequences using a database 
independent schema definition in XML.

http://www.phpclasses.org/metabase

-- 

Regards,
Manuel Lemos


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




[PHP] Re: Spam Bots/E-mail Addys

2002-06-13 Thread Manuel Lemos

Hello,

On 06/13/2002 02:10 PM, Jason Soza wrote:
 Just curious...
 
 If I have a site that stores information about people in a database, 
 including e-mail addresses, and that information is only viewable when 
 called via a user-specific variable, i.e. their alias, can spambots 
 still harvest those e-mail addresses?
 
 So for instance I have a page called 'users.php' and to find the e-mail 
 address for John Smith, you'd follow a link that directs you to 
 users.php?alias=johnsmith - I guess my main question is, can spambots 
 follow those types of links, get the resulting page, and harvest the 
 address off that?
 
 Is there any way to combat this? Any PHP scripts, classes, functions 
 that can 'hide' e-mail addresses? The site I'll be building needs to 
 have the e-mail addresses available, but I don't want to subject users 
 to more spam than they probably already get.

I had that problem and the solution that I used was use Javascript in 
the ONCLICK event of the dynamically construct the link URL with static 
values that are hard to figure that they represent an address by spam 
harverster bots. Look at the bottom of the pages here for an example:

http://www.phpclasses.org/



-- 

Regards,
Manuel Lemos


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




RE: [PHP] GD Questions: Please help.

2002-06-13 Thread Shane

Kevin... YOU RULE!!!

A million billion Humble thanks!

So simple, yet was such a pain to get past. I was racking my brain on that one!
Man, if I could just buy you a beer online, I would.

THANK YOU THANK YOU THANK YOU!
- NorthBayShane

BUT...Does this mean I will need a separate PHP page for every graphic script?
You would think there would be a way to call it from a function.

(Thinking out loud now...)
But I suppose I could send a variable along with my img src=getimage.php tag like

img src=getimage.php?id=123

and then when the PHP code in getimage.php compares the variable passed to it's 
library of code snippets it would spit back the necessary image each time.

H
Is there a better way?

-Original Message-
From: Kevin Stone [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:34 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] GD Questions: Please help.


Shane, absolutely you can mix HTML and dynamically generated images.  You'll
actually call the image in passively via an img tag like this...

img src=getimage.php

getimage.php will echo the appropriate image header (Content-type: image/png
or whatever) plus your image grabbing/generating code which you will simply
output to the browser.  Deceptively easy, yes?  :)

Hope this helps.
-Kevin


- Original Message -
From: Shane [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 13, 2002 2:21 PM
Subject: [PHP] GD Questions: Please help.


 Greetings fellow PHPers.

 I am learning basic GD functionality and I have a few YES/NO questions to
ask.
 This should only take a few seconds of your time. PLEASE HELP!

 So far I have seen several tutorials on creating graphics on the fly.
 In each example the either send the image (by itself) to a browser (using
the HEADER line) or they save it to a directory.

 Can I send an image to a browser along with other HTML and PHP
information, or does my image have to be on it's own.

 If I want to send my image to a browser with other HTML do I have to save
it to a file first?

 Does my directory that I am writing to have to have write permission set
to TRUE for me to create an image file? and if it is NOT, will I get an
error something like...
 Warning: imagejpeg: unable to open '/images/test.jpg' for writing!

 Can anyone show me a chunk of sample code or function that shows how I can
embed my images created on the fly into my normal HTML files.

 As always, thanks in advance my friends.

 - NorthBayShane

 --
 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: mail( ) and cox

2002-06-13 Thread Manuel Lemos

Hello,

On 06/13/2002 03:09 AM, [EMAIL PROTECTED] wrote:
 Hey,
 
 Does anyone know why I can't use the mail() function for my email addresses 
[EMAIL PROTECTED]? It works fine on my Hotmail account, but I would rather use my cox 
account.

What happens? Probably it is being refused because it is confused with 
SPAM. You need to see the bounced messages (if you get any) or the SMTP 
dialog to figure what is wrong.


-- 

Regards,
Manuel Lemos


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




Re: [PHP] sessions help

2002-06-13 Thread Leston Drake

I just tried adding session_start() to the beginning of both files. When I 
load Doc 1, I get this warning twice(!):

Warning: Cannot send session cache limiter - headers already sent (output 
started at c:\program files\apache group\apache\htdocs\wan\sessions.php:7) 
in c:\program files\apache group\apache\htdocs\wan\sessions.php on line 9

Same warning for Doc 2.

8-|

???


At 02:57 PM 6/13/2002, you wrote:
On Thursday, June 13, 2002 at 9:46:10 PM, you wrote:
  First, I load Doc 1 (to set the session variable).
  Then I load Doc 2 to retrieve the variable. When doc 2 runs, I get the
  following:
  
 
--
  Warning: Undefined variable: _SESSION in c:\...\getsessionvar.php on 
 line 17
  Node is .
  
 
--
  Line 17 is the } after the line return $_SESSION['node'];

  It doesn't seem to know about $_SESSION.
  Can someone help me out?

Do you have a call to start_session() at the top of both files? If not, that's
what's missing.

--
Stuart


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




Re: [PHP] Editor

2002-06-13 Thread Michael Sweeney

I've been using jEdit (www.jedit.org) for months under Linux - very
effective for PHP (as well as Java and many other languages). Perhaps
comparable to TextEdit in the Windows universe, complete with 'snippet'
insertion. Many plugins available, very extensible, very capable editor.

..michael..

On Thu, 2002-06-13 at 12:23, Ray Hunter wrote:
 Actually it is macromedia now.  And it is windows based, what about us linux
 or unix or xbsd guys.
 
 Ray Hunter
 
 
 
 - Original Message -
 From: Kurth Bemis (List Monkey) [EMAIL PROTECTED]
 To: Daniele Baroncelli [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, June 13, 2002 1:24 PM
 Subject: Re: [PHP] Editor
 
 
  At 09:18 PM 6/13/2002 +0200, Daniele Baroncelli wrote:
 
  allaire homesite hands down
 
  ~kurth
 
  Hi guys,
  
  Although any editor should be fine when coding PHP, I find that the
 standard
  Notepad it's a real pain in the ass. Especially when the script gives you
 an
  error at line 222 ! Each time I have to scroll and count each single
 line!
  
  Can anyone suggest me a different editor ?
  
  
  Cheers
  
  Daniele
  
  
  




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




RE: [PHP] Re: next and previous buttons performing on a query

2002-06-13 Thread Lazor, Ed

select ID, Title from Books where ID='500';

That will give you the current set of data to display.  Getting the previous
and next record will depend on your sort order.  Assuming ID as the sort
order, store the value of ID and query for the next record:

select ID from Books where ID  '$ID' order by ID ASC limit 1;

Previous record:

select ID from Books where ID  '$ID' order by ID DESC limit 1;

The same approach works for the Title field.


 -Original Message-
 From: blue [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 13, 2002 1:05 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: next and previous buttons performing on a query
 
 
 www.phpbuilder.com has an excellent article on creating a 
 results page that
 incorporates NEXT and PREVIOUS links/buttons so that one can navigate
 through the results.. i'll try to find an exact link.
 
 
 
 Wilbert Enserink [EMAIL PROTECTED] wrote in message
 007001c212e1$f0f14340$0c01a8c0@pulsar">news:007001c212e1$f0f14340$0c01a8c0@pulsar...
 Hi all,
 
 
 I have this mySQL query giving me my result back.
 
 The info about the current db-record is showing.
 Now I want to display ' view next ' and ' view previous ' 
 buttons on my
 website. which takes you to the same page but with the next 
 record in the
 query result.
 Is there a clever way to do this?
 
 Any tips are welcome!
 
 Many regards
 
 Wilbert Enserink
 
 -
 Pas de Deux
 Van Mierisstraat 25
 2526 NM Den Haag
 tel 070 4450855
 fax 070 4450852
 http://www.pdd.nl
 [EMAIL PROTECTED]
 -
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




Re[2]: [PHP] sessions help

2002-06-13 Thread Julie Meloni

LD I just tried adding session_start() to the beginning of both files. When I 
LD load Doc 1, I get this warning twice(!):

LD Warning: Cannot send session cache limiter - headers already sent (output 
LD started at c:\program files\apache group\apache\htdocs\wan\sessions.php:7) 
LD in c:\program files\apache group\apache\htdocs\wan\sessions.php on line 9

LD Same warning for Doc 2.


That just means you put it in the wrong place.  It has to go before
any (and any means ANY) output.


- Julie

-- Julie Meloni
-- [EMAIL PROTECTED]
-- www.thickbook.com

Find Sams Teach Yourself MySQL in 24 Hours at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


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




Re[2]: [PHP] sessions help

2002-06-13 Thread Stuart Dallas

On Thursday, June 13, 2002 at 10:04:05 PM, you wrote:

 I just tried adding session_start() to the beginning of both files. When I 
 load Doc 1, I get this warning twice(!):

 Warning: Cannot send session cache limiter - headers already sent (output 
 started at c:\program files\apache group\apache\htdocs\wan\sessions.php:7) 
 in c:\program files\apache group\apache\htdocs\wan\sessions.php on line 9

 Same warning for Doc 2.

In that case the call to session_start() is not at the beginning of the files.
By that I mean the first line in both files should be...

?php session_start(); ?

Before any HTML or other PHP code. This is because it sets a cookie which needs
to be able to send an HTTP header which can only be done before any output is
generated (unless output buffering is enabled). According to the error, the
call to session_start() is on line 9 but output was generated on line 7.

-- 
Stuart


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




[PHP] truncating dilema

2002-06-13 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi everyone, 

I'm making an idiot proof news database for a client and do not want to
include a 'description' field. I had thought to return a truncated
version of the actual stories as a description.

It has just occured to me though that if I'm to list maybe 100 news
items with descriptions it means alot of memory right because i have 100
items containing:
date
title
text (could be any length)

I will use substr() in my php to format the descriptions but I thought
I'd ask here if anyone had a *better* suggestion?

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



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

iD8DBQE9CQyyHpvrrTa6L5oRAtJdAKClDX77zJsH5LUSkaRG0KP6DEpJ2wCeK9BC
/WpypUV5ygtcBN/hwogsBeg=
=s+ae
-END PGP SIGNATURE-

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




Re[2]: [PHP] sessions help

2002-06-13 Thread Leston Drake

It's the 1st line after ?php in both files.

At 03:09 PM 6/13/2002, you wrote:
LD I just tried adding session_start() to the beginning of both files. 
When I
LD load Doc 1, I get this warning twice(!):

LD Warning: Cannot send session cache limiter - headers already sent (output
LD started at c:\program files\apache 
group\apache\htdocs\wan\sessions.php:7)
LD in c:\program files\apache group\apache\htdocs\wan\sessions.php on line 9

LD Same warning for Doc 2.


That just means you put it in the wrong place.  It has to go before
any (and any means ANY) output.


- Julie

-- Julie Meloni
-- [EMAIL PROTECTED]
-- www.thickbook.com

Find Sams Teach Yourself MySQL in 24 Hours at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


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




Re: [PHP] truncating dilema

2002-06-13 Thread Julie Meloni


NW It has just occured to me though that if I'm to list maybe 100 news
NW items with descriptions it means alot of memory right because i have 100
NW items containing:
NW date
NW title
NW text (could be any length)

NW I will use substr() in my php to format the descriptions but I thought
NW I'd ask here if anyone had a *better* suggestion?


You could use the substring() function in MySQL (or a similar function
in your db of choice) to make the db do the work instead of PHP.

- Julie

-- Julie Meloni
-- [EMAIL PROTECTED]
-- www.thickbook.com

Find Sams Teach Yourself MySQL in 24 Hours at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


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




Re: [PHP] Editor

2002-06-13 Thread Andrew Glanville

My personal preference is towards cooledit (http://cooledit.sourceforge.net).
There is one minor modification you must make, which is to edit 
~/.cedit/Syntax and change:

file ..\*\\.php[0-9]$ PHP\sProgram
include php.syntax

to:
file ..\*\\.php$ PHP\sProgram
include php.syntax

(The syntax file was last updated before PHP4 was released - you can snag a 
replacement syntax file off of the GNOME CVS tree under the midnight 
commander source section)

HTH
-andrew

PS.  It has no relationship to the win32 based sound editor

 Actually it is macromedia now.  And it is windows based, what about us
 linux or unix or xbsd guys.

 Ray Hunter

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




Re[3]: [PHP] sessions help

2002-06-13 Thread Julie Meloni

LD It's the 1st line after ?php in both files.

LD At 03:09 PM 6/13/2002, you wrote:
LD I just tried adding session_start() to the beginning of both files. 
When I
LD load Doc 1, I get this warning twice(!):

LD Warning: Cannot send session cache limiter - headers already sent (output
LD started at c:\program files\apache 
group\apache\htdocs\wan\sessions.php:7)
LD in c:\program files\apache group\apache\htdocs\wan\sessions.php on line 9


Check for whitespace, line break, etc before or after the tag, then.  These
things count as output.


- Julie

-- Julie Meloni
-- [EMAIL PROTECTED]
-- www.thickbook.com

Find Sams Teach Yourself MySQL in 24 Hours at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


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




RE: [PHP] truncating dilema

2002-06-13 Thread Lazor, Ed

Why not just put a Subject field?  Most people use that to put a brief
description of the article.  Make the form field small and they'll keep
their input small.  Plus, you can set the maxlength value of the input field
to limit things.
http://www.htmlreference.com/htmlref95.html

 -Original Message-
 From: Nick Wilson [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 13, 2002 2:21 PM
 To: php-general
 Subject: [PHP] truncating dilema
 
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Hi everyone, 
 
 I'm making an idiot proof news database for a client and do 
 not want to
 include a 'description' field. I had thought to return a truncated
 version of the actual stories as a description.
 
 It has just occured to me though that if I'm to list maybe 100 news
 items with descriptions it means alot of memory right because 
 i have 100
 items containing:
 date
 title
 text (could be any length)
 
 I will use substr() in my php to format the descriptions but I thought
 I'd ask here if anyone had a *better* suggestion?
 
 Many thanks
 - -- 
 Nick Wilson //  www.explodingnet.com
 
 
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)
 
 iD8DBQE9CQyyHpvrrTa6L5oRAtJdAKClDX77zJsH5LUSkaRG0KP6DEpJ2wCeK9BC
 /WpypUV5ygtcBN/hwogsBeg=
 =s+ae
 -END PGP SIGNATURE-
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




Re[2]: [PHP] sessions help

2002-06-13 Thread Leston Drake

Thanks to Julie and Stuart for helping me.

With your direction, I got rid of the warning about the headers by putting 
the session_start() at the beginning of the file.

Now I get a different sort of error when I try to retrive the session variable:
---
Warning: Undefined index: node in c:\program files\apache 
group\apache\htdocs\wan\getglobal.php on line 17
---

Any ideas why?

(Here's the exact code I've got)
[sessions.php]
?php session_start();?
html
head
titleA test/title
/head
body

?php
 function sessionSetNode ($node_id) {
 return ($_SESSION['node'] = $node_id);
 }

 sessionSetNode(10.2);
?

/body
/html

[getglobal.php]
?php session_start();?
html
head
titleA test/title
/head
body

?php
   if (!empty($_SESSION)) {
   extract($_SESSION);
   } else if (!empty($HTTP_SESSION_VARS)) {
   extract($HTTP_SESSION_VARS);
   }

   function sessionGetNode () {
 return $_SESSION['node'];
   }

   $n = sessionGetNode();
   echo (Node is $n.);
?

/body
/html


TIA,
Leston


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




Re: [PHP] truncating dilema

2002-06-13 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Julie Meloni declared
 You could use the substring() function in MySQL (or a similar function
 in your db of choice) to make the db do the work instead of PHP.

Nice, I'll look it up. Cheers Julie.
- -- 
Nick Wilson //  www.explodingnet.com



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

iD8DBQE9CREkHpvrrTa6L5oRAvGxAKCttJgHoPi5CUPt2uBQOQFUxwsbKwCggO6j
gzmvxVqnCrPDU1Uzd4NWUXU=
=3HFs
-END PGP SIGNATURE-

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




[PHP] Code Improvement

2002-06-13 Thread Pong-TC

Hello All

I run the simple code to display data from the database.  There are around
5000 records and 50 fields.  It takes around 1 1/2 min to retrieve the
data to the browser.  I'd like to know if we can improve my code.  So, I
can retrieve the data in a shorter period of time.  I have codes as
follows:

$conn = (mssql_connect(20.23.252.3,hello,hello)) or die(Cannot
connect to the database.);
mssql_select_db(research,$conn);

$strSQL = Select * from dss_student order by stuidterm;
$rs = mssql_query($strSQL,$conn) or die(Cannot connect to the table);

echo table border='0' cellspace=1tr;
echo th bgcolor='#faf0e6'font face='verdana' size=2NO./font/th;

while($fld = mssql_fetch_field($rs)){
echo th bgcolor='#faf0e6'font face='verdana' size=2 . $fld-name 
.
/font/th;  
}

echo /tr;

$no_row = 1;
while ($row = mssql_fetch_row($rs)){ 
if (($no_row % 2) == 1) 
echo tr;
else 
echo tr bgcolor='#faf0e6';

echo tdfont face='verdana' size=2$no_row/font/td;
for ($i=0;$i=49;$i++)
echo tdfont face='verdana' size=2$row[$i]/font/td;
$no_row++;
}
echo /table;
mssql_close();

POng



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




[PHP] RE: GD Questions: Please help.

2002-06-13 Thread Philip Hallstrom

What you have below is the usual way to do it... if you want to get a bit
fancier you can have your getimage.php script do something like this
(pseudo code):

---
figure out what image to display via the $id

if /path/to/image/cache/$id exists then
   just spit that file back to the browser and exit

otherwise...

generate the image and write it out to /path/to/image/cache/$id
and spit it back to the user.
---

This has the advantage that you only need to dynamically generate the
image once and all subsequent visitors will get the cached version and in
general things will be faster.

If they change somewhat (once a day or whatever) you could add some logic
to remove old entries, etc..

good luck!


On Thu, 13 Jun 2002, Shane wrote:

 Kevin... YOU RULE!!!

 A million billion Humble thanks!

 So simple, yet was such a pain to get past. I was racking my brain on that one!
 Man, if I could just buy you a beer online, I would.

 THANK YOU THANK YOU THANK YOU!
 - NorthBayShane

 BUT...Does this mean I will need a separate PHP page for every graphic script?
 You would think there would be a way to call it from a function.

 (Thinking out loud now...)
 But I suppose I could send a variable along with my img src=getimage.php tag like

 img src=getimage.php?id=123

 and then when the PHP code in getimage.php compares the variable passed to it's 
library of code snippets it would spit back the necessary image each time.

 H
 Is there a better way?

 -Original Message-
 From: Kevin Stone [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 13, 2002 1:34 PM
 To: [EMAIL PROTECTED]
 Subject: Re:  GD Questions: Please help.


 Shane, absolutely you can mix HTML and dynamically generated images.  You'll
 actually call the image in passively via an img tag like this...

 img src=getimage.php

 getimage.php will echo the appropriate image header (Content-type: image/png
 or whatever) plus your image grabbing/generating code which you will simply
 output to the browser.  Deceptively easy, yes?  :)

 Hope this helps.
 -Kevin


 - Original Message -
 From: Shane [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, June 13, 2002 2:21 PM
 Subject:  GD Questions: Please help.


  Greetings fellow PHPers.
 
  I am learning basic GD functionality and I have a few YES/NO questions to
 ask.
  This should only take a few seconds of your time. PLEASE HELP!
 
  So far I have seen several tutorials on creating graphics on the fly.
  In each example the either send the image (by itself) to a browser (using
 the HEADER line) or they save it to a directory.
 
  Can I send an image to a browser along with other HTML and PHP
 information, or does my image have to be on it's own.
 
  If I want to send my image to a browser with other HTML do I have to save
 it to a file first?
 
  Does my directory that I am writing to have to have write permission set
 to TRUE for me to create an image file? and if it is NOT, will I get an
 error something like...
  Warning: imagejpeg: unable to open '/images/test.jpg' for writing!
 
  Can anyone show me a chunk of sample code or function that shows how I can
 embed my images created on the fly into my normal HTML files.
 
  As always, thanks in advance my friends.
 
  - NorthBayShane
 
  --
  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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re[2]: [PHP] sessions help

2002-06-13 Thread Leston Drake

At 03:32 PM 6/13/2002, you wrote:
Thanks to Julie and Stuart for helping me.

With your direction, I got rid of the warning about the headers by putting 
the session_start() at the beginning of the file.

Now I get a different sort of error when I try to retrive the session 
variable:
---
Warning: Undefined index: node in c:\program files\apache 
group\apache\htdocs\wan\getglobal.php on line 17
---

Any ideas why?

(Here's the exact code I've got)

This is the code, w/o formatting, and w/o the html tags. Sorry about the 
formatting in the email

[sessions.php]
?php session_start();?
?php function sessionSetNode ($node_id) { return ($_SESSION['node'] = 
$node_id); } sessionSetNode(10.2); ?
[getglobal.php]
?php session_start();?
?php if (!empty($_SESSION)) { extract($_SESSION); } else if 
(!empty($HTTP_SESSION_VARS)) { extract($HTTP_SESSION_VARS); } function 
sessionGetNode () { return $_SESSION['node']; } $n = sessionGetNode(); 
echo (Node is $n.); ?

TIA,
Leston


--
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] possible to add a record number to a query?

2002-06-13 Thread David Freeman


  I would like to have a column returned in a query that tells 
  you which record I'm looking at?  Sort of like an 
  auto_increment?  IOW, the query results would look like:
  
  record   first   last
  
1  johndoe
2  joe blow
3  carol   fisher
  
  The table only has first and last, but I want the results to 
  add something like record to tell me which record it is.  

This is an sql question rather than php.

When you get your data include record as one of your select criteria...

Eg. Select record, first, last from my_table

CYA, Dave



--
--
Outback Queensland Internet   
Longreach ** New Web Site Online *
Queensland
Australia W: www.outbackqld.net.au


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




Re: Re[2]: [PHP] sessions help

2002-06-13 Thread Kevin Stone

Your problem is here..
  return ($_SESSION['node'] = $node_id);

I do not believe that you can both set and return a varaible on the same
line.  FYI, the variable which you're returning in this function is global..
so there's no reason to return it anyway.  Just fill the index and you're
all set.
-Kevin


- Original Message -
From: Leston Drake [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 13, 2002 3:32 PM
Subject: Re[2]: [PHP] sessions help


 Thanks to Julie and Stuart for helping me.

 With your direction, I got rid of the warning about the headers by putting
 the session_start() at the beginning of the file.

 Now I get a different sort of error when I try to retrive the session
variable:
 ---
 Warning: Undefined index: node in c:\program files\apache
 group\apache\htdocs\wan\getglobal.php on line 17
 ---

 Any ideas why?

 (Here's the exact code I've got)
 [sessions.php]
 ?php session_start();?
 html
 head
 titleA test/title
 /head
 body

 ?php
  function sessionSetNode ($node_id) {
  return ($_SESSION['node'] = $node_id);
  }

  sessionSetNode(10.2);
 ?

 /body
 /html

 [getglobal.php]
 ?php session_start();?
 html
 head
 titleA test/title
 /head
 body

 ?php
if (!empty($_SESSION)) {
extract($_SESSION);
} else if (!empty($HTTP_SESSION_VARS)) {
extract($HTTP_SESSION_VARS);
}

function sessionGetNode () {
  return $_SESSION['node'];
}

$n = sessionGetNode();
echo (Node is $n.);
 ?

 /body
 /html


 TIA,
 Leston


 --
 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[3]: [PHP] sessions help

2002-06-13 Thread Stuart Dallas

On Thursday, June 13, 2002 at 10:32:25 PM, you wrote:

 Thanks to Julie and Stuart for helping me.

 With your direction, I got rid of the warning about the headers by putting 
 the session_start() at the beginning of the file.

 Now I get a different sort of error when I try to retrive the session variable:
 ---
 Warning: Undefined index: node in c:\program files\apache 
 group\apache\htdocs\wan\getglobal.php on line 17
 ---

Do a print_r($_SESSION); in getglobal.php to see what the session contains.

if (!empty($_SESSION)) {
extract($_SESSION);
} else if (!empty($HTTP_SESSION_VARS)) {
extract($HTTP_SESSION_VARS);
}

Why are you doing this? If you're accessing the session through $_sESSION then
there's no need to extract the session into the global scope.

-- 
Stuart


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




Re: [PHP] RE: GD Questions: Please help.

2002-06-13 Thread Stuart Dallas

On Thursday, June 13, 2002 at 10:39:51 PM, you wrote:
 if /path/to/image/cache/$id exists then
just spit that file back to the browser and exit

If you're gonna do this, be sure to check that $id doesn't contain something
dangerous such as '../../../../../../../../../../../../../../../etc/passwd'.

-- 
Stuart


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




RE: [PHP] Code Improvement

2002-06-13 Thread Lazor, Ed

Why display all 5000 records and 50 fields at once?  Typically, you display
a sub-set of the row data and page through it to improve performance.  Also,
you typically display a sub-set of fields and then view individual records
for full detail.

 -Original Message-
 From: Pong-TC [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 13, 2002 2:40 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Code Improvement
 
 
 Hello All
 
 I run the simple code to display data from the database.  
 There are around
 5000 records and 50 fields.  It takes around 1 1/2 min to retrieve the
 data to the browser.  I'd like to know if we can improve my 
 code.  So, I
 can retrieve the data in a shorter period of time.  I have codes as
 follows:
 
 $conn = (mssql_connect(20.23.252.3,hello,hello)) or die(Cannot
 connect to the database.);
 mssql_select_db(research,$conn);
 
 $strSQL = Select * from dss_student order by stuidterm;
 $rs = mssql_query($strSQL,$conn) or die(Cannot connect to 
 the table);
 
 echo table border='0' cellspace=1tr;
 echo th bgcolor='#faf0e6'font face='verdana' 
 size=2NO./font/th;
 
 while($fld = mssql_fetch_field($rs)){
   echo th bgcolor='#faf0e6'font 
 face='verdana' size=2 . $fld-name .
 /font/th;
   }
 
 echo /tr;
 
 $no_row = 1;
 while ($row = mssql_fetch_row($rs)){ 
 if (($no_row % 2) == 1) 
   echo tr;
 else 
 echo tr bgcolor='#faf0e6';
 
 echo tdfont face='verdana' size=2$no_row/font/td;
 for ($i=0;$i=49;$i++)
   echo tdfont face='verdana' size=2$row[$i]/font/td;
 $no_row++;
 }
 echo /table;
 mssql_close();
 
 POng
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




Re: [PHP] RE: GD Questions: Please help.

2002-06-13 Thread Philip Hallstrom

most definitely... I was assuming $id would be a number which would be
looked up in a DB somewhere... in any event the realpath() function is
your friend here :)

On Thu, 13 Jun 2002, Stuart Dallas wrote:

 On Thursday, June 13, 2002 at 10:39:51 PM, you wrote:
  if /path/to/image/cache/$id exists then
 just spit that file back to the browser and exit

 If you're gonna do this, be sure to check that $id doesn't contain something
 dangerous such as '../../../../../../../../../../../../../../../etc/passwd'.

 --
 Stuart



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




Re: [PHP] Code Improvement

2002-06-13 Thread Kevin Stone

Though your code isn't the cleanest I've seen I don't think there is
anything inherently wrong with your proceedure.  You're just displaying a
LOT of information.  And more importantly you're displaying this in a
browser with HTML tables.  I'd put a timer on your code to see how much time
the actual query took.  Then subtract that from the time it took to render
the information in the browser window and you can get a pretty good feel for
where your bottle neck is.  I susspect the query will be a small percentage
of the total time involved.

Look into the microtime() to setup the timer.  Good luck.

-Kevin

- Original Message -
From: Pong-TC [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 13, 2002 3:40 PM
Subject: [PHP] Code Improvement


 Hello All

 I run the simple code to display data from the database.  There are around
 5000 records and 50 fields.  It takes around 1 1/2 min to retrieve the
 data to the browser.  I'd like to know if we can improve my code.  So, I
 can retrieve the data in a shorter period of time.  I have codes as
 follows:

 $conn = (mssql_connect(20.23.252.3,hello,hello)) or die(Cannot
 connect to the database.);
 mssql_select_db(research,$conn);

 $strSQL = Select * from dss_student order by stuidterm;
 $rs = mssql_query($strSQL,$conn) or die(Cannot connect to the table);

 echo table border='0' cellspace=1tr;
 echo th bgcolor='#faf0e6'font face='verdana' size=2NO./font/th;

 while($fld = mssql_fetch_field($rs)){
 echo th bgcolor='#faf0e6'font face='verdana' size=2 . $fld-name .
 /font/th;
 }

 echo /tr;

 $no_row = 1;
 while ($row = mssql_fetch_row($rs)){
 if (($no_row % 2) == 1)
 echo tr;
 else
 echo tr bgcolor='#faf0e6';

 echo tdfont face='verdana' size=2$no_row/font/td;
 for ($i=0;$i=49;$i++)
 echo tdfont face='verdana' size=2$row[$i]/font/td;
 $no_row++;
 }
 echo /table;
 mssql_close();

 POng



 --
 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] Change Password

2002-06-13 Thread Brian V Bonini

Anyone know of a script that will allow a user to change their system/email
password form the web on a UNIX system. wither PHP or Perl based?

-B


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




Re[3]: [PHP] sessions help

2002-06-13 Thread Leston Drake

I've stripped the code down to barest bones to try to figure this out:
[getglobal.php]
...
echo Node is {$_SESSION['node']}.;
...

[session.php]
...
$_SESSION['node'] = 10.2;
...

Other than the standard html, head, title, body tags and the 
session_start(), there is no other code.
I'm still getting the ...Undefined index: node ... warning.


Do a print_r($_SESSION); in getglobal.php to see what the session contains.

It is: Array()

 if (!empty($_SESSION)) {
 extract($_SESSION);
 } else if (!empty($HTTP_SESSION_VARS)) {
 extract($HTTP_SESSION_VARS);
 }

Why are you doing this? If you're accessing the session through $_sESSION then
there's no need to extract the session into the global scope.

With register_globals=Off, I understand that you need to extract the $_POST 
and $_GET vars. I assumed the same for $_SESSIONS. Is this not true?

TIA,
Leston



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




RE: [PHP] Editor

2002-06-13 Thread Bruce Karstedt

I've been using Homesite - I really like it.

Bruce Karstedt
President
Technology Consulting Associates, Ltd.
Tel: 847-735-9488
Fax: 847-735-9474


-Original Message-
From: Daniele Baroncelli [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 2:19 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Editor


Hi guys,

Although any editor should be fine when coding PHP, I find that the standard
Notepad it's a real pain in the ass. Especially when the script gives you an
error at line 222 ! Each time I have to scroll and count each single line!

Can anyone suggest me a different editor ?


Cheers

Daniele



--
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: Re[3]: [PHP] sessions help

2002-06-13 Thread Kevin Stone

Hmm.  Okay.  Replace $_SESSION with $HTTP_SESSION_VARS and see if that
works.
-Kevin

- Original Message -
From: Leston Drake [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 13, 2002 4:07 PM
Subject: Re[3]: [PHP] sessions help


 I've stripped the code down to barest bones to try to figure this out:
 [getglobal.php]
 ...
 echo Node is {$_SESSION['node']}.;
 ...

 [session.php]
 ...
 $_SESSION['node'] = 10.2;
 ...

 Other than the standard html, head, title, body tags and the
 session_start(), there is no other code.
 I'm still getting the ...Undefined index: node ... warning.


 Do a print_r($_SESSION); in getglobal.php to see what the session
contains.

 It is: Array()

  if (!empty($_SESSION)) {
  extract($_SESSION);
  } else if (!empty($HTTP_SESSION_VARS)) {
  extract($HTTP_SESSION_VARS);
  }
 
 Why are you doing this? If you're accessing the session through $_sESSION
then
 there's no need to extract the session into the global scope.

 With register_globals=Off, I understand that you need to extract the
$_POST
 and $_GET vars. I assumed the same for $_SESSIONS. Is this not true?

 TIA,
 Leston



 --
 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: Re[3]: [PHP] sessions help

2002-06-13 Thread Leston Drake

Yeah, I thought of that too. Same result, though.

At 04:16 PM 6/13/2002, you wrote:
Hmm.  Okay.  Replace $_SESSION with $HTTP_SESSION_VARS and see if that
works.
-Kevin

- Original Message -
From: Leston Drake [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 13, 2002 4:07 PM
Subject: Re[3]: [PHP] sessions help


  I've stripped the code down to barest bones to try to figure this out:
  [getglobal.php]
  ...
  echo Node is {$_SESSION['node']}.;
  ...
 
  [session.php]
  ...
  $_SESSION['node'] = 10.2;
  ...
 
  Other than the standard html, head, title, body tags and the
  session_start(), there is no other code.
  I'm still getting the ...Undefined index: node ... warning.
 
 
  Do a print_r($_SESSION); in getglobal.php to see what the session
contains.
 
  It is: Array()
 
   if (!empty($_SESSION)) {
   extract($_SESSION);
   } else if (!empty($HTTP_SESSION_VARS)) {
   extract($HTTP_SESSION_VARS);
   }
  
  Why are you doing this? If you're accessing the session through $_sESSION
then
  there's no need to extract the session into the global scope.
 
  With register_globals=Off, I understand that you need to extract the
$_POST
  and $_GET vars. I assumed the same for $_SESSIONS. Is this not true?
 
  TIA,
  Leston
 
 
 
  --
  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[4]: [PHP] sessions help

2002-06-13 Thread Stuart Dallas

On Thursday, June 13, 2002 at 11:07:16 PM, you wrote:

 I've stripped the code down to barest bones to try to figure this out:
 [getglobal.php]
 ...
 echo Node is {$_SESSION['node']}.;
 ...

 [session.php]
 ...
 $_SESSION['node'] = 10.2;
 ...

 Other than the standard html, head, title, body tags and the 
 session_start(), there is no other code.
 I'm still getting the ...Undefined index: node ... warning.

Do a print_r($_SESSION); in getglobal.php to see what the session contains.

 It is: Array()

How are you getting from one page to the other? Are you clicking on a link in
the first page or are you typing the second URL into the browser? The only
thing I can think is that the session id is not being passed from the first
page to the second page. This would cause the session to be empty on the
second page because it will have created a new session rather than having
imported the session the first page created. (I hope that made sense)

Why are you doing this? If you're accessing the session through $_sESSION then
there's no need to extract the session into the global scope.

 With register_globals=Off, I understand that you need to extract the $_POST 
 and $_GET vars. I assumed the same for $_SESSIONS. Is this not true?

No. If you use $_GET, $_POST and $_SESSION to get to those variables then there
is no need to extract them into the global scope.

-- 
Stuart


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




RE: Re[4]: [PHP] sessions help

2002-06-13 Thread Lazor, Ed

Have you tried this on a separate web page to make sure it's not something
server specific?

Here's a script that worked from my computer with register_globals set to on
and off (restarted server between tests for confirmation).

If this works from your computer, could you resend the code on your page?

Thanks,

-Ed


  With register_globals=Off, I understand that you need to 
 extract the $_POST 
  and $_GET vars. I assumed the same for $_SESSIONS. Is this not true?
 
 No. If you use $_GET, $_POST and $_SESSION to get to those 
 variables then there
 is no need to extract them into the global scope.
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




RE: Re[4]: [PHP] sessions help

2002-06-13 Thread Leston Drake

At 04:35 PM 6/13/2002, you wrote:
Have you tried this on a separate web page to make sure it's not something
server specific?

No, but that's a good idea. I will try it.


Here's a script that worked from my computer with register_globals set to on
and off (restarted server between tests for confirmation).

Did you send some code? I didn't receive any...?


If this works from your computer, could you resend the code on your page?

Thanks,

-Ed


Thanks for your help,
Leston



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




RE: [PHP] truncating dilema

2002-06-13 Thread David Freeman


  It has just occured to me though that if I'm to list maybe 
  100 news items with descriptions it means alot of memory 
  right because i have 100 items containing:
  date
  title
  text (could be any length)
  
  I will use substr() in my php to format the descriptions but 
  I thought I'd ask here if anyone had a *better* suggestion?

Use mysql's substring as part of your query - consult your friendly
local mysql manual for more details.

CYA, Dave


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




RE: [PHP] confused newbie on PHP and Javascript.

2002-06-13 Thread David Freeman


  I have a JavaScript function that onChange of a list box, 
  takes the value of an option and grabs data from a MySQL 
  table. My problem is how do I use the JavaScript var in my 
  sql statement?

Javascript is client-side, php is server-side.  The only way to get
something that happens in javascript to interact with something that
needs to happen on the server is to reload the page and, in doing so,
pass those variables back to the server.  The main ways you would pass
variables back to the server are either GET args in a url or POST args
from a form.

Perhaps your onChange needs to include an implied submit so that the
form data can be passed back to the server.


--
--
Outback Queensland Internet   
Longreach ** New Web Site Online *
Queensland
Australia W: www.outbackqld.net.au



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




RE: [PHP] string to array?

2002-06-13 Thread David Freeman


  I have a string something like 10.2.3
  I want to be able to use the . as a delimiter to reference 
  the elements (10, 2, and 3).

  My thought was to create an array, using . as the 
  delimiter. Is there a function that will create an array out 
  of a string, using a delimiter you specify?

$my_array = explode(., 10.2.3);

--
--
Outback Queensland Internet   
Longreach ** New Web Site Online *
Queensland
Australia W: www.outbackqld.net.au


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




RE: [PHP] Extracting Variables

2002-06-13 Thread David Freeman


  echo i = $ibr;
  for($c=1;$c=$i;$c++){
   echo team_number $team_number_$cbr;
   echo sub1_$c = $sub1_$cbr;
   echo sub2_$c = $sub2_$cbr;
   echo sub3_$c = $sub3_$cbr;
   echo sub4_$c = $sub4_$cbr;
   echo sub5_$c = $sub5_$cbr;
   }
  }

Perhaps this:

Echo sub1_$c = $sub1_$c[$c];



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




RE: Re[4]: [PHP] sessions help

2002-06-13 Thread Leston Drake


Hey, it worked on another server!
I've been working on my local machine's server (localhost), but when I run 
it from a different web server, it worked fine.

Any ideas about which setting(s) may be causing the problem?

 From my php.ini file:
session.save_handler=files
session.save_path= C:\PHP\sessiondata
session.use_cookies=1
session.name=PHPSESSID
session.auto_start=0
session.cookie_lifetime=0
session.cookie_path=/
session.cookie_domain=
session.serialize_handler=php
session.gc_probability=1
session.gc_maxlifetime=1440
session.referer_check=
session.entropy_length=0
session.entropy_file=
session.cache_limiter=nocache
session.cache_expire=180
session.use_trans_sid=1


At 04:35 PM 6/13/2002, you wrote:
Have you tried this on a separate web page to make sure it's not something
server specific?


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




RE: Re[4]: [PHP] sessions help

2002-06-13 Thread Lazor, Ed

 Hey, it worked on another server!
 I've been working on my local machine's server (localhost), 
 but when I run it from a different web server, it worked fine.
 
 Any ideas about which setting(s) may be causing the problem?

Nope, but I'm including a copy of my local php.ini for ya to compare with.

[PHP]

;;;
; About this file ;
;;;
;
; This is the recommended, PHP 4-style version of the php.ini-dist file.  It
; sets some non standard settings, that make PHP more efficient, more
secure,
; and encourage cleaner coding.
; The price is that with these settings, PHP may be incompatible with some
; applications, and sometimes, more difficult to develop with.  Using this
; file is warmly recommended for production sites.  As all of the changes
from
; the standard settings are thoroughly documented, you can go over each one,
; and decide whether you want to use it or not.
;
; For general information about the php.ini file, please consult the
php.ini-dist
; file, included in your PHP distribution.
;
; This file is different from the php.ini-dist file in the fact that it
features
; different values for several directives, in order to improve performance,
while
; possibly breaking compatibility with the standard out-of-the-box behavior
of
; PHP 3.  Please make sure you read what's different, and modify your
scripts
; accordingly, if you decide to use this file instead.
;
; - register_globals = Off [Security, Performance]
; Global variables are no longer registered for input data (POST, GET,
cookies,
; environment and other server variables).  Instead of using $foo, you
must use
; you can use $_REQUEST[foo] (includes any variable that arrives
through the
; request, namely, POST, GET and cookie variables), or use one of the
specific
; $_GET[foo], $_POST[foo], $_COOKIE[foo] or $_FILES[foo],
depending
; on where the input originates.  Also, you can look at the
; import_request_variables() function.
; Note that register_globals is going to be depracated (i.e., turned off
by
; default) in the next version of PHP, because it often leads to
security bugs.
; Read http://php.net/manual/en/security.registerglobals.php for further
; information.
; - display_errors = Off   [Security]
; With this directive set to off, errors that occur during the execution
of
; scripts will no longer be displayed as a part of the script output,
and thus,
; will no longer be exposed to remote users.  With some errors, the
error message
; content may expose information about your script, web server, or
database
; server that may be exploitable for hacking.  Production sites should
have this
; directive set to off.
; - log_errors = On[Security]
; This directive complements the above one.  Any errors that occur
during the
; execution of your script will be logged (typically, to your server's
error log,
; but can be configured in several ways).  Along with setting
display_errors to off,
; this setup gives you the ability to fully understand what may have
gone wrong,
; without exposing any sensitive information to remote users.
; - output_buffering = 4096[Performance]
; Set a 4KB output buffer.  Enabling output buffering typically results
in less
; writes, and sometimes less packets sent on the wire, which can often
lead to
; better performance.  The gain this directive actually yields greatly
depends
; on which Web server you're working with, and what kind of scripts
you're using.
; - register_argc_argv = Off   [Performance]
; Disables registration of the somewhat redundant $argv and $argc global
; variables.
; - magic_quotes_gpc = Off [Performance]
; Input data is no longer escaped with slashes so that it can be sent
into
; SQL databases without further manipulation.  Instead, you should use
the
; function addslashes() on each input element you wish to send to a
database.
; - variables_order = GPCS   [Performance]
; The environment variables are not hashed into the $HTTP_ENV_VARS[].
To access
; environment variables, you can use getenv() instead.
; - error_reporting = E_ALL[Code Cleanliness, Security(?)]
; By default, PHP surpresses errors of type E_NOTICE.  These error
messages
; are emitted for non-critical errors, but that could be a symptom of a
bigger
; problem.  Most notably, this will cause error messages about the use
; of uninitialized variables to be displayed.
; - allow_call_time_pass_reference = Off [Code cleanliness]
; It's not possible to decide to force a variable to be passed by
reference
; when calling a function.  The PHP 4 style to do this is by making the
; function require the relevant argument by reference.



; Language Options ;


; Enable the PHP scripting language engine under Apache.
engine = On

; Allow the ? tag.  

[PHP] Shut down server

2002-06-13 Thread Rosen

Hi,
I tried to shut down my server with exex(/sbin/poweroff) but nothing
happened!
Can someone tell me how I could make shut down the server ?
Is it possible ?

Thanks,
Rosen



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




RE: [PHP] Shut down server

2002-06-13 Thread Lazor, Ed

That all depends on what kind of server you're referring to.

 -Original Message-
 Hi,
 I tried to shut down my server with exex(/sbin/poweroff) but nothing
 happened!
 Can someone tell me how I could make shut down the server ?
 Is it possible ?
 
 Thanks,
 Rosen
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




[PHP] Re: Shut down server

2002-06-13 Thread Rosen


 Hi,
 I tried to shut down my server with exex(/sbin/poweroff) but nothing
 happened!
 Can someone tell me how I could make shut down the server ?
 Is it possible ?
The server is Linux Red Hat 7.2.



 Thanks,
 Rosen





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




Re: [PHP] Shut down server

2002-06-13 Thread Rosen

The server is Linux Red Hat 7.2


Ed Lazor [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 That all depends on what kind of server you're referring to.

  -Original Message-
  Hi,
  I tried to shut down my server with exex(/sbin/poweroff) but nothing
  happened!
  Can someone tell me how I could make shut down the server ?
  Is it possible ?
 
  Thanks,
  Rosen



 This message is intended for the sole use of the individual and entity to
 whom it is addressed, and may contain information that is privileged,
 confidential and exempt from disclosure under applicable law.  If you are
 not the intended addressee, nor authorized to receive for the intended
 addressee, you are hereby notified that you may not use, copy, disclose or
 distribute to anyone the message or any information contained in the
 message.  If you have received this message in error, please immediately
 advise the sender by reply email and delete the message.  Thank you very
 much.



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




Re: [PHP] PCRE Problem

2002-06-13 Thread James Clifford

On Thu, Jun 13, 2002 at 03:49:00PM +0100, Brian McGarvie wrote:
 $string = '[b]Test[/b]';
 $bbcode_string = str_replace(, [, str_replace(, ], $string));
 
 or look into regular expressions...

It's probably better to do as Brian suggests: use regular expressions so
that you can avoid cases like

[b onMouseOver=executesomejavascript]Test[/b]

With something like

$bbcode_string = preg_replace(/\[(\/?)b\]/i, $1b, $string);

  -Original Message-
  From: Erick Lee [mailto:[EMAIL PROTECTED]]
  Sent: 13 June 2002 3:25 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] PCRE Problem
  
  
  
  I want to change it to 
  $string = bTest/b
  How?
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
James Clifford
[EMAIL PROTECTED]

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




RE: [PHP] Shut down server

2002-06-13 Thread Lazor, Ed

This has serious security implications.  Research how to create a script on
your system.  Set it's sticky bit to run as a standard user that has
authorization to run the shutdown command using SUDO.  Make sure the script
works from within UNIX and then call the script from PHP using exec.

I am not a security expert.  Check with others to get their opinion on
whether this is the best approach.

 -Original Message-
 The server is Linux Red Hat 7.2
   Can someone tell me how I could make shut down the server ?
   Is it possible ?
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




[PHP] MySQL Query Help!!!!

2002-06-13 Thread Chris Kay


I have a rather longer query which I would like to get all records past todays date.
Here is my query

$ttwo = date(YmdGi);

$dbq = select(select detail.*, type.type_name, status.status_name, staff.staff_name, 
source.source_long,
source.source_short from detail, type, status, staff,
source where type.type_id = detail.detail_type  status.status_id = 
detail.detail_status 
staff.staff_id = detail.detail_staff  source.source_short = detail.detail_source  
'detail_start_date_y,detail_start_date_m,detail_start_date_d,detail_start_time_h,detail_start_time_m'
 = '$ttwo' order by detail.detail_start_date_m DESC, detail.detail_start_date_d 
DESC);

The query works fine before I try to get all records in the furure as shown below

'detail_start_date_y,detail_start_date_m,detail_start_date_d,detail_start_time_h,detail_start_time_m'
 = '$ttwo'

The query does not error out it just does not give any records, and I know there are 4 
records

Detail_start_date_y = 4 digit year
Detail_start_date_m = 2 digit month
Deatil_start_date_d = 2 digit day
Detail_start_time_h = 24 hour time

Can anyone see what I am doing wrong?

Thanks in advance.

---
Chris Kay
Technical Support - Techex Communications 
Website: www.techex.com.au   Email: [EMAIL PROTECTED]
Telephone: 1300 88 111 2 - Fax: (02) 9970 5788 
Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102 
Platinum Channel Partner of the Year - Request DSL - Broadband for Business
---

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




RE: [PHP] MySQL Query Help!!!!

2002-06-13 Thread Lazor, Ed

This is a MySQL question and best directed to the MySQL mailing lists
available at:
http://www.mysql.com/documentation/lists.html



 -Original Message-
 From: Chris Kay [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 13, 2002 4:33 PM
 To: PHP General List
 Subject: [PHP] MySQL Query Help
 
 
 
 I have a rather longer query which I would like to get all 
 records past todays date.
 Here is my query
 
 $ttwo = date(YmdGi);
 
 $dbq = select(select detail.*, type.type_name, 
 status.status_name, staff.staff_name, source.source_long,
 source.source_short from detail, type, status, staff,
 source where type.type_id = detail.detail_type  
 status.status_id = detail.detail_status 
 staff.staff_id = detail.detail_staff  source.source_short = 
 detail.detail_source  
 'detail_start_date_y,detail_start_date_m,detail_start_date_d,d
 etail_start_time_h,detail_start_time_m' = '$ttwo' order by 
 detail.detail_start_date_m DESC, detail.detail_start_date_d DESC);
 
 The query works fine before I try to get all records in the 
 furure as shown below
 
 'detail_start_date_y,detail_start_date_m,detail_start_date_d,d
 etail_start_time_h,detail_start_time_m' = '$ttwo'
 
 The query does not error out it just does not give any 
 records, and I know there are 4 records
 
 Detail_start_date_y = 4 digit year
 Detail_start_date_m = 2 digit month
 Deatil_start_date_d = 2 digit day
 Detail_start_time_h = 24 hour time
 
 Can anyone see what I am doing wrong?
 
 Thanks in advance.
 
 --
 -
 Chris Kay
 Technical Support - Techex Communications 
 Website: www.techex.com.au   Email: [EMAIL PROTECTED]
 Telephone: 1300 88 111 2 - Fax: (02) 9970 5788 
 Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102 
 Platinum Channel Partner of the Year - Request DSL - 
 Broadband for Business
 --
 -
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




RE: [PHP] MySQL Query Help!!!!

2002-06-13 Thread Lazor, Ed

ps... from a PHP perspective, you may find troubleshooting things like this
easier by using formatting like this:

$sql = 
select 
detail.*,
type.type_name,
status.status_name,
staff.staff_name,
source.source_long,
source.source_short from detail,
type, status, staff,
source
where 
type.type_id = detail.detail_type  
status.status_id = detail.detail_status 
staff.staff_id = detail.detail_staff  
source.source_short =  detail.detail_source  

'detail_start_date_y,detail_start_date_m,detail_start_date_d,detail_start_ti
me_h,detail_start_time_m' = '$ttwo'
order by
detail.detail_start_date_m DESC, 
detail.detail_start_date_d DESC
;

$dbq = select($sql);




 -Original Message-
 From: Chris Kay [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 13, 2002 4:33 PM
 To: PHP General List
 Subject: [PHP] MySQL Query Help
 
 
 
 I have a rather longer query which I would like to get all 
 records past todays date.
 Here is my query
 
 $ttwo = date(YmdGi);
 
 $dbq = select(select detail.*, type.type_name, 
 status.status_name, staff.staff_name, source.source_long,
 source.source_short from detail, type, status, staff,
 source where type.type_id = detail.detail_type  
 status.status_id = detail.detail_status 
 staff.staff_id = detail.detail_staff  source.source_short = 
 detail.detail_source  
 'detail_start_date_y,detail_start_date_m,detail_start_date_d,d
 etail_start_time_h,detail_start_time_m' = '$ttwo' order by 
 detail.detail_start_date_m DESC, detail.detail_start_date_d DESC);
 
 The query works fine before I try to get all records in the 
 furure as shown below
 
 'detail_start_date_y,detail_start_date_m,detail_start_date_d,d
 etail_start_time_h,detail_start_time_m' = '$ttwo'
 
 The query does not error out it just does not give any 
 records, and I know there are 4 records
 
 Detail_start_date_y = 4 digit year
 Detail_start_date_m = 2 digit month
 Deatil_start_date_d = 2 digit day
 Detail_start_time_h = 24 hour time
 
 Can anyone see what I am doing wrong?
 
 Thanks in advance.
 
 --
 -
 Chris Kay
 Technical Support - Techex Communications 
 Website: www.techex.com.au   Email: [EMAIL PROTECTED]
 Telephone: 1300 88 111 2 - Fax: (02) 9970 5788 
 Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102 
 Platinum Channel Partner of the Year - Request DSL - 
 Broadband for Business
 --
 -
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




[PHP] question about ? :

2002-06-13 Thread Lee Doolan


the arrays below have dates like
dateA= array( 0= 03, 1= 22, 2= 02) 

for 22march2002.

why does this work:

$retval= ($dateA[2] != $dateB[2])
 ? strcmp($dateA[2], $dateB[2])
 : (($dateA[0] != $dateB[0])
 ? strcmp($dateA[0], $dateB[0])
 : (($dateA[1] != $dateB[1])
 ? strcmp($dateA[1], $dateB[1])
 : 0));


but not this:

$retval= ($dateA[2] != $dateB[2])
 ? strcmp($dateA[2], $dateB[2])
 : ($dateA[0] != $dateB[0])
 ? strcmp($dateA[0], $dateB[0])
 : ($dateA[1] != $dateB[1])
 ? strcmp($dateA[1], $dateB[1])
 : 0;

-- 
When the birdcage is open,   | donate to causes I care about: 
the selfish bird flies away, |http://svcs.affero.net/rm.php?r=leed_25
but the virtuous one stays.  |

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




<    1   2   3   >