[PHP] count the elements of each dimension of the array

2003-12-12 Thread orlandopozo
I have this script:



I want to count the elements of each dimension, but the script give me an error, 
thanks in advanced for any help.


[PHP] Re: ereg is failing on this simple test

2003-12-12 Thread Mike
it works if you remove the last $ from the expression, also I think the 
. needs escaping

unless you have a special reason, use preeg_* as it is supposed to be 
quicker

Mike

Manuel Ochoa wrote:
Why is this test failing?
 
$data = "A Simple test.";
If (ereg("^[a-zA-Z0-9\s.\-_']+$", $data)) {
  echo "Valid text";
}
else {
  echo "Not valid text";
}
 
I'm running PHP 4.34 on a windows pc. This function is new to me, any help would be appreciated.

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


RE: [PHP] ereg is failing on this simple test

2003-12-12 Thread Dave G
> Why is this test failing?
> If (ereg("^[a-zA-Z0-9\s.\-_']+$", $data)) {

I'm very new to PHP, so I may be barking up the wrong tree, but what is
that "s" doing after the slash? I don't know if it's the cause of the
problem, but as far as I know it's superfluous.

-- 
Yoroshiku!
Dave G
[EMAIL PROTECTED]

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



[PHP] Re: Sync Outlook with MySQL via PHP

2003-12-12 Thread Mike
Cesar Cordovez wrote:
Hi List.

I need to know how to sync Outlook with MySQL via PHP.  I know this is 
an old topic, but I cant find a clue (is it friday?).  Please advise.

Thanks, Cesar
First you need to reverse engineer the outlook file format, then create 
a database which can store this information.  Then use php to read and 
decode the format, adding this to the database as it goes.

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


[PHP] ereg is failing on this simple test

2003-12-12 Thread Manuel Ochoa
Why is this test failing?
 
$data = "A Simple test.";
If (ereg("^[a-zA-Z0-9\s.\-_']+$", $data)) {
  echo "Valid text";
}
else {
  echo "Not valid text";
}
 
I'm running PHP 4.34 on a windows pc. This function is new to me, any help would be 
appreciated.


Re: [PHP] (0/T) executeing script below public

2003-12-12 Thread Jas
LMAO, I am in concordance.
Jas
Ryan A wrote:

One wonders how two retards got together to give birth to a bigger retard
like you.



Hi,

I am a bit puzzled here, I have to wipe my a$$ after
taking a $hit...but I have to wipe while i'm on the
toilet!
My usual way is to stand up and do it.

I noticed one funny thing about this way, its hard to
get all that crap in one swipe...what kind of $hit is
this?
According to the documentation, the a$$ should be
wiped in one of two motions like so
Place toilet paper at forward most side of anus and
wipe backward
(or)
Place toilet paper at backward most side of anus and
wipe forward
How do I do that?

Thanks,
-Riene
fyi- my toilet is a flush-master 3001, if that
matters.
-Original Message-
From: Ryan A [mailto:[EMAIL PROTECTED]
Sent: Friday, December 12, 2003 4:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] (0/T) executeing script below public
Hi,

Am a bit puzzled here, we have to run a script to
start/stop a serverbut
we have to run the script below the public folder!
this is our structure /blah/theServer/public_html/
the script is located in /blah/theServer/
I noticed one funny thing about this script, it starts
with: #!/bin/sh
right on top but does not have a file extention...what
kind of a file is
this?
According to the documentation the script has to be
executed like so
 start
(or)
 stop
How do I do that?

Thanks,
-Ryan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
--
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] Palm OS Processor

2003-12-12 Thread Stephen Craton
If you ever do decide to start, be sure to cover Pocket PC as well. I think
you could even sell this for a great deal.


- Original Message - 
From: "Galen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Evan Nemerson" <[EMAIL PROTECTED]>
Sent: Friday, December 12, 2003 1:34 AM
Subject: Re: [PHP] Palm OS Processor


> If I'm not mistaken, I would need to do a bunch of re-writing of PHP to
> get it to compile for the Palm, and I'd probably need to write a front
> end of some type. I'm not that kind of programmer, but I could deal
> with compiling from source myself if it were that simple. Thoughts?
> Comments? Anybody want to help start "palm-php" on sourceforge? (I'm
> half joking about the last thing, but I am also half serious - anybody
> interested?)
>
> As far as the Sharp Zaurus, yes, I have looked into it. Linux in the
> pocket is pretty appealing. But the Palm is much more ubiquitous and
> available in more forms (many sizes of pdas, cell phones, even watches
> now), so php for the Palm would be more useful. Plus, they already have
> source and binaries of php, apache, etc for the Zaurus, but not for the
> Palm, at least that I can find.
>
> Any other ideas?
>
> -Galen
>
> -- 
> 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] (0/T) executeing script below public

2003-12-12 Thread Ryan A
One wonders how two retards got together to give birth to a bigger retard
like you.



> Hi,
>
> I am a bit puzzled here, I have to wipe my a$$ after
> taking a $hit...but I have to wipe while i'm on the
> toilet!
>
> My usual way is to stand up and do it.
>
> I noticed one funny thing about this way, its hard to
> get all that crap in one swipe...what kind of $hit is
> this?
>
> According to the documentation, the a$$ should be
> wiped in one of two motions like so
> Place toilet paper at forward most side of anus and
> wipe backward
> (or)
> Place toilet paper at backward most side of anus and
> wipe forward
>
> How do I do that?
>
> Thanks,
> -Riene
>
> fyi- my toilet is a flush-master 3001, if that
> matters.
>
>
> -Original Message-
> From: Ryan A [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 12, 2003 4:08 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] (0/T) executeing script below public
>
>
> Hi,
>
> Am a bit puzzled here, we have to run a script to
> start/stop a serverbut
> we have to run the script below the public folder!
>
> this is our structure /blah/theServer/public_html/
> the script is located in /blah/theServer/
>
> I noticed one funny thing about this script, it starts
> with: #!/bin/sh
> right on top but does not have a file extention...what
> kind of a file is
> this?
>
> According to the documentation the script has to be
> executed like so
>  start
> (or)
>  stop
>
> How do I do that?
>
> Thanks,
> -Ryan
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> __
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing.
> http://photos.yahoo.com/
>
> -- 
> 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] (0/T) executeing script below public

2003-12-12 Thread Jeremiah Weaver
Hi,

I am a bit puzzled here, I have to wipe my a$$ after
taking a $hit...but I have to wipe while i'm on the
toilet!

My usual way is to stand up and do it.

I noticed one funny thing about this way, its hard to
get all that crap in one swipe...what kind of $hit is
this?

According to the documentation, the a$$ should be
wiped in one of two motions like so
Place toilet paper at forward most side of anus and
wipe backward
(or)
Place toilet paper at backward most side of anus and
wipe forward

How do I do that?

Thanks,
-Riene

fyi- my toilet is a flush-master 3001, if that
matters.


-Original Message-
From: Ryan A [mailto:[EMAIL PROTECTED]
Sent: Friday, December 12, 2003 4:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] (0/T) executeing script below public


Hi,

Am a bit puzzled here, we have to run a script to
start/stop a serverbut
we have to run the script below the public folder!

this is our structure /blah/theServer/public_html/
the script is located in /blah/theServer/

I noticed one funny thing about this script, it starts
with: #!/bin/sh
right on top but does not have a file extention...what
kind of a file is
this?

According to the documentation the script has to be
executed like so
 start
(or)
 stop

How do I do that?

Thanks,
-Ryan

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


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



RE: [PHP] What is a XSS attacks?

2003-12-12 Thread Sam Masiello

That is correct.

http://www.derkeiler.com/Mailing-Lists/securityfocus/bugtraq/2003-11/006
5.html

--Sam


Richard Davey wrote:
> Hello orlandopozo,
> 
> Saturday, December 13, 2003, 12:04:02 AM, you wrote:
> 
> oicv> What is a XSS attacks?
> 
> Cross Site Scripting Attack I think.
> Like when people insert malicious HTML/JS code into your site as a
> result of your code not checking inputs properly. 
> 
> --
> Best regards,
>  Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] What is a XSS attacks?

2003-12-12 Thread Richard Davey
Hello orlandopozo,

Saturday, December 13, 2003, 12:04:02 AM, you wrote:

oicv> What is a XSS attacks?

Cross Site Scripting Attack I think.
Like when people insert malicious HTML/JS code into your site as a
result of your code not checking inputs properly.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



[PHP] What is a XSS attacks?

2003-12-12 Thread orlandopozo
What is a XSS attacks?

thanks in advanced, bye.


RE: [PHP] passing arrays?

2003-12-12 Thread motorpsychkill
Thank you Mike for your recommendations as well.  I've certainly learned a
few tricks from this thread.  Thanks to all those concerned!

-m

> -Original Message-
> From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 12, 2003 2:41 AM
> To: 'motorpsychkill'; Php General List
> Subject: RE: [PHP] passing arrays?
>
>
> On 12 December 2003 06:07, motorpsychkill wrote:
>
> > Thanks Tom, that worked!  I knew that $$level had something
> > to do with it,
> > just wasn't sure what exactly.  Thanks again.
> >
> > -m
> >
> > -Original Message-
> > From: Tom Rogers [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, December 11, 2003 9:34 PM
> > To: motorpsychkill
> > Subject: Re: [PHP] passing arrays?
> >
> > Always use isset() to check if something exists before trying
> > to use it if
> > originates externally to the running script.
> >
> > you probabley need something like this
> >
> > $level_0 = array('NONE');
> > $level_1 = array("PN", "GALUP", "VP", "PUBUP", "STATS", "MCI",
> > "CONLIST","CP", "OAFS", "LO");
> > $level_2 = array("PN", "GALUP", "VP", "PUBUP", "MCI", "CONLIST",
> > "CP", "OAFS", "LO");
> >
> > if(isset($_SESSION['user']['level'])){
> > $level = 'level_'.$_SESSION['user']['level']; }else{
> > $level = 'level_0';  //catchall value
> > }
> > foreach($$level  as $value){
> > echo $value.'';
> > }
>
>
> Actually, I'd like to suggest that a variable variable is the
> wrong tool for
> this, and an array should be used instead -- something like:
>
>$level = array(1 => array("PN", "GALUP", "VP", "PUBUP",
>  "STATS", "MCI", "CONLIST","CP",
>  "OAFS", "LO"),
>   2 => array("PN", "GALUP", "VP", "PUBUP",
>  "MCI", "CONLIST", "CP", "OAFS",
>  "LO")
>  );
>
>if (isset($_SESSION['user']['level'])
>&& isset($level[$_SESSION['user']['level']])):
>   foreach ($level[$_SESSION['user']['level']] as $value):
>  echo $value.'';
>   endforeach;
>else:
>   // invalid level
>endif;
>
> Cheers!
>
> Mike
>
> -
> Mike Ford,  Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> Email: [EMAIL PROTECTED]
> Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211
>
> --
> 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] (0/T) executeing script below public (Conclusion)

2003-12-12 Thread Ryan A
Thanks guys,

Will ask the owner/host for a SSH login and privilages and get back to ya if
things go wrong.

This list and the people in it really rock.

Cheers,
-Ryan

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



Re: [PHP] session var not being passed?

2003-12-12 Thread Jason Wong
On Saturday 13 December 2003 05:48, Jas wrote:
> New set of eyes maybe or maybe I am indeed regressing...
>
> Page calling functions looks like such...

[snip]

>   session_unset($_SESSION['list']);

[snip]

You seem to be mistaken as to what session_unset() actually does. For a start 
it does not take any parameters. If you want to unset a single variable then 
use unset().

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Pickle's Law:
If Congress must do a painful thing,
the thing must be done in an odd-number year.
*/

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



RE: [PHP] Bad characters in a text field

2003-12-12 Thread Daniel Purdy

 
For example: I want to allow a-z ,A-Z, 0-9 and some others and strip out
everything else.


You probably just want to use a regular expression. Check out
http://www.php.net/ereg
HTH! 
 

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



Re: [PHP] (0/T) executeing script below public

2003-12-12 Thread Chris Shiflett
--- Ryan A <[EMAIL PROTECTED]> wrote:
> you keep mentioning "command line", what command line?
> You mean I should SSH in?

Yes, that's the command line he was talking about.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

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



[PHP] Bad characters in a text field

2003-12-12 Thread Manuel Ochoa
I have a form with a "text area" that when submited, get stored in a "text" type field 
of a MySQL database. Occasionaly some of our users copy data from a DOS program and 
paste it in the text area which results in unwanted characters getting stored in the 
text field. What function can I use to strip out all but valid characters?
 
For example: I want to allow a-z ,A-Z, 0-9 and some others and strip out everything 
else.
 
 


Re: [PHP] (0/T) executeing script below public

2003-12-12 Thread Ryan A
Hey,
Thanks for replying.

The server is on Linux and is remotely hosted, my local machine is on win2k
pro.

A client wants me to set this up, I have setup the whole thing but this
needs to be started

you keep mentioning "command line", what command line?
You mean I should SSH in?

(As you can see, am a newbie in shell scripts and ssh etc - kindly excuse)

Kindly reply.

Thanks,
-Ryan







[snip]
#!/bin/sh

 start
(or)
 stop
[/snip]

It is a shell script. They are usually placed in /usr/local/bin/ and
chmod'd to execute. To run it you type this at the command line;

scriptname start
(or)
scriptname stop

This script accepts one argument, either 'stop' or 'start'
[/snip]

I should have added that you can run them from other folders using the
'./scriptname arg' from the command line. Depends on OS

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



Re: [PHP] The best way ...

2003-12-12 Thread Chris Shiflett
--- "Philip J. Newman" <[EMAIL PROTECTED]> wrote:
> what is the best way to remove extra \'s from strings ... would be?

The best way is to not put them there in the first place. :-)

I guess the second best way would be stripslashes().

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

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



Re: [PHP] (0/T) executeing script below public

2003-12-12 Thread Chris Shiflett
--- Ryan A <[EMAIL PROTECTED]> wrote:
> Am a bit puzzled here, we have to run a script to start/stop a
> serverbut we have to run the script below the public folder!
> this is our structure /blah/theServer/public_html/
> the script is located in /blah/theServer/

For future reference, the script in question is in fact not "below"
(under) document root. In fact, it is quite the opposite; it is outside of
document root.

The only things that you have to have under document root are those things
that need to be referenced via a URL. That's it.

> I noticed one funny thing about this script, it starts with: #!/bin/sh
> right on top but does not have a file extention...what kind of a file
> is this?

A shell script.

> According to the documentation the script has to be executed like so
>  start
> (or)
>  stop
> 
> How do I do that?

If the script is named foo, type this from the directory where it is
located:

./foo start

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

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



RE: [PHP] (0/T) executeing script below public

2003-12-12 Thread Jay Blanchard
[snip]
#!/bin/sh

 start
(or)
 stop
[/snip]

It is a shell script. They are usually placed in /usr/local/bin/ and
chmod'd to execute. To run it you type this at the command line;

scriptname start
(or)
scriptname stop

This script accepts one argument, either 'stop' or 'start'
[/snip]

I should have added that you can run them from other folders using the
'./scriptname arg' from the command line. Depends on OS

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



RE: [PHP] The best way ...

2003-12-12 Thread Jay Blanchard
[snip]
what is the best way to remove extra \'s from strings ... would be ?
[/snip]

http://www.php.net/stripslashes but depends on how many extras

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



RE: [PHP] (0/T) executeing script below public

2003-12-12 Thread Jay Blanchard
[snip]
#!/bin/sh

 start
(or)
 stop
[/snip]

It is a shell script. They are usually placed in /usr/local/bin/ and
chmod'd to execute. To run it you type this at the command line;

scriptname start
(or)
scriptname stop

This script accepts one argument, either 'stop' or 'start'

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



[PHP] The best way ...

2003-12-12 Thread Philip J. Newman
what is the best way to remove extra \'s from strings ... would be ?

---
Philip J. Newman
Master Developer
PhilipNZ.com [NZ] Ltd.
[EMAIL PROTECTED]

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



[PHP] (0/T) executeing script below public

2003-12-12 Thread Ryan A
Hi,

Am a bit puzzled here, we have to run a script to start/stop a serverbut
we have to run the script below the public folder!

this is our structure /blah/theServer/public_html/
the script is located in /blah/theServer/

I noticed one funny thing about this script, it starts with: #!/bin/sh
right on top but does not have a file extention...what kind of a file is
this?

According to the documentation the script has to be executed like so
 start
(or)
 stop

How do I do that?

Thanks,
-Ryan

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



[PHP] session var not being passed?

2003-12-12 Thread Jas
New set of eyes maybe or maybe I am indeed regressing...

Page calling functions looks like such...

require 'sessions.php';
require 'inc.php';
if (($_SESSION['user'] == "") || ($_SESSION['pass'] == "") || 
($_SESSION['lvl'] == "")) {
	$_SESSION['msg_01'] = "You have not entered the correct authorization 
information.  Please enter your user name, password & department ID.";
	$_SESSION['msg'] = $dberrors[1];
	call_user_func("db_logs");
	//call_user_func("exit_app");
} elseif (($_SESSION['user'] != "") || ($_SESSION['pass'] != "") || 
($_SESSION['lvl'] != "")) {
	if ((strlen($_SESSION['user'] >= 255)) || (strlen($_SESSION['pass'] >= 
255)) || (strlen($_SESSION['lvl'] >= 255))) {
		$_SESSION['msg'] = $dberrors[3];
		call_user_func("db_logs");
		call_user_func("exit_app");
	} elseif ((strlen($_SESSION['user'] <= 255)) || 
(strlen($_SESSION['pass'] <= 255)) || (strlen($_SESSION['lvl'] <= 255))) {
			$_SESSION['msg'] = $dberrors[10];
			call_user_func("db_logs");
			call_user_func("menu");
	} else {
			$_SESSION['msg'] = $dberrors[11];
			call_user_func("db_logs");
			call_user_func("exit_app"); }
} else {
		$_SESSION['msg'] = $dberrors[8];
		call_user_func("db_logs");
		call_user_func("exit_app"); }
?>

Then in body of page I call 

Now the contents of inc.php is below (at least the "menu" and 
"dhcp_vlans" functions)

function menu() {
	$lvl = base64_decode($_SESSION['lvl']);
	if ($lvl == "view") {
		$_SESSION['menu'] = "custom menu 01";
		$_SESSION['lvl'] = base64_encode($lvl);	
	} elseif ($lvl == "user") {
		$_SESSION['menu'] = "custom menu 02";
		$_SESSION['lvl'] = base64_encode($lvl);
	} elseif ($lvl == "admin") {
		$_SESSION['menu'] = "custom menu 03";
		$_SESSION['lvl'] = base64_encode($lvl);
	} else {
		$_SESSION['menu'] = "custom menu 04"; }
		$_SESSION['lvl'] = base64_encode($lvl);  // recreate session variable 
for more checks
}



function vlans_dhcp() {
$lvl = base64_decode($_SESSION['lvl']);  // this session variable is 
dissapearing from the second nested if / elseif statement?
if ($lvl != "admin") {
	$_SESSION['lvl'] = base64_encode($lvl);
	$_SESSION['msg'] = $dberrors[12];
	call_user_func("db_logs");
} elseif ($lvl == "admin") {
	$_SESSION['lvl'] = base64_encode($lvl);
	if ($_POST == "") {
		$_SESSION['lvl'] = base64_encode($lvl);
		session_unset($_SESSION['list']);
		,create automatic form...";
		$_SESSION['lvl'] = base64_encode($lvl);
		//unset($table,$sql,$db_vlans,$vlans,$x);
	} elseif ($_POST != "") || (isset(var)) { //What happened to my session 
'lvl' var?
		...creat different form...
	} elseif ($_POST != "") {
		session_unset($_SESSION['list']);
		require 'dbase.php';
		$table = "subnets";
		$_SESSION['list'] = "...different form again...";
		//unset($table,$db_vlans,$vlans,$i,$x);
	} else {
		$_SESSION['lvl'] = base64_encode($lvl);
		header("Location: login.vlans.php"); }
} else {
	$_SESSION['lvl'] = base64_encode($lvl);
	$_SESSION['msg'] = $dberrors[12];
	call_user_func("db_logs"); }
}
?>

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


Re: [PHP] Fatal Error: PDFlib error ...

2003-12-12 Thread Matthias Nothhaft
Evan Nemerson wrote:
On Wednesday 10 December 2003 09:08 pm, Matthias Nothhaft wrote:

Hi,

I'm trying to get the pdflib work...

[]
Fatal error: PDFlib error: function 'PDF_begin_page' must not be called
in 'object' scope in /var/www/Software/cms4rent/pdftest.php on line 5
Why is that?


google (including quotes): "must not be called in 'object' scope"
result #2: http://www.alt-php-faq.org/local/87/
Rather cryptic error message... hmpf.

Thanks, but this didn't solve my problem, what else could be?
Any ideas?
Regards,
Matthias

Any help would be great.

Regards,
Matthias


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


RE: [PHP] Sync Outlook with MySQL via PHP

2003-12-12 Thread Vail, Warren


Outlook is a Personal Email Client/Calendar/Contact Application.
MySQL is a SQL Database Server Application.
PHP is usually a Web Based Scripting Language Processor.

What do you want to synchronize?  Email?  Calendar?  Contacts?  Something
else?

If you are running your PHP on a Windows machine you might read;

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

just to get started.

Warren Vail

-Original Message-
From: Cesar Cordovez [mailto:[EMAIL PROTECTED]
Sent: Friday, December 12, 2003 11:26 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Sync Outlook with MySQL via PHP


Hi List.

I need to know how to sync Outlook with MySQL via PHP.  I know this is 
an old topic, but I cant find a clue (is it friday?).  Please advise.

Thanks, Cesar

-- 
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] not parsing php files, giving us a save dialog.....

2003-12-12 Thread Chris Shiflett
--- Ryan A <[EMAIL PROTECTED]> wrote:
> we basically had to add some directives to one of the domains, which
> we added and then put it back in the virtual_hosts directory, we
> later took out the directives and restarted with the same results...

But you restarted now, and you didn't get the same results.

I'd look into the "we later took out the directives" part.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

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



Re: [PHP] not parsing php files..(SOLVED)

2003-12-12 Thread Ryan A
Hi,
Thanks to everyone who replied.

I still dont know what was wrong but heres what I did and PHP is working
again,
I went back in, stopped apache, called the domain from my browser...then
waited a minute, started,  and it worked.

Only thing is, i dont know what caused it.

(It even accepted the directives)

Cheers,
-Ryan

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



Re: [PHP] not parsing php files, giving us a save dialog.....

2003-12-12 Thread Ryan A
Hi,
Thanks for replying.

We are on a freebsd account, the way we are setup is:
../apache/httpd.conf
../apache/virtual_hosts/www.sitename.tld.conf

we basically had to add some directives to one of the domains, which we
added and then put it back in the virtual_hosts directory, we later took out
the directives and restarted with the same results...

We didnt touch the httpd.conf or the php.ini files.

I dont know if my php.ini is "intact" but we have not touched it and it was
working before.

I did find this: AddType application/x-httpd-php .php
 in my httpd.conf so that is not the problem, and this was working perfectly
till we restarted...

Any ideas?

Thanks,
-Ryan




> --- Ryan A <[EMAIL PROTECTED]> wrote:
> > the php files are not executing, instead its giving us a save dialog
> > box...
>
> Add this to your httpd.conf:
>
> AddType application/x-httpd-php .php
>
> Make sure that the right httpd.conf is being used by the Web server you
> are requesting from, and also make sure that the file extension indicated
> in httpd.conf corresponds to the extension of the file you are requesting.
>
> Hope that helps.
>
> Chris
>
> =
> Chris Shiflett - http://shiflett.org/
>
> PHP Security Handbook
>  Coming mid-2004
> HTTP Developer's Handbook
>  http://httphandbook.org/
>
> -- 
> 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] Sync Outlook with MySQL via PHP

2003-12-12 Thread Cesar Cordovez
Hi List.

I need to know how to sync Outlook with MySQL via PHP.  I know this is 
an old topic, but I cant find a clue (is it friday?).  Please advise.

Thanks, Cesar

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


Re: [PHP] not parsing php files, giving us a save dialog.....

2003-12-12 Thread Chris Shiflett
--- Ryan A <[EMAIL PROTECTED]> wrote:
> the php files are not executing, instead its giving us a save dialog
> box...

Add this to your httpd.conf:

AddType application/x-httpd-php .php

Make sure that the right httpd.conf is being used by the Web server you
are requesting from, and also make sure that the file extension indicated
in httpd.conf corresponds to the extension of the file you are requesting.

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

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



RE: [PHP] Re: passing arrays?

2003-12-12 Thread motorpsychkill
Thank you Al for the pointers.  This has been very helpful!

-m

> -Original Message-
> From: Al [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 11, 2003 10:28 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: passing arrays?
>
>
> > $level = '$level_' . $_SESSION['user']['level'];
> > //Where $_SESSION['user']['level'] can equal "1" or "2"
> >
> > $level_1 = array("PN", "GALUP", "VP", "PUBUP", "STATS", "MCI",
> "CONLIST",
> > "CP", "OAFS", "LO");
> > $level_2 = array("PN", "GALUP", "VP", "PUBUP", "MCI", "CONLIST", "CP",
> > "OAFS", "LO");
>
> I can see two problems with your code:
>
> 1) The syntax for assigning to $level is wrong.
> Rather than:
> $level = '$level_' . $_SESSION['user']['level'];
> your code should read:
> $level = ${'level_' . $_SESSION['user']['level']};
> For more information on this syntax, see:
> http://us2.php.net/manual/en/language.variables.variable.php
>
> 2) You are assigning $level_1 or $level_2 (depending on the value of
> $_SESSION['user']['level']) to $level *before* you have assigned
> $level_1 or
> $level_2 any values. There's no point making $level = $level_1 if $level_1
> hasn't been defined yet.
>
> Working code would be:
>
> $level_1 = array("PN", "GALUP", "VP", "PUBUP", "STATS", "MCI", "CONLIST",
> "CP", "OAFS", "LO");
> $level_2 = array("PN", "GALUP", "VP", "PUBUP", "MCI", "CONLIST", "CP",
> "OAFS", "LO");
> $level = ${'level_' . $_SESSION['user']['level']};
>
> Hope it helps,
>
> Al
>
> --
> 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] not parsing php files, giving us a save dialog.....

2003-12-12 Thread Jay Blanchard
[snip]
We were running php files prefectly well a little while back, then we
restarted apache and now the php files are not executing, instead its
giving us a save dialog box...

What to do and what do you think is wrong.
[/snip]

Why did you restart Apache? Is your php.ini intact?

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



RE: [PHP] error in mysql SQL syntax

2003-12-12 Thread Chris W. Parker
[EMAIL PROTECTED] 
on Friday, December 12, 2003 12:43 AM said:

First I'm going to +1 Jason's comment.

Then I'm going to give you a tip.

> Could somebody tell me way I am getting an error in this SQL syntax.

> $query = "insert into majordomoaliases
> (domain,address)values(\"$domname\",\"$virtdomain-majordomo:
\"|$wrapper
> majordomo -C $domaincf\")";

I think one of your problems is very bad code formatting. Try cleaning
it up as well as replacing all the \" with ' and see what happens.



hth,
Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



[PHP] not parsing php files, giving us a save dialog.....

2003-12-12 Thread Ryan A
Hi,
We were running php files prefectly well a little while back, then we
restarted apache and now the php files are not executing, instead its giving
us a save dialog box...

What to do and what do you think is wrong.

Please help.

Thanks,
-Ryan


http://Bestwebhosters.com

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



[PHP] Re: Checking a URL string.

2003-12-12 Thread Mike
try the PEAR Validate class

you can do Validate::url($websiteUrl);

by the way, preg is quicker than ereg

Mike

Philip J. Newman wrote:
I would like to check if i have a correct url enterend


---
Philip J. Newman
Master Developer
PhilipNZ.com [NZ] Ltd.
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Checking a URL string.

2003-12-12 Thread Philip J. Newman
I would like to check if i have a correct url enterend



---
Philip J. Newman
Master Developer
PhilipNZ.com [NZ] Ltd.
[EMAIL PROTECTED]

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



Re: [PHP] enable_trans_sid problem

2003-12-12 Thread Ewald Geschwinde
ok I will have a look at it
thanks for your help
Chris Shiflett wrote:

--- Ewald Geschwinde <[EMAIL PROTECTED]> wrote:
 

And this /> at the end is destroying my layout.
   

I seriously doubt that. As I said, it's valid markup, and I'm not aware of
any major browser that mishandles it. Even IE gets it right.
As a test, have you tried replacing it with whatever you think is better?
I bet it won't change the layout at all. You're probably looking in the
wrong place...
Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
 

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


Re: [PHP] enable_trans_sid problem

2003-12-12 Thread Chris Shiflett
--- Ewald Geschwinde <[EMAIL PROTECTED]> wrote:
> And this /> at the end is destroying my layout.

I seriously doubt that. As I said, it's valid markup, and I'm not aware of
any major browser that mishandles it. Even IE gets it right.

As a test, have you tried replacing it with whatever you think is better?
I bet it won't change the layout at all. You're probably looking in the
wrong place...

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

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



Re: [PHP] enable_trans_sid problem

2003-12-12 Thread Eugene Lee
On Fri, Dec 12, 2003 at 09:49:29AM -0500, Ewald Geschwinde wrote:
: 
: I have the following problem
: 
: I have htmlcode like this:
: 
: 
: 
: and with this feature
: it's printed out like this:
: 
: 
: 
: 
: The problem is the /> at the end.
: 
: Has anyone seen this before?
: What can I do against it?

It's an XHTML thing.  Does it cause problems for you?  Like what?

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



Re: [PHP] enable_trans_sid problem

2003-12-12 Thread Ewald Geschwinde
I did not know that this is valid xhtml output
I'm using


And this /> at the end is destroying my layout.
Maybe my layout is wrong 
Do you think it is better to make it an xhtml layout???

Regrads Ewald Geschwinde



Chris Shiflett wrote:

--- Ewald Geschwinde <[EMAIL PROTECTED]> wrote:
 


   

[snip]

 

The problem is the /> at the end.
   

Why is this a problem?

 

Has anyone seen this before?
   

Yes.

 

What can I do against it?
   

Please explain what you mean. This is valid markup, so you need to let us
know why this is causing problems for you, so that we can suggest a
solution.
Chris

=
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
 

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


Re: [PHP] Session Link Problems

2003-12-12 Thread Peter Walter
Steve,

As Mike said, I have a similar problem. I am using PHP 4.1.2. What 
release are you using?

Peter

Mike Ford wrote:

On 12 December 2003 00:03, Steve Turner wrote:


Hi,
   I am having a problem with sessions. On my testing
machine my script
works perfectly. However on the remote server it tries to
pass the session
id in the url even though I am accepting cookies. It is
messing up all my
links since it puts
PHPSESSID=6a4626fc1cde0fb228fcb3ebe5587ffd in front of
my hrefs without an & after. If I click the link then it registers the
session as a cookie and everything works fine from there on out. Don't
understand what is happening as everyting used to work fine,
and I don't
think I changed anyting. Don't know how well I described
this.


Have you upgraded PHP recently?  As far as I recollect, this behaviour was
changed somewhere in the 4.1.x-4.2.x range of releases.  For a full
description of the exact behaviour, see my recent post in response to Peter
Walter (sent on 11-Dec at 17:36 GMT).
If you want your session handling to rely solely on cookies, then set the
session.use_only_cookies option in php.ini -- but be aware that anyone using
a browser with cookies turned off will not be able to use your site.
Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP header command crashes IE6x/PC

2003-12-12 Thread Cesar Cordovez
Somebody, IIRC, told the list that the argument for header("Location... 
has to be a complete url, not just a directory, ie:

header("Location: http://www.alenet.com/";);
exit();
HTH

Cesar

Matt MacLeod wrote:
John,

Have tried this but unfortunately had no effect.

Everything appears to fine if the session variable does not exist ie: 
the user is redirected to the log in page.

It's just when the user has logged in and the session is set that IE 
throws it's toys out of the pram.

Cheers,
Matt
On Friday, December 12, 2003, at 03:15 PM, CPT John W. Holmes wrote:

From: "Matt MacLeod" <[EMAIL PROTECTED]>

if (!ISSET($_SESSION['loggedin'])) {
header("Location: /admin/login/");


put exit(); after your header redirect and use a full URL for your 
location.

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


[PHP] No secure stream: PHP 4.3.4 as apache 2.0.48 module with OpenSSL

2003-12-12 Thread Roman 'Ra' Melihhov
Trying to build PHP 4.3.4 as apache 2.0.48 module with OpenSSL 0.9.6b support
but while build doesn´t make any complaints I can´t see secure layer stream
on the phpinfo() http://www.blakout.net/temp/ page and neither does any
file(https://someurl) works. Here are the compilation options:

./configure --with-apxs2=/etc/httpd/bin/apxs --with-mysql --with-openssl=/us
r --enable-ftp --enable-magic-quotes --with-zlib --enable-bcmath --enable-ca
lendar --with-bz2 --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/li
bexec --libdir=/usr/lib --with-gd  --enable-gd-native-ttf --with-imap --with
-kerberos

What could possibly be wrong? Ideas appreciated.
=
System Linux blakout.net 2.4.20-20.7 #1 Mon Aug 18 14:56:30 EDT 2003 i686
Build Date Nov 19 2003 08:41:29
Configure Command './configure' '--with-apxs2=/etc/httpd/bin/apxs'
Server API Apache 2.0 Handler
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/lib/php.ini
PHP API 20020918
PHP Extension 20020429
Zend Extension 20021010
Debug Build no
Thread Safety disabled
Registered PHP Streams php, http, ftp, compress.bzip2, compress.zlib
=


Re: [PHP] enable_trans_sid problem

2003-12-12 Thread Chris Shiflett
--- Ewald Geschwinde <[EMAIL PROTECTED]> wrote:
>  value="aa55e1a335a4d32af8b38953f077e18b" />

[snip]

> The problem is the /> at the end.

Why is this a problem?

> Has anyone seen this before?

Yes.

> What can I do against it?

Please explain what you mean. This is valid markup, so you need to let us
know why this is causing problems for you, so that we can suggest a
solution.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

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



Re: [PHP] enable_trans_sid problem

2003-12-12 Thread Stuart
Ewald Geschwinde wrote:


The problem is the /> at the end.

Has anyone seen this before?
What can I do against it?
Why do you want to get rid of it? It's there to make it valid XHTML. It 
shouldn't cause any problems.

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


[PHP] enable_trans_sid problem

2003-12-12 Thread Ewald Geschwinde
I have the following problem

I have htmlcode like this:



and with this feature
it's printed out like this:




The problem is the /> at the end.

Has anyone seen this before?
What can I do against it?
I'm running apache 1.3.26 and php4.3.3

Regards EWald Geschiwnde

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


Re: [PHP] Re: rss/rdf feed classes

2003-12-12 Thread Manuel Lemos
Hello,

On 12/11/2003 10:17 PM, [EMAIL PROTECTED] wrote:
May i ask what the difference is between rss and xml ? Also will these
RSS is just a format based on XML. RSS is usually meant to produce site 
news feeds.


classes generate it from the database ?
I am not sure. I have not checked them all. Anyway, if you use a generic 
RSS or XML generator class, you can make it use any query results in a 
few lines.



Hello,

On 12/11/2003 04:41 PM, Rolf Brusletto wrote:

I'm looking for a class that returns a rss/rdf feed with each of the
items as an array, or suggestions on how to items into an array...
I am not sure if you want to generate or parse a RSS feed. Either way
you may want to look at it here where there are solutions for both
tasks:
http://www.phpclasses.org/search.html?words=rss&go_search=1


--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] How to use anchor with php post string to jump to a page???

2003-12-12 Thread Chris
PHP never sees the #RowNum3 part. That is used exclusively by the browser as
it is not parsing instructions, just tells you what part of the parsed page
to look at.

Chris

> > > http://www.yourserver.com/yourpage.htm?color=red#RowNum3
> > > target="doc">Jump

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



Re: [PHP] PHP header command crashes IE6x/PC

2003-12-12 Thread Matt MacLeod
John,

Have tried this but unfortunately had no effect.

Everything appears to fine if the session variable does not exist ie: 
the user is redirected to the log in page.

It's just when the user has logged in and the session is set that IE 
throws it's toys out of the pram.

Cheers,
Matt
On Friday, December 12, 2003, at 03:15 PM, CPT John W. Holmes wrote:

From: "Matt MacLeod" <[EMAIL PROTECTED]>

if (!ISSET($_SESSION['loggedin'])) {
header("Location: /admin/login/");
put exit(); after your header redirect and use a full URL for your 
location.

---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] How to use anchor with php post string to jump to a pag e???

2003-12-12 Thread Ford, Mike [LSS]
On 12 December 2003 14:51, Scott Fletcher wrote:

> It does work now.  Going the other way around does the trick. 
> Surprisely, PHP doesn't treat it as if two seperate thing are combined
> into one post
> data, like color for example that would be displayed as 'redRowNum3'.

That's because PHP never sees the #RowNum3 bit.  The *browser* strips off anything 
after (and including) a #, then makes a request for the page with the shortened URL -- 
in this case, http://www.yourserver.com/yourpage.htm?color=red.  When the page 
resulting from that request is returned to the browser, it's the browser that locates 
the anchor RowNum3 in the page, and automatically scrolls the page so that that anchor 
is in view.

Short explanation: anchors are handled client-side.

> 
> Thanks,
>  Scott
> 
> "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Whoop!  I think I found the problem, let me fix it and see if that
> > work.. 
> > 
> > 
> > "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > That would have been nice but it doesn't seem to work. Alright, I
> > > guess I'll redo the script to make it work differently...
> > > 
> > > Thanks,
> > >  Scott
> > > "Stuart" <[EMAIL PROTECTED]> wrote in message
> > > news:[EMAIL PROTECTED]
> > > > Scott Fletcher wrote:
> > > > > Sample script I have here is this...
> > > > > 
> > > > > --snip--
> > > > > http://www.yourserver.com/yourpage.htm#RowNum3";
> > > > > target="doc">Jump 
> > > > > 
> > > > >  > > > > src="http://www.yourserver.com/yourpage.htm";>
> > > > > --snip-- 
> > > > > 
> > > > > Where yourpage.htm have this "blah
> > > > > blah" 
> > > > > 
> > > > > So, question here is how do I pass the post string to
> the Iframe,
> like
> > > > > "&color=red" in this example, this example doesn't
> work...  The
> iframe
> > > is
> > > > > the target method
> > > > > 
> > > > > --snip--
> > > > >  href=http://www.yourserver.com/yourpage.htm#RowNum3&color=red
> > > > > target="doc">Jump
> > > > > --snip--
> > > > 
> > > > The anchor goes after the query string, like so...
> > > > 
> > > >  > > > href=http://www.yourserver.com/yourpage.htm?color=red#RowNum3
> > > > target="doc">Jump  
> > > > 
> > > > --
> > > > Stuart

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



Re: [PHP] PHP header command crashes IE6x/PC

2003-12-12 Thread CPT John W. Holmes
From: "Matt MacLeod" <[EMAIL PROTECTED]>

> if (!ISSET($_SESSION['loggedin'])) {
> header("Location: /admin/login/");

put exit(); after your header redirect and use a full URL for your location.

---John Holmes...

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



[PHP] PHP header command crashes IE6x/PC

2003-12-12 Thread Matt MacLeod
Hi,

I have written a login system in PHP which appears to work OK except on 
a particular windows network. Basically the user can log in, but after 
viewing a few pages IE crashes.

I can view the same site on my PowerBook using Safari with no problems.

The offending code is as follows:


if (!ISSET($_SESSION['loggedin'])) {
header("Location: /admin/login/");
}
else
{
//rest of the page.
}
?>
Any ideas why this would cause IE to crash

Cheers,

Matt

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


Re: [PHP] How to use anchor with php post string to jump to a page???

2003-12-12 Thread Scott Fletcher
It does work now.  Going the other way around does the trick.  Surprisely,
PHP doesn't treat it as if two seperate thing are combined into one post
data, like color for example that would be displayed as 'redRowNum3'.

Thanks,
 Scott

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Whoop!  I think I found the problem, let me fix it and see if that work..
>
>
> "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > That would have been nice but it doesn't seem to work.  Alright, I guess
> > I'll redo the script to make it work differently...
> >
> > Thanks,
> >  Scott
> > "Stuart" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > Scott Fletcher wrote:
> > > > Sample script I have here is this...
> > > >
> > > > --snip--
> > > > http://www.yourserver.com/yourpage.htm#RowNum3";
> > > > target="doc">Jump
> > > >
> > > >  > > > src="http://www.yourserver.com/yourpage.htm";>
> > > > --snip--
> > > >
> > > > Where yourpage.htm have this "blah
> > blah"
> > > >
> > > > So, question here is how do I pass the post string to the Iframe,
like
> > > > "&color=red" in this example, this example doesn't work...  The
iframe
> > is
> > > > the target method
> > > >
> > > > --snip--
> > > > http://www.yourserver.com/yourpage.htm#RowNum3&color=red
> > > > target="doc">Jump
> > > > --snip--
> > >
> > > The anchor goes after the query string, like so...
> > >
> > > http://www.yourserver.com/yourpage.htm?color=red#RowNum3
> > > target="doc">Jump
> > >
> > > -- 
> > > Stuart

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



Re: [PHP] How to use anchor with php post string to jump to a page???

2003-12-12 Thread Scott Fletcher
Whoop!  I think I found the problem, let me fix it and see if that work..


"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> That would have been nice but it doesn't seem to work.  Alright, I guess
> I'll redo the script to make it work differently...
>
> Thanks,
>  Scott
> "Stuart" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Scott Fletcher wrote:
> > > Sample script I have here is this...
> > >
> > > --snip--
> > > http://www.yourserver.com/yourpage.htm#RowNum3";
> > > target="doc">Jump
> > >
> > >  > > src="http://www.yourserver.com/yourpage.htm";>
> > > --snip--
> > >
> > > Where yourpage.htm have this "blah
> blah"
> > >
> > > So, question here is how do I pass the post string to the Iframe, like
> > > "&color=red" in this example, this example doesn't work...  The iframe
> is
> > > the target method
> > >
> > > --snip--
> > > http://www.yourserver.com/yourpage.htm#RowNum3&color=red
> > > target="doc">Jump
> > > --snip--
> >
> > The anchor goes after the query string, like so...
> >
> > http://www.yourserver.com/yourpage.htm?color=red#RowNum3
> > target="doc">Jump
> >
> > -- 
> > Stuart

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



Re: [PHP] How to use anchor with php post string to jump to a page???

2003-12-12 Thread Scott Fletcher
That would have been nice but it doesn't seem to work.  Alright, I guess
I'll redo the script to make it work differently...

Thanks,
 Scott
"Stuart" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Scott Fletcher wrote:
> > Sample script I have here is this...
> >
> > --snip--
> > http://www.yourserver.com/yourpage.htm#RowNum3";
> > target="doc">Jump
> >
> >  > src="http://www.yourserver.com/yourpage.htm";>
> > --snip--
> >
> > Where yourpage.htm have this "blah
blah"
> >
> > So, question here is how do I pass the post string to the Iframe, like
> > "&color=red" in this example, this example doesn't work...  The iframe
is
> > the target method
> >
> > --snip--
> > http://www.yourserver.com/yourpage.htm#RowNum3&color=red
> > target="doc">Jump
> > --snip--
>
> The anchor goes after the query string, like so...
>
> http://www.yourserver.com/yourpage.htm?color=red#RowNum3
> target="doc">Jump
>
> -- 
> Stuart

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



Re: [PHP] Re: can tomcat server run PHP??

2003-12-12 Thread Ray Hunter
On Fri, 2003-12-12 at 01:06, Pavel Jartsev wrote:
> Sheawh wrote:
> > Can i run PHP using Apache tomcat server??
> 
>  From Google:
> http://www.mail-archive.com/[EMAIL PROTECTED]/msg108708.html

One thing to point out here is that you can run php files from tomcat
itself as cgi...however, that would probably be least optimum way of
doing it.

Basically, here is what you do:
1. Install php and apache (whether php is DSO or compiled in).
2. Install tomcat.
3. Install jk2 connector so that apache and tomcat work together.
4. Set up your mounts for jsp files.

HTH,

Ray

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



RE: [PHP] Comments and Form Variables

2003-12-12 Thread Jay Blanchard
[snip]
Greetings! First time posting. Hope this is the right place.  Feel free
to 
email directly or CC.
[/snip]

Welcome! Always reply to all so that the list can see the answers unless
you asked specifically to reply off-list.

[snip]


Some FYI Howard. Please do not post large chunks of code like this for
explanation unless the code is not working. We are here to help, but you
are likely to get no responses if they are very time consuming. Please
spend some time with the PHP manual (you can type in things like
http://www.php.net/isset and be directed to the proper answer) and a
good PHP book (many here have their favorites...mine is Programming PHP
and PHP Cookbook from O'Reilley).

Also, go to Google (http://www.google.com) and type in "PHP tutorial".
You will be introduced to many finely produced articles. I also suggest
subscribing to PHP Architect http://www.phparchitect.com for
intermediate to advanced articles on PHP.

Happy holidays!

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



[PHP] Re: Call PHP from other languages

2003-12-12 Thread Mike
I think you are out of luck, depending on how complicated your function 
calls are (and their return values), you can either set up a basic 
commandline script which will read in variables and output the return 
value, the execute this using c/java

if it is more complicated than that, you will need to use RPC or SOAP to 
communicate.

Or... you could try to write a libPHP in C!

Mike

germán m. rivera wrote:
Hi all!

   We have developed a groupware web server written in PHP. We were 
interested in integrating some communication interfaces in Java, using 
Tomcat, in this application, but we have not found an efficient way to 
call PHP functions from a Java program. We would prefer not to use 
communication protocols like HTTP or RPC to do these calls. ¿Can anyone 
tell me if he/she has faced this problem, please? ¿Is it even possible?

   We can even use C/C++ instead of Java, but we still have the same 
problem. ¿Does anyone know if is there any way to call PHP functions 
from C, please?

Thanks in advance.
Germán
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Comments and Form Variables

2003-12-12 Thread howard gramer
Greetings! First time posting. Hope this is the right place.  Feel free to 
email directly or CC.

I am trying to get up to speed on using PHP.  One of the fastest ways I 
learn is by reading commented code snippets.

I am asking for 2 things.
1. Can someone please 'comment' the below code snippet.  And could they do 
it in great detail?  This code enters the Form data into database.

2. I want to add the Mail() to this code block.  What I do not know is how 
to turn the Form objects into Variables...

e.g.   "GetSQLValueString($HTTP_POST_VARS['FIRST_NAME'], "text"),"

...that I can then use in the Mail() itself.  I have an idea that the Form 
objects are somehow automatically Global Variables.

Here is code snippet:


function GetSQLValueString($theValue, $theType, $theDefinedValue = "", 
$theNotDefinedValue = "")
{
 $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

 switch ($theType) {
   case "text":
 $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
 break;
   case "long":
   case "int":
 $theValue = ($theValue != "") ? intval($theValue) : "NULL";
 break;
   case "double":
 $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : 
"NULL";
 break;
   case "date":
 $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
 break;
   case "defined":
 $theValue = ($theValue != "") ? $theDefinedValue : 
$theNotDefinedValue;
 break;
 }
 return $theValue;
}

$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
 $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}
if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] 
== "form1")) {
 $insertSQL = sprintf("INSERT INTO comments (FIRST_NAME, LAST_NAME, EMAIL, 
COMMENTS) VALUES (%s, %s, %s, %s)",
  GetSQLValueString($HTTP_POST_VARS['FIRST_NAME'], 
"text"),
  GetSQLValueString($HTTP_POST_VARS['LAST_NAME'], 
"text"),
  GetSQLValueString($HTTP_POST_VARS['EMAIL'], "text"),
  GetSQLValueString($HTTP_POST_VARS['COMMENTS'], 
"text"));

 mysql_select_db($database_connGlobal, $connGlobal);
 $Result1 = mysql_query($insertSQL, $connGlobal) or die(mysql_error());
*** I KNOW THAT THE MAIL() WILL GO HERE***

 $insertGoTo = "insertOK.php";
 if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
   $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
   $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
 }
 header(sprintf("Location: %s", $insertGoTo));
}
?>
howard grämer
 New York City
  [EMAIL PROTECTED]
_
Winterize your home with tips from MSN House & Home. 
http://special.msn.com/home/warmhome.armx

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


Re: [PHP] Undefined index???

2003-12-12 Thread Marek Kilimajer
[EMAIL PROTECTED] wrote:
On Friday 12 December 2003 15:43, [EMAIL PROTECTED] wrote: 


I keep getting this error: 

Notice: Undefined index: tutor_id in /usr/local/.. 

What does "undefined index" exactly mean?? I did a search on the web but 
couldn't find any solutions. 


Basically it means you're trying to access a non-existent item in the array. 


The line that cause this error is as follow: 

$tutor_id = $_POST["tutor_id"]; 


  print_r($_POST) 

will show all the items in $_POST. Is your form set to use the "post" method? 
If not then look in $_GET for your form input data. 

---
yah my form has been set to use the POST method:
Are you sure? You print out this form in this script, but that is not 
how you got here.

echo "";

What could be the problem???Or it could be related to "quoting" problem:

Not at all, remember the notice is displayed before you run this query. 
But always make sure user input is ALWAYS quoted and properly escaped in 
sql queries. The second form is vulnerable in this case.

$sql = mysql_query ("SELECT * FROM tutor WHERE tutor_id='$tutor_id'");
or
$sql = mysql_query ("SELECT * FROM tutor WHERE tutor_id=$tutor_id");


What is the right way to define the variable "$tutor_id" 

--
For reference, I have copied the block of code below:
$dsn = "mysql://root:[EMAIL PROTECTED]/tablename";

//connect to DB
$db = DB::connect ($dsn);
//check for any DB connection errors
   if (DB::isError ($db))
   die ($db->getMessage());
$action = $_GET["action"];

$tutor_id = $_POST['tutor_id'];

print_r($_POST);

if($action == "delete")
{
$sql = mysql_query ("DELETE FROM tutor WHERE tutor_id='$tutor_id'");
$result = $db->query($sql);

if( DB::isError($result) ) {
die ($result->getMessage());
}
echo "Back to main";
}
if($action == "edit")
{
$sql = mysql_query ("SELECT * FROM tutor WHERE tutor_id='$tutor_id'");
$row = mysql_fetch_array($sql);

echo "";
echo "Tutor ID : ".$row['tutor_id']."";
echo "";
echo "Name : ";
echo "Contact No : ";
echo "E-mail : ";
echo "Profile : ";
echo "";
echo "";
}
?>
echo "The entry has been deleted ";

For reference, i have copied the block of code below:

Irin.
 

Jason has explained it to you: you are accessing a variable or an array 
index that has not been defined. Rethink your logic.

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


[PHP] Call PHP from other languages

2003-12-12 Thread "Germán M. Rivera"
Hi all!

   We have developed a groupware web server written in PHP. We were 
interested in integrating some communication interfaces in Java, using 
Tomcat, in this application, but we have not found an efficient way to 
call PHP functions from a Java program. We would prefer not to use 
communication protocols like HTTP or RPC to do these calls. ¿Can anyone 
tell me if he/she has faced this problem, please? ¿Is it even possible?

   We can even use C/C++ instead of Java, but we still have the same 
problem. ¿Does anyone know if is there any way to call PHP functions 
from C, please?

Thanks in advance.
Germán
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] passing arrays?

2003-12-12 Thread Ford, Mike [LSS]
On 12 December 2003 06:07, motorpsychkill wrote:

> Thanks Tom, that worked!  I knew that $$level had something
> to do with it,
> just wasn't sure what exactly.  Thanks again.
> 
> -m
> 
> -Original Message-
> From: Tom Rogers [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 11, 2003 9:34 PM
> To: motorpsychkill
> Subject: Re: [PHP] passing arrays?
> 
> Always use isset() to check if something exists before trying
> to use it if
> originates externally to the running script.
> 
> you probabley need something like this
> 
> $level_0 = array('NONE');
> $level_1 = array("PN", "GALUP", "VP", "PUBUP", "STATS", "MCI",
> "CONLIST","CP", "OAFS", "LO");
> $level_2 = array("PN", "GALUP", "VP", "PUBUP", "MCI", "CONLIST",
> "CP", "OAFS", "LO"); 
> 
> if(isset($_SESSION['user']['level'])){
> $level = 'level_'.$_SESSION['user']['level']; }else{
> $level = 'level_0';  //catchall value
> }
> foreach($$level  as $value){
> echo $value.'';
> }


Actually, I'd like to suggest that a variable variable is the wrong tool for
this, and an array should be used instead -- something like:

   $level = array(1 => array("PN", "GALUP", "VP", "PUBUP",
 "STATS", "MCI", "CONLIST","CP",
 "OAFS", "LO"),
  2 => array("PN", "GALUP", "VP", "PUBUP",
 "MCI", "CONLIST", "CP", "OAFS",
 "LO")
 );

   if (isset($_SESSION['user']['level'])
   && isset($level[$_SESSION['user']['level']])):
  foreach ($level[$_SESSION['user']['level']] as $value):
 echo $value.'';
  endforeach;
   else:
  // invalid level
   endif;

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



RE: [PHP] Session Link Problems

2003-12-12 Thread Ford, Mike [LSS]
On 12 December 2003 00:03, Steve Turner wrote:

> Hi,
> I am having a problem with sessions. On my testing
> machine my script
> works perfectly. However on the remote server it tries to
> pass the session
> id in the url even though I am accepting cookies. It is
> messing up all my
> links since it puts
> PHPSESSID=6a4626fc1cde0fb228fcb3ebe5587ffd in front of
> my hrefs without an & after. If I click the link then it registers the
> session as a cookie and everything works fine from there on out. Don't
> understand what is happening as everyting used to work fine,
> and I don't
> think I changed anyting. Don't know how well I described
> this.

Have you upgraded PHP recently?  As far as I recollect, this behaviour was
changed somewhere in the 4.1.x-4.2.x range of releases.  For a full
description of the exact behaviour, see my recent post in response to Peter
Walter (sent on 11-Dec at 17:36 GMT).

If you want your session handling to rely solely on cookies, then set the
session.use_only_cookies option in php.ini -- but be aware that anyone using
a browser with cookies turned off will not be able to use your site.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



RE: [PHP] url rewriting within sessions - confused newbie needs h elp

2003-12-12 Thread Ford, Mike [LSS]
On 11 December 2003 19:58, Peter Walter wrote:

> I hope you mean session_start().
> 
> Yes,  I did. Getting a bit dyslexic nowadays.
> 
> 
> Well, you would, because PHP would use the value from the PHPSESSID=
> URL parameter. 
> 
> ... except that on the second call, the url (as displayed by
> the browser) does not contain the PHPSESSID parameter, yet I
> am still able to retrieve the session variables correctly ...

Well, that seems right (and is different from your previous explanation).  Go back and 
read my original description of the process -- especially steps 5 and 6.  Once PHP 
knows that your browser is accepting cookies, it stops appending the PHPSESSID= URL 
parameters, and the cookie takes over the job.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



Re: [PHP] How to use anchor with php post string to jump to a page???

2003-12-12 Thread Stuart
Scott Fletcher wrote:
Sample script I have here is this...

--snip--
http://www.yourserver.com/yourpage.htm#RowNum3";
target="doc">Jump
http://www.yourserver.com/yourpage.htm";>
--snip--
Where yourpage.htm have this "blah blah"

So, question here is how do I pass the post string to the Iframe, like
"&color=red" in this example, this example doesn't work...  The iframe is
the target method
--snip--
http://www.yourserver.com/yourpage.htm#RowNum3&color=red
target="doc">Jump
--snip--
The anchor goes after the query string, like so...

http://www.yourserver.com/yourpage.htm?color=red#RowNum3 
target="doc">Jump

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


Re: [PHP] error in mysql SQL syntax

2003-12-12 Thread Jason Wong
You have started a new thread by taking an existing posting and replying to
it while you changed the subject.

That is bad, because it breaks threading. Whenever you reply to a message,
your mail client generates a "References:" header that tells all recipients
which posting(s) your posting refers to. A mail client uses this information
to build a threaded view ("tree view") of the postings.

With your posting style you successfully torpedoed this useful feature; your
posting shows up within an existing thread it has nothing to do with.

Always do a fresh post when you want to start a new thread. To achieve this,
click on "New message" instead of "Reply" within your mail client, and enter
the list address as the recipient. You can save the list address in your
address book for convenience.

On Friday 12 December 2003 16:43, [EMAIL PROTECTED] wrote:
> Could somebody tell me way I am getting an error in this SQL syntax.

[snip]

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



[PHP] error in mysql SQL syntax

2003-12-12 Thread rdkurth
Could somebody tell me way I am getting an error in this SQL syntax.


$query = "insert into majordomoaliases
(domain,address)values(\"$domname\",\"$virtdomain-majordomo:\"|$wrapper
majordomo -C $domaincf\")";


error=You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use near
'/usr/lib/majordomo/wrapper majordomo -C /var/lib/majordomo/dire
query=insert into majordomoaliases
(domain,address)values("www.domain.net","domain.net-majordomo:
"|/usr/lib/majordomo/wrapper majordomo -C
/var/lib/majordomo/domain.net/majordomo.cf")

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



Re: [PHP] Undefined index???

2003-12-12 Thread irinchiang


On Friday 12 December 2003 15:43, [EMAIL PROTECTED] wrote: 

> I keep getting this error: 
> 
> Notice: Undefined index: tutor_id in /usr/local/.. 
> 
> What does "undefined index" exactly mean?? I did a search on the web but 
> couldn't find any solutions. 

Basically it means you're trying to access a non-existent item in the array. 

> The line that cause this error is as follow: 
> 
> $tutor_id = $_POST["tutor_id"]; 

  print_r($_POST) 

will show all the items in $_POST. Is your form set to use the "post" method? 
If not then look in $_GET for your form input data. 

---
yah my form has been set to use the POST method:

echo "";

What could be the problem???Or it could be related to "quoting" problem:

$sql = mysql_query ("SELECT * FROM tutor WHERE tutor_id='$tutor_id'");
or
$sql = mysql_query ("SELECT * FROM tutor WHERE tutor_id=$tutor_id");



What is the right way to define the variable "$tutor_id" 

--
For reference, I have copied the block of code below:

$dsn = "mysql://root:[EMAIL PROTECTED]/tablename";

//connect to DB
$db = DB::connect ($dsn);
//check for any DB connection errors
   if (DB::isError ($db))
   die ($db->getMessage());

$action = $_GET["action"];

$tutor_id = $_POST['tutor_id'];

print_r($_POST);

if($action == "delete")
{
$sql = mysql_query ("DELETE FROM tutor WHERE tutor_id='$tutor_id'");

$result = $db->query($sql);

if( DB::isError($result) ) {
die ($result->getMessage());
}

echo "Back to main";
}

if($action == "edit")
{
$sql = mysql_query ("SELECT * FROM tutor WHERE tutor_id='$tutor_id'");

$row = mysql_fetch_array($sql);

echo "";
echo "Tutor ID : ".$row['tutor_id']."";
echo "";
echo "Name : ";
echo "Contact No : ";
echo "E-mail : ";
echo "Profile : ";
echo "";
echo "";

}
?>

echo "The entry has been deleted ";


For reference, i have copied the block of code below:


Irin.
 

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



[PHP] Re: can tomcat server run PHP??

2003-12-12 Thread Pavel Jartsev
Sheawh wrote:
Can i run PHP using Apache tomcat server??
From Google:
http://www.mail-archive.com/[EMAIL PROTECTED]/msg108708.html
--
Pavel a.k.a. Papi
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Undefined index???

2003-12-12 Thread Jason Wong
On Friday 12 December 2003 15:43, [EMAIL PROTECTED] wrote:

> I keep getting this error:
>
> Notice: Undefined index: tutor_id in /usr/local/..
>
> What does "undefined index" exactly mean?? I did a search on the web but
> couldn't find any solutions.

Basically it means you're trying to access a non-existent item in the array.

> The line that cause this error is as follow:
>
> $tutor_id = $_POST["tutor_id"];

  print_r($_POST)

will show all the items in $_POST. Is your form set to use the "post" method? 
If not then look in $_GET for your form input data.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
No snowflake in an avalanche ever feels responsible.
*/

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



[PHP] Undefined index???

2003-12-12 Thread irinchiang

Hi all, 

I keep getting this error:

Notice: Undefined index: tutor_id in /usr/local/..

What does "undefined index" exactly mean?? I did a search on the web but 
couldn't find any solutions. 

The line that cause this error is as follow:

$tutor_id = $_POST["tutor_id"];

.
.
.
.if($action == "edit")
{
$sql = mysql_query ("SELECT * FROM tutor WHERE tutor_id='$tutor_id'");

$row = mysql_fetch_array($sql);

etc.

Hope to get some help here soon...thanks in advance.

Irin.

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



Re: [PHP] php .htaccess autologin

2003-12-12 Thread Eric Bolikowski

"Justin Patrin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Jas wrote:
>
> > Combination of session vars and cookie vars...
> > example...
> > [login page]
> > sets cookie with auth=0 (variable)
> > sets session with auth=0 (variable)
> >
> > [logged in page(s)]
> > sets cookie with auth=1 (variable -client side)
> > sets session with auth=1 (variable -server side)
> > hash of users password as client side var
> >
> > then just write a function to look on the users machine for a cookie
> > from your site with auth=1, then if you see that present simply
> > authenticate the user.
> >
> > HTH
> > Jas
> >
> >
> > Evan Nemerson wrote:
> >
> >> On Thursday 11 December 2003 04:17 pm, ROBERT MCPEAK wrote:
> >>
> >>> I've dug around quite a bit and can't figure out how I might use PHP
to
> >>> handle an .htaccess login.  For example, if I wanted a script to log
> >>> in the
> >>> user, rather than the user logging in with the standard .htaccess
> >>> dialog.
> >>>
> >>> Any ideas?
> >>
> >>
> >>
> >> I could be wrong, but I think this would be rather client-dependent. I
> >> don't think HTTP remembers who you throughout a session- i think the
> >> headers get sent every time. My only idea from PHP would be to set the
> >> $_SERVER['PHP_AUTH_*'] stuff, but i sincerely doubt that would do
> >> anything. I just don't think there's a way  to ask the browser to set
> >> that info through http. Maybe ask @ javascript forum?
> >>
> >> If you find a solution, I'd love to hear it...
> >>
> >>
> >>> Since the .htaccess vars are stored in the browser, should I be
> >>> looking at
> >>> a PHP/JavaScritpt 1-2 punch?
> >>>
> >>> Thanks,
> >>>
> >>> Bob
> >>
> >>
> >>
>
> You could also use the PEAR::Auth package to do authentication (through
> a form or a .htaccess style popup).
>
> -- 
> paperCrane 

Hi Robert

I understood that you would like to do a login doing the HTTP AUTH method.
Here are some scripts:

Script 1: login:

To next file";

 }else{

  //if incorrect, resend headers
  header("WWW-Authenticate: Basic realm=\"Leksjon 11\"");
  header("HTTP/1.0 401 Unauthorized");
  exit;
 }

}

?>

Script 2: go_on.php :



I had not anymore time to write more comments, but i hope it was helpfull.

Eric

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