RE: [PHP] perplexed as to why this is happening...

2002-11-24 Thread Michael Hazelden
Ahem ...

$sec=1 means set $sec to 1

You want

$sec==1

:-)

M.

-Original Message-
From: Peter Houchin [mailto:[EMAIL PROTECTED]]
Sent: 25 November 2002 00:53
To: php_gen
Subject: [PHP] perplexed as to why this is happening...


Howdy,

I'm doing a simple db check.. grabbing a db value, in this case $sec, based
on the user name registered in the session,
I've created a user called test with $sec  equal to 2 but when i get to
the second echo of $sec the value has changed to 1 and I can't understand
why... can some one please give me some idea as to why this is happening?

elseif ($_POST['cost'] =11){
//query db
$res = mysql_query(SELECT sec FROM users WHERE uname='$_SESSION[uname]');
$num = mysql_numrows($res) ;
if ($num == 1) {
//get results
$sec = mysql_result($res, 0, 'sec');
echo $sec; // pulls out sec as 2 ( as is sposed to )
}
if (!$sec = 1){
echo font class='content'please contact your nearest
representive/font;
}
else {
echo $sec; // on this echo $sec has changed value from 2 to 1

Cheers

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



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


_
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.


*

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the Company). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*

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




RE: [PHP] using move_uploaded_file

2002-11-20 Thread Michael Hazelden
http://www.php.net/manual/sk/features.file-upload.php

found in 2 seconds searching the PHP site for Uploaded File.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 20 November 2002 05:32
To: [EMAIL PROTECTED]
Subject: [PHP] using move_uploaded_file


can anyone give me a hint  as to how to use a file upload script any kind of
code will be good.. I am using IIS5.0 with PHP 4.2.3.

Regards
Nirat



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


_
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.


*

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the Company). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*

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




[PHP] Socket help

2002-11-15 Thread Michael Hazelden
Hi all,

I need to set the KEEPALIVE value for a socket ... and just want to be
certain of what I'm seeing.

When I make my initial connection - the default value for the keepalive
seems to be 0 ... does this mean that no TCP keepalives will be sent on the
socket? Or am I doing something wrong?

Thanks for your help,

Michael.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.


*

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the Company). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*

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




Re: [PHP] Validating postal codes

2002-11-15 Thread Michael Hazelden
This is a RTFM situation!!!

instead of just $form[autopstcode] - use str_replace(
,,$form[autopstcode])

(e.g. strip the spaces before validating the triplets)

found in 30 seconds by typing string on PHP site.

-Original Message-
From: DonPro [mailto:donpro;lclcan.com]
Sent: 15 November 2002 14:45
To: php list
Subject: [PHP] Validating postal codes


Hi,

I'm trying to validate a Canadian postal code.  I've already written a
function; code as follows:

if(!eregi('(^[a-z][0-9][a-z][0-9][a-z][0-9]$)',$form[authpstcode])) {
   $errors[] = 'You must input a valid Canadian postal code (A9A9A9) postal
code if he/she resides in Canada';
   $continue = false;
}

The above works OK if the user enters -- M2M6N6

But fails if the user enters --- M2M 6N6  (note the space between the two
triplets)

I want my function to validate either, i.e., allow a space between the two
triplets but not enforce it.

Any idea on how to modify my test?

Thanks,
Don



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


_
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.


*

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the Company). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*

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




RE: [PHP] php Wildcard???

2002-11-15 Thread Michael Hazelden
Wildcard for what? 

Please be more specific ... do you mean database queries ... regular
expressions ... what?

Thanks.

-Original Message-
From: vernon [mailto:vernon;comp-wiz.com]
Sent: 15 November 2002 15:32
To: [EMAIL PROTECTED]
Subject: [PHP] php Wildcard???


Hey all, I'm coming over from programming ASP in VBScript and I know that a
wildcard there is '%' can anyone tell me what it is in PHP? Thanks.



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


_
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.


*

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the Company). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*

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




RE: [PHP] runing com

2002-11-14 Thread Michael Hazelden
Apologies all - that should have just gone to the Windows list ...

-Original Message-
From: Michael Hazelden [mailto:michael.hazelden;ocado.com]
Sent: 14 November 2002 10:18
To: 'kai'; [EMAIL PROTECTED]
Subject: [PHP-WIN] RE: [PHP] runing com


Kai,

I've moved this to the Windows list because someone else here might be able
to add something.

I'm afaid I didn't have to adjust anything within the PHP ini or anything -
for me it worked pretty much out of the box.

With regards the registry - in order to check that you are using the
appropriate application id - simply open up regedit and search for the name
of the identifier you are using - if it's going to be used as a COM
identifier - it has to be in there somewhere.

Finding out what that identifier is though (if you don't already know it)
... is another matter ... the easiest way (I think) ... is to use
HKEY_CLASSES_ROOT in the registry ... browse through that list and look to
see if there is something appropriate.

In your case - for Media Player - I found Mediaplayer.mediaplayer in my
Windows 2000 server registry. It might be the one - but I haven't tried that
to see whether it works.

Basically - if you don't have documentation on the functions contained
within a COM object - you are a little shafted ... because it's going to be
very hard to know what functions to access and how.

Luckily - in my case - the application I interface with has full COM
documentation.

Sorry I can't be of more assistance.

Michael.

-Original Message-
From: kai [mailto:kai_flash;hotmail.com]
Sent: 14 November 2002 19:05
To: [EMAIL PROTECTED]
Subject: Re: [PHP] runing com


Hi Michael,
thanks for your reply.

 Firstly - that error would suggest to me that Word is not installed on
your
 machine.

Thats true thats why i've been trying to start other applications like
wordpad,
just to see some funktionality.

... try looking it up in the registry to confirm the registration
 for COM exists.

Maybe you can give me a little hint on that.
I've been creating some com components in vb some time ago,
but as I remember I had to register them with regsvr.exe  but that was
for dll's and stuff.

But hey I don't know exactly what you are suggesting, please help.

 Second ... why do you want to run media player to play a wave file on the
 server? I would have thought you'd want to activate the script on the
client

No, what I am trying to do is, if someone I know activates a button on my
site,
a sound file will play on my server, which is locate in my kitchen, to catch
my attention.

Further more I'd like to control outlook for different tasks.

 Another good idea is to check over the event viewer on the server - there
 are sometime some very revealing errors in there.

I've tried that, but did not see any entries related to my problem.

If your com code is running fine,
maybe you can remember if you have some special settings in
your php.ini, appache or win2k settings.

Any suggestion is welcome.

Thank you very much

KAi
Michael Hazelden [EMAIL PROTECTED] wrote in message
news:C1260EE72F22C44F833D033A17524AD702A4D159;lhoexc1...
 I've been having some fun with COM myself recently ... so I can suggest a
 couple of things ...

 Firstly - that error would suggest to me that Word is not installed on
your
 machine. Remember - in order to interface with an app - it has to be
there.
 If it is ... try looking it up in the registry to confirm the registration
 for COM exists.

 Second ... why do you want to run media player to play a wave file on the
 server? I would have thought you'd want to activate the script on the
client
 ...

 Another good idea is to check over the event viewer on the server - there
 are sometime some very revealing errors in there.

 Cheers,

 Michael.

 -Original Message-
 From: kai [mailto:kai_flash;hotmail.com]
 Sent: 14 November 2002 07:20
 To: [EMAIL PROTECTED]
 Subject: [PHP] runing com


 hi guy's I have a problem running com+ code and would appreciate any help.

 What I like to do is have the mediaplayer run a wave file triggert from
php
 via com.
 but I can not run any example code from the help without errors.


 this code is from a the help and should work but doesn't on my mashine:

 // starting word
 $word = new COM(word.application) or die(Unable to instanciate Word);
 print Loaded Word, version {$word-Version}\n;

 file://bring it to front
 $word-Visible = 1;
 file://open an empty document
 $word-Documents-Add();
 file://do some weird stuff
 $word-Selection-TypeText(This is a test...);
 $word-Documents[1]-SaveAs(Useless test.doc);
 file://closing word
 $word-Quit();
 file://free the object
 $word-Release();
 $word = null;

 This is all very basic code and should run.
 I do not have word so I tried with other apps. like wordpad or painbrush
 but allways recieve this error:

 Warning: Invalid ProgID, GUID string, or Moniker: Invalid syntax in
 D:\Apache\htdocs\ring.php on line 7
 Unable to instanciate ..

 Now I tried to give

RE: [PHP] runing com

2002-11-13 Thread Michael Hazelden
I've been having some fun with COM myself recently ... so I can suggest a
couple of things ...

Firstly - that error would suggest to me that Word is not installed on your
machine. Remember - in order to interface with an app - it has to be there.
If it is ... try looking it up in the registry to confirm the registration
for COM exists.

Second ... why do you want to run media player to play a wave file on the
server? I would have thought you'd want to activate the script on the client
...

Another good idea is to check over the event viewer on the server - there
are sometime some very revealing errors in there.

Cheers,

Michael.

-Original Message-
From: kai [mailto:kai_flash;hotmail.com]
Sent: 14 November 2002 07:20
To: [EMAIL PROTECTED]
Subject: [PHP] runing com


hi guy's I have a problem running com+ code and would appreciate any help.

What I like to do is have the mediaplayer run a wave file triggert from php
via com.
but I can not run any example code from the help without errors.


this code is from a the help and should work but doesn't on my mashine:

// starting word
$word = new COM(word.application) or die(Unable to instanciate Word);
print Loaded Word, version {$word-Version}\n;

file://bring it to front
$word-Visible = 1;
file://open an empty document
$word-Documents-Add();
file://do some weird stuff
$word-Selection-TypeText(This is a test...);
$word-Documents[1]-SaveAs(Useless test.doc);
file://closing word
$word-Quit();
file://free the object
$word-Release();
$word = null;

This is all very basic code and should run.
I do not have word so I tried with other apps. like wordpad or painbrush
but allways recieve this error:

Warning: Invalid ProgID, GUID string, or Moniker: Invalid syntax in
D:\Apache\htdocs\ring.php on line 7
Unable to instanciate ..

Now I tried to give the access right's on the particular apps in dcomcnfg
and
also edited php.ini to
allow Distributed-COM calls
com.allow_dcom = true


Does anybody can give me a run down on what I have to do exactly to get this
code running for
let's say wordpad.

Thank you

KAi







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


_
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.


*

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the Company). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*

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




RE: [PHP] strtotime bug? end of the month.

2002-10-31 Thread Michael Hazelden
How about - and a little more complex ...

$mydate = date(d)!=1  date(d,strtotime(+1 month))==1 ?
date(Y-m-d,strtotime(+1 month)-86400) : date(Y-m-d,strtotime(+1
month));

to summarise - if you perform your +1 month and it creates a day of 1, but
the current day isn't 1 - do the same calculation, but a day less ...
otherwise - do the month more. I haven't tested it - but it should give the
results you want.

-Original Message-
From: 1LT John W. Holmes [mailto:holmes072000;charter.net]
Sent: 31 October 2002 17:10
To: Jeff Bearer; [EMAIL PROTECTED]
Subject: Re: [PHP] strtotime bug? end of the month.


 date(Y-m-d,strtotime(+1 month))
 
 returns December 1st!  This happens when you add 1 month to any day that
 doesn't exist in the next month.  Quite annoying that you have to handle
 it like this:
 
 date(Y-m-d,strtotime(+1 month,strtotime(date(Y-m-1

How about

echo date('y-m-d',strtotime('next month last day'));

---John Holmes...

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


_
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.


*

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the Company). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*

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




RE: [PHP] Image library

2002-08-21 Thread Michael Hazelden

I did something like this a while ago ... and while it might not be the best
solution - here's my situation and my solution:

I had a number of photos (just shy of 1000) ...

all were from various theatre shows ... taken at a different time of the
process (rehearsal ... performance etc).

So - I set up the following table in MySQL:

Photo ID - an auto increment integer
Show ID - an integer
Time ID - an integer
Imagetype - a string (JPG or Gif etc)

When the file was then uploaded - the user selects a show and time to store
it under. The file is then transferred to a directory numbered thus :

/photos/showid/timeid/photoid.jpg

When I then want to find a photo - it does a query over the database,
retrieves the information and can access the photo appropriately.

The downside of this - is that in order to know which photo is which - you
have to access the database first.

Dunno if that helps - but I thought I'd share my experience.

Michael.

-Original Message-
From: Scott Houseman [mailto:[EMAIL PROTECTED]]
Sent: 21 August 2002 14:39
To: Justin French; PHP General
Subject: RE: [PHP] Image library


Hi all.

This confirms what I suspected.

The hash algrithm:

I have a directory structure: dirs 0 - f, and within each of these, the same
dir structure 0 - f.
When an image gets uploaded into the library, do an md5sum of the file, take
the first 2 chars of that hash
and there's your path. e.g
$PICDBPATH.'/a/7/a7b8be10b0e69fe3decaa538f1febe84'

I'm not sure what the mathematical randomness of this is, but I'm sure it's
pretty random, and the chances
of collision should be virtually null, the only time you should overwrite a
file is if you upload the exact same file(?)
Is there a better way of doing this?

Cheers

-Scott

 -Original Message-
 From: Justin French [mailto:[EMAIL PROTECTED]]
 Sent: 21 August 2002 03:25
 To: [EMAIL PROTECTED]; PHP General
 Subject: Re: [PHP] Image library


 on 21/08/02 9:45 PM, Scott Houseman ([EMAIL PROTECTED]) wrote:


  Which way would be the most efficient/fastest to access images
 from an image
  library.
  A) Store image files in a hash directory structure AND storing
 each file's
  information in a mysql table
  OR
  B) Storing image information in mysql table AND storing the
 image in a BLOB
  field in that table.

 From all accounts I've read on this list, a database is not
 usually faster
 than a filesystem.  And for large amounts of files, like 1000's,
 a hash will
 speed it up more.


  The way I see it, considerations to be taken into acount:
  - Is it quicker/better to retrieve image from table  then stream out to
  browser OR simply direct the browser to the file?
  i.e IMG SRC=/imagelib/image.php?iImageID=10 OR IMG
  SRC=/imagelib/5/f/10
  - Will a database OR filesystem be more scalable i.e. which wil perform
  better when there are 1 images in the libary?

 Filesystem should be quicker.  You need to think about how you hash the
 files up for the most even spread of files in each directory I guess.


 Justin




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


_
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.


*

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the Company). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*

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




RE: [PHP] create header and redirecting

2002-08-15 Thread Michael Hazelden

AFAIK - you can't echo or print before sending a header.

If you want to do this - maybe use meta tags rather than the location
redirect.

Michael.

-Original Message-
From: Reymond [mailto:[EMAIL PROTECTED]]
Sent: 15 August 2002 11:40
To: 'Michael Hazelden'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] create header and redirecting


$formy = select id, login, level, is_active from User where login =
'$login' AND password=md5('$passwordacting');
$data = mysql_query($formy,$cnx);
$result_data = mysql_fetch_array($data);
echo $result_data['id']; -- this line 16 , I wanna try to print to
browser.., and work good..
echo $row['hasil'];


if ($row[result]==0) 
{
..


-Original Message-
From: Michael Hazelden [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 15, 2002 5:14 PM
To: 'Reymond '
Subject: RE: [PHP] create header and redirecting

Reymond,

What is Line 16?

Michael.

-Original Message-
From: Reymond [mailto:[EMAIL PROTECTED]]
Sent: 15 August 2002 11:00
To: [EMAIL PROTECTED]
Subject: [PHP] create header and redirecting


I have tree pages, we call it first.php, second.php, third.php 
On My first.php page, I have form (LOGIN FORM)  and I'd action it to
second page. Like this Below
 form method=post action=second.php..

In my second page I'd tried to use header, for redirecting to third.php
after check the session, in my Session table in my Database, (and I've
got the session on my database.
 second.php 
..
if ($row[result]==0) 
{
header(location: http://www.blabla/blablba/second.php?message=font
color=redIncorrect Password/font);
}
elseif ($row[result]!= 0) 
{
$id = $result_data['id'];
mysql_query(Delete from Session where user = '$id', $cnx);
$session_id = randSession();
mysql_query(Insert into Session values('$id','$session_id'));
if ($result_data[level]==1)
{
header(location:
third.php?id=$idsession_id=$session_id);--LINE 33
}
else
{
header(location: third.php?id=$idsession_id=$session_id);
}

}
..
---

doesn't got redirecting to the third.php but I got error message  on my
second.php..., like this below.

Warning: Cannot add header information - headers already sent by (output
started at /home/unri/ketahanan-pangan/second.php:16) in
/home/unri/ketahanan-pangan/second.php on line 32

1. so how to use buffer for redirecting 
2. is it right if I give the action(I mean Action Form) in my first.php
page to the second.php page..???,  

note : I have check my Session table On My database (MYSQL), and I got
it...

Help... 



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


_
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre.

This message has been checked for all known viruses by the MessageLabs
Virus Control Centre.


*

Notice:  This email is confidential and may contain copyright material
of Ocado Limited (the Company). Opinions and views expressed in this
message may not necessarily reflect the opinions and views of the
Company.
If you are not the intended recipient, please notify us immediately and
delete all copies of this message. Please note that it is your
responsibility to scan this message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*


_
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.


*

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the Company). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*

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




RE: [PHP] create header and redirecting

2002-08-15 Thread Michael Hazelden

Actually - I meant:

META HTTP-EQUIV=Refresh CONTENT=1; URL=http://your.website.com;

This will perform the same thing as the location redirect ... only it does
it in the body of the HTML.

M. 

-Original Message-
From: Reymond [mailto:[EMAIL PROTECTED]]
Sent: 15 August 2002 11:55
To: 'Michael Hazelden'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] create header and redirecting


That's u mean this meta..

meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
I have used it..
I am newbie in php scripting on asp I do Buffer on top of page to
redirecting like this below.
Response.Buffer = True 'Buffers the content so our Response.Redirect
will work
..
is it available on php scripting..??


-Original Message-
From: Michael Hazelden [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 15, 2002 5:28 PM
To: 'Reymond '
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] create header and redirecting

AFAIK - you can't echo or print before sending a header.

If you want to do this - maybe use meta tags rather than the location
redirect.

Michael.

-Original Message-
From: Reymond [mailto:[EMAIL PROTECTED]]
Sent: 15 August 2002 11:40
To: 'Michael Hazelden'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] create header and redirecting


$formy = select id, login, level, is_active from User where login =
'$login' AND password=md5('$passwordacting');
$data = mysql_query($formy,$cnx);
$result_data = mysql_fetch_array($data);
echo $result_data['id']; -- this line 16 , I wanna try to print to
browser.., and work good..
echo $row['hasil'];


if ($row[result]==0) 
{
..


-Original Message-
From: Michael Hazelden [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 15, 2002 5:14 PM
To: 'Reymond '
Subject: RE: [PHP] create header and redirecting

Reymond,

What is Line 16?

Michael.

-Original Message-
From: Reymond [mailto:[EMAIL PROTECTED]]
Sent: 15 August 2002 11:00
To: [EMAIL PROTECTED]
Subject: [PHP] create header and redirecting


I have tree pages, we call it first.php, second.php, third.php 
On My first.php page, I have form (LOGIN FORM)  and I'd action it to
second page. Like this Below
 form method=post action=second.php..

In my second page I'd tried to use header, for redirecting to third.php
after check the session, in my Session table in my Database, (and I've
got the session on my database.
 second.php 
..
if ($row[result]==0) 
{
header(location: http://www.blabla/blablba/second.php?message=font
color=redIncorrect Password/font);
}
elseif ($row[result]!= 0) 
{
$id = $result_data['id'];
mysql_query(Delete from Session where user = '$id', $cnx);
$session_id = randSession();
mysql_query(Insert into Session values('$id','$session_id'));
if ($result_data[level]==1)
{
header(location:
third.php?id=$idsession_id=$session_id);--LINE 33
}
else
{
header(location: third.php?id=$idsession_id=$session_id);
}

}
..
---

doesn't got redirecting to the third.php but I got error message  on my
second.php..., like this below.

Warning: Cannot add header information - headers already sent by (output
started at /home/unri/ketahanan-pangan/second.php:16) in
/home/unri/ketahanan-pangan/second.php on line 32

1. so how to use buffer for redirecting 
2. is it right if I give the action(I mean Action Form) in my first.php
page to the second.php page..???,  

note : I have check my Session table On My database (MYSQL), and I got
it...

Help... 



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


_
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre.

This message has been checked for all known viruses by the MessageLabs
Virus Control Centre.


*

Notice:  This email is confidential and may contain copyright material
of Ocado Limited (the Company). Opinions and views expressed in this
message may not necessarily reflect the opinions and views of the
Company.
If you are not the intended recipient, please notify us immediately and
delete all copies of this message. Please note that it is your
responsibility to scan this message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*


_
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre.

This message has been checked for all known viruses by the MessageLabs
Virus Control Centre.


*

Notice:  This email

[PHP] Retrieving variables

2002-08-14 Thread Michael Hazelden

Hi all,

I'm attempting to store variables inside a database and then recall them.

What I want to do is store them dynamically though - so for instance - a
path to a file will be stored in the DB as
$_SERVER[DOCUMENT_ROOT]./path/to/file

But, obviously, when I retrieve this value, it retrieves it as a literal ...
not much help because I want to parse it as a proper value.

Is there any way to retrieve that value and then parse it within the PHP to
create the c:/webconsole/path/to/file string that can be stored within
another variable?

Anybody got any thoughts?

Cheers,

Michael.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.


*

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the Company). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*

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




RE: [PHP] Re: Retrieving variables

2002-08-14 Thread Michael Hazelden

Thanks to all,

What I've come up with in the end (since I want the flexibility of being
able to store the $_SERVER portion or not depending on the need of the
variable) is this:

I retrieve the variable from the database in the following way:

select concatenate('$',name,'=',value,';') as a from variables

I can then eval() that result with no problems.

Cheers,

Michael.

-Original Message-
From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]]
Sent: 14 August 2002 12:56
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Retrieving variables


You may add \$_SERVER[DOCUMENT_ROOT].\/path/to/file\ to the database 
and then use eval() to evaluate. The better solution is obviously to 
store /path/to/file and append it to $_SERVER[DOCUMENT_ROOT] whenever 
you need the full path.

Bogdan

Michael Hazelden wrote:
 Hi all,
 
 I'm attempting to store variables inside a database and then recall them.
 
 What I want to do is store them dynamically though - so for instance - a
 path to a file will be stored in the DB as
 $_SERVER[DOCUMENT_ROOT]./path/to/file
 
 But, obviously, when I retrieve this value, it retrieves it as a literal
...
 not much help because I want to parse it as a proper value.
 
 Is there any way to retrieve that value and then parse it within the PHP
to
 create the c:/webconsole/path/to/file string that can be stored within
 another variable?
 
 Anybody got any thoughts?
 
 Cheers,
 
 Michael.
 
 This message has been checked for all known viruses by the MessageLabs
Virus Control Centre.
 
   
 *
 
 Notice:  This email is confidential and may contain copyright material of
Ocado Limited (the Company). Opinions and views expressed in this message
may not necessarily reflect the opinions and views of the Company.
 If you are not the intended recipient, please notify us immediately and
delete all copies of this message. Please note that it is your
responsibility to scan this message for viruses.
 
 Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY
 
 *



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


_
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.


*

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the Company). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*

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