Re: [PHP] Works in html, not when echoed in PHP

2002-11-12 Thread Ernest E Vogelsinger
You didn't show how you construct the JavaScript string in PHP - I'm sure
the problem is with quoting in there.

Have a look at your output in the browser (do a "View Source" or whatever
your Browser calls it), and check the JS your PHP application constructed.
You'll spot the error...

At 05:28 13.11.2002, Aaron Merrick said:
[snip]
>Folks,
>
>Can't see an answer anywhere in the archives, so here goes.
>
>This works fine in plain html:
>
>onresize="window.location.reload(false)" topmargin="1" bottommargin="0"
>leftmargin="0" rightmargin="0">
>
>When I put it in PHP thus:
>
>echo "onresize=\"window.location.reload(false)\" topmargin=\"1\"
>bottommargin=\"0\" leftmargin=\"0\" rightmargin=\"0\">";
>
>When the page loads, I get an "Error: 'menuObj' is null or not an object"
>
>The onoff() function is what contains the menuObj, so I suspect the single
>quotes around the parameters mainmenu and on, but have tried everyway I can
>think of and can't get rid of the Error.
>
>The function is thus:
>
>function onoff (elemparent,elem,state) {
>if (loaded) {
>newstate = eval(elem+"_"+state);
>if (n4) {
>menuObj = eval (doc + elemparent + doc2 + elem);
> }
>else if (ie || n6) {
>menuObj = eval (doc + elem + doc2);
> }
>
>I would be grateful for any tips.
>
>Thanks,
>Aaron
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
[snip] 

-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] Multiple selections

2002-11-12 Thread Ernest E Vogelsinger
At 02:06 13.11.2002, Todd Cary said:
[snip] 
>Many thanks!!  One thing I do not understand in the "types" of variables
>is the use and referencing of a variable with the "[]".  What I usually do
>is define a variable as
>
>$myvar = array();
>
>And then I use the "[]" to refer to the elements.  However, if I
>understand you suggestion, which works like a champ, the use of the "[]"
>tells the interpreter to treat $myvar as an array.
---[snip] 

No. The '[]' doesn't have to do with a PHP variable, it only tells PHP to
treat an _incoming_ parameter as an array.

What happens when PHP parses form data is something like:

variable is named "name"[] ?
   yes - $_REFERENCE['name'] = array(v1, v2, v3);
   no  - $_REFERENCE['name'] ? v1;


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] Multiple selections

2002-11-12 Thread Ernest E Vogelsinger
At 01:59 13.11.2002, David Rice said:
[snip]
>On Tuesday, November 12, 2002, at 07:34 PM, Ernest E Vogelsinger wrote:
>>
>> Sure it is - just name the listbox control "myvar[]" (note the angle
>> brackets). PHP will recognize this being an array, and you'll end up 
>> with
>> $myvar = array('select1','select2');
>
>Is this the only way to do this?

As to my knowledge it is the only way.

>I just had to do some work with JavaScript and forms and the "myvar[]" 
>name clobbered JavaScript's access to form elements by name. I had to 
>do some ugly form.elements[x] looping to get at the "myvar[]" control.

I believe you can do this in JavaScript:

hf = form('myform');
he = hf.elements['myselect[]');

to get a handle to the form element.

>This kind on external language hostility is not that cool, especially 
>toward such a common language as JavaScript.

I've made quite a number of JavaScripts controlled PHP dialogs containing
the [], they all work like a charm. There's only one thing you cannot do AFAIK:
   myform.myvar[].value = 0;


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] ereg_replace();

2002-11-12 Thread Ernest E Vogelsinger
At 01:59 13.11.2002, Gustaf Sjoberg said:
[snip]
>hi,
>i tried to implement the code, but it does not work if the string:
>
>a) doesnt contain any ..
>b) doesnt contain any 
>c) doesnt contain any 
>d) contains multiple ..'s
>
>so i altered it a little and this is what i came up with:

Here's my original function, now tested and bugs removed, together with
some comments:

function remove_br_in_pre($string)
{
$re1 = '/(.*?)(.*?)<\/pre>(.*)/is';
$re2 = '/\n?/is';

// setting a variable to "null" defines it, so we don't get
// a warning for an undefined variable at the first concatenation.
// unset($result) doesn't define it, and is unnecessary
// as it is not "set" at this moment.
$result = null;

// this generates a loop that will remove multiple pre's
while ($string) {

// my original assignment ($arMatch = preg_match(...)) was wrong.
// preg_match returns 1 on match, and 0 on no match.
if (preg_match($re1, $string, $arMatch)) {
$result .= $arMatch[1];

// sorry, forgot to keep the  pairs...
// you need to add a line break instead of the 
// to keep your code formatted
$result .= ''.preg_replace($re2, "\n", $arMatch[2]).'';
$string = $arMatch[3];
}
else break;
}

// if there are no  pairs, $string will be unmodified and the
// loop will immediately break out at the first attempt. This appends
// either the whole $string, or the remaining $string, to the result.
$result .= $string;
return $result;
}

>now, i've tried it in a few different scenarios and it seems to be working, 
>although the function might be redundant and far from pretty - it gets the 
>job done. however, i have a question; what does the "is" in //is denote? ;-) 
>(doesnt it feel great to have code sniplets you have no idea what they do in 
>your scripts? ;-))

The regex modifiers:
   i - make that case independent, so , , and others are matched
   s - treat the input as a single line, don't stop at a newline

>also, do you see any direct "bugs slash features" in the current function? 

Not that I'd be aware of...

>thanks in anticipation,

You're most welcome :)

-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] Works in html, not when echoed in PHP

2002-11-12 Thread @ Edwin

"Chris Shiflett" <[EMAIL PROTECTED]> wrote:


...[snip]...

> Yes, this is the same code that "works fine in plain html". Why echo it in
PHP if it is static?

Good question ;)

But I'm sure there's a good a answer :) Besides, why would anybody want to
do that if there's no good reason?

- E


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




Re: [PHP] Trying to e-mail password

2002-11-12 Thread @ Edwin

"Ben C." <[EMAIL PROTECTED]> wrote:

> I was setting up a news site that is customized for the registered user.
I
> wanted that user to have the ability to be able to click a button and have
> the password e-mailed to him.  The password function that I used is
> password(password) through mysql.  Do you know how I can get the encrypted
> string to translate to the password to be emailed?

I didn't really read the whole thread and I'm not sure if somebody already
told you about decode(). I think that'll do the trick. If not, sorry I can't
be of much help. But Google can help you: (Try: mysql decode password as
your keyword.)


http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=mysql+decode+password

- E


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




[PHP] Unsetting Array Element

2002-11-12 Thread Monty
Does unsetting an array element make the array smaller? For example, if I
have two elements in an array...

$array = ("title" => "Title of Document",
  "content" => "Ten paragraphs of text in here..." );

...then issue this command...

unset ($array['content']);

...will this make $array smaller and more efficient if I then pass it on to
a function for processing?

Thanks!



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




[PHP] the "+" become space after a POST request

2002-11-12 Thread xyzt123456
If I type some "+" signs in a form and that I send it by POST, the
result is that the "+" become spaces.

I guess there's an option in the php.ini, but can't find out !

Thanks for your help!

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




Re: [PHP] Works in html, not when echoed in PHP

2002-11-12 Thread Chris Shiflett
@ Edwin wrote:


"Aaron Merrick" <[EMAIL PROTECTED]> wrote:


This works fine in plain html:



When I put it in PHP thus:

echo "";

When the page loads, I get an "Error: 'menuObj' is null or not an object"


I think php is parsing your js code. Have you tried echoing with single
quotes?

echo '';



Or better yet, try this:



Yes, this is the same code that "works fine in plain html". Why echo it in PHP if it is static?

Chris



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




RE: [PHP] Trying to e-mail password

2002-11-12 Thread Ben C.
I was setting up a news site that is customized for the registered user.  I
wanted that user to have the ability to be able to click a button and have
the password e-mailed to him.  The password function that I used is
password(password) through mysql.  Do you know how I can get the encrypted
string to translate to the password to be emailed?

-Original Message-
From: @ Edwin [mailto:copperwalls@;hotmail.com]
Sent: Tuesday, November 12, 2002 10:45 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Trying to e-mail password




"John W. Holmes" <[EMAIL PROTECTED]> wrote:

>

...[snip]...

> And where do you plan on storing this 'secret code' that your dynamic
> PHP script have to have access to in order to add users and send
> forgotten email messages??
>
> If you have something to protect, then you should have your own server
> or get it with someone you can trust. If the hacker can see your mysql
> data, they can see the source of your PHP scripts, and nothing is hidden
> anymore.

Unless you encode your PHP scripts ;) ...with Zend Encoder, perhaps?

I agree. You really need to have your own server, within your own premises,
(physically) accessible only by your own self if you're really thinking
about making your scripts/db/site "secure".

I am not against encoding/decoding passwords in the db. In fact, I'd even
say that it's a good idea to encode names, tel nos., e-mail addresses, etc.

But what beats me is this: This thread is about e-mailing passwords. If
you're thinking about security why would you send your user's password?
Beats me. (Unless of course you're using some kind of digital signature,
etc. and encoding you're e-mails as well...)

Just mho,

- E


--
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] Works in html, not when echoed in PHP

2002-11-12 Thread @ Edwin
Hello,

"Aaron Merrick" <[EMAIL PROTECTED]> wrote:

> Folks,
>
> Can't see an answer anywhere in the archives, so here goes.
>
> This works fine in plain html:
>
>  onresize="window.location.reload(false)" topmargin="1" bottommargin="0"
> leftmargin="0" rightmargin="0">
>
> When I put it in PHP thus:
>
> echo " onresize=\"window.location.reload(false)\" topmargin=\"1\"
> bottommargin=\"0\" leftmargin=\"0\" rightmargin=\"0\">";
>
> When the page loads, I get an "Error: 'menuObj' is null or not an object"
>
> The onoff() function is what contains the menuObj, so I suspect the single
> quotes around the parameters mainmenu and on, but have tried everyway I
can
> think of and can't get rid of the Error.
>
> The function is thus:
>

I think php is parsing your js code. Have you tried echoing with single
quotes?

echo '';

- E


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




Re: [PHP] PHP and UTF-8

2002-11-12 Thread Charles Wiltgen
Gerard Samuel wrote...

> Do you store this utf-8 stuff only in xml files?? Do you use a database?  I
> was under the impression that mysql doesn't support utf-8

Yeah, that would be a problem.  I didn't think MySQL would be an issue, and
I'll investigate...

-- Charles Wiltgen


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




Re: [PHP] Trying to e-mail password

2002-11-12 Thread @ Edwin


"John W. Holmes" <[EMAIL PROTECTED]> wrote:

>

...[snip]...

> And where do you plan on storing this 'secret code' that your dynamic
> PHP script have to have access to in order to add users and send
> forgotten email messages??
>
> If you have something to protect, then you should have your own server
> or get it with someone you can trust. If the hacker can see your mysql
> data, they can see the source of your PHP scripts, and nothing is hidden
> anymore.

Unless you encode your PHP scripts ;) ...with Zend Encoder, perhaps?

I agree. You really need to have your own server, within your own premises,
(physically) accessible only by your own self if you're really thinking
about making your scripts/db/site "secure".

I am not against encoding/decoding passwords in the db. In fact, I'd even
say that it's a good idea to encode names, tel nos., e-mail addresses, etc.

But what beats me is this: This thread is about e-mailing passwords. If
you're thinking about security why would you send your user's password?
Beats me. (Unless of course you're using some kind of digital signature,
etc. and encoding you're e-mails as well...)

Just mho,

- E


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




Re: [PHP] _POST & _GET

2002-11-12 Thread Chris Shiflett
Ernest E Vogelsinger wrote:


At 07:54 12.11.2002, Chris Shiflett said:
[snip]
 

Anyway, thanks for your insight. Some of these slightly off-topic issues 
are more interesting than the on-topic ones. :-) Maybe our community 
needs a historian to collect some of this information for those of us 
who are interested (or am I the only one?).
   

[snip] 

It's slightly more than historical - in fact the behavior of GET and POST
is quite clearly laid out in RFC2616
(http://ftp.rfc-editor.org/in-notes/rfc2616.txt) which represents the
"proposed standard" for HTTP/1.1.


You should probably read the original discussion. The thread was 
regarding naming conventions used to refer to variable types, and the 
reference to historical information was regarding Rasmus's choice of 
get/post for PHP as well as his reasoning.

Also, it should be noted that the HTTP/1.1 specification is a draft 
standard, not a proposed standard. See 
http://www.rfc-editor.org/rfcxx00.html for the latest status of 
standards like that.

To start with, data passed within the URI is called "query"



Not exactly. This is like saying the path in a URL should be called 
abs_path, since that's what the specification uses. Most everyone uses 
the term query string to refer to the section of a URL between the ? and 
the # (if any). You're the first person I've seen to call it query. :-)

In plain english, developers SHOULD use $_GET variables only to _compose_
information, not to take some action to _create_ information. We should
always be aware that an URI can always be saved in a link collection
("Favirites"), or used as a link target, as opposed to POSTed data.




Personally I try to use GET (with or without a session identifier) only in
application environments that are not security related.



I spoke about the functional differences between GET and POST in a 
previous email. You might find it helpful:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&selm=3D110C74.1090908%40php.net

Chris


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



Re: [PHP] form with two actions

2002-11-12 Thread rija
If you want php to do it in the remote server (your case),
of course, you do not have to use javascript //

Just do like this

if (isset($_POST['submit'])) // to verify that browser are sending something
correctly
{
// --> record posted data into database

and after
// --> send mail
}

But if you want 2 actions in the client-side browser, you should use
javascript, for example you want first to check data and simultaneously,
display progress bar (animated gif),

like this
onsubmit="return(send_data(document.form));"
and the on the function send_data() you have
1. do action 1
2. do action 2
3. return true

- Original Message -
From: "Scott" <[EMAIL PROTECTED]>
To: "php-general" <[EMAIL PROTECTED]>
Sent: Wednesday, November 13, 2002 4:05 PM
Subject: [PHP] form with two actions


> Hello
> I would like to know if it is possible to use Php to make a form perform 2
> actions by having the user click on a single submit button. For instance,
> send data to a database and email it simultaneously.  I would prefer not
to
> use javascript.  If someone could point me to an example I would
appreciate it
>
> Thanks,
> S.W.
>
> --
> 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] Would appreciate thoughts on session management

2002-11-12 Thread Michael Sims
On Tue, 12 Nov 2002 18:28:53 -0800, you wrote:

[snip]
>My Invisible GET method avoids all of this.

If you get an example of this up and running somewhere why don't you
post a link...

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




Re: [PHP] PHP and UTF-8

2002-11-12 Thread Gerard Samuel
Do you store this utf-8 stuff only in xml files??
Do you use a database?  I was under the impression that mysql doesn't 
support utf-8

[EMAIL PROTECTED] wrote:

I utf8_encode and utf8_decode all data that I put into XML files. The 
application is on a large site so it is thoroughly tested and has encoded and 
decoded data without problems. I have run the application on Linux Slackware 
and FreeBSD.

Quoting Charles Wiltgen <[EMAIL PROTECTED]>:

 

Hello,

I anyone out there using UTF-8 for files and databases?  I want to use it
for everything, and it'd be a major hassle if PHP's UTF-8 support was super-
dependent on underlying OS issues, so any feedback is appreciated.

-- Charles


Charles Wiltgen wrote...

   

How mature is PHP's support for UTF-8, real-world?  Is it ubiquitous
 

enough
   

to use for commercial applications that'll be running on systems that you
don't configure yourself?

From the notes in the documentation, it sounds like there are dependencies
on the underlying OS, and that I wouldn't be able to count on this
functionality.

I'd love to hear about the experience of list members who use this on many
different PHP platforms.
 

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


   




 


--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/




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




RE: [PHP] Trying to e-mail password

2002-11-12 Thread John W. Holmes
> Using ENCODE and DECODE with protected 'secret code' help you to
improve
> your security and user's security. And you don't lost anything doing
this,
> on the contrary, it is a good marketing arguments, like as your system
> (site) is more safe than other and user could fell in.

And where do you plan on storing this 'secret code' that your dynamic
PHP script have to have access to in order to add users and send
forgotten email messages??

If you have something to protect, then you should have your own server
or get it with someone you can trust. If the hacker can see your mysql
data, they can see the source of your PHP scripts, and nothing is hidden
anymore.

---John Holmes...



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




Re: [PHP] Trying to e-mail password

2002-11-12 Thread rija

>
> Okay, so why are you giving users read access to the mysql data folder?
> They can also open up your .php file and find your "secret code."

I think, it is good discussion, so I try to go deeper to it, because we need
improve security. And I hope another people to join this.

Since I don't have my own server, I have to buy external hosting service
maybe in Costa Rica or in Panama or in South Africa, so I don't know who are
going to administrate my site first? Whoelse can have access to the system.
I don't know how safe is it? I just bought it because it was cheap, or
simply it was in my way.

And suppose some hacker is entered to the server, because he would like hack
the server not my user's mailbox. Surprise, he found plenty of address email
with its password. Really cool

Using ENCODE and DECODE with protected 'secret code' help you to improve
your security and user's security. And you don't lost anything doing this,
on the contrary, it is a good marketing arguments, like as your system
(site) is more safe than other and user could fell in.




>
> It won't hurt anything to encode it in the database, but just don't get
> this overwhelming sense of security and think everything is safe.
>
>---John Holmes...
>



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




Re: [PHP] XML into PHP

2002-11-12 Thread Khalid El-Kary
hi,
try this parser
http://creaturesx.ma.cx/kxparse/
(not stable)

_
The new MSN 8: advanced junk mail protection and 2 months FREE* 
http://join.msn.com/?page=features/junkmail


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



Re: [PHP] Generating MS Excel files with PHP

2002-11-12 Thread Jason Sheets
Take a look at this class:

http://websapp.mirrors.phpclasses.org/browse.html/package/767.html
(Class for generating Excel Spreadsheets)

Jason

On Tue, 2002-11-12 at 13:06, [-^-!-%- wrote:
> 
> All,
> Does anyone know where I can find information on generating MS Excel
> files, with PHP?
> 
> I was able to generate the Excel file (so I thought), but Excel cannot
> open the file. Can someone point me to some references, tutorials and/or
> samples?
> 
> Please help.
> 
> -john
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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




RE: [PHP] Problem with header redirect with register_globals off

2002-11-12 Thread David Russell
Could you post some code?

David Russell
IT Support Manager
Barloworld Optimus (Pty) Ltd
Tel: +2711 444-7250 
Fax: +2711 444-7256
e-mail: [EMAIL PROTECTED]
web: www.BarloworldOptimus.com

-Original Message-
From: pig pig [mailto:pigpig8080@;yahoo.com.sg] 
Sent: 12 November 2002 03:52 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem with header redirect with register_globals off


Hi All,

I am having problem with redirecting using header
function with register_globals off.  It works fine on
my PC but not on the site as the register_globals is
off on the server.  When redirecting on the server it
gave an CGI error:

CGI Error
The specified CGI application misbehaved by not
returning a complete set of HTTP headers. The headers
it did return are:


I am using session to pass some variables to the
target page, could this cause the problem?
Is there a work around for this problem?

Thanks in advance.

CK Ong

__
Do You Yahoo!?
Great flight deals, travel info and prizes! http://sg.travel.yahoo.com

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




smime.p7s
Description: application/pkcs7-signature


Re: [PHP] XML into PHP

2002-11-12 Thread Khalid El-Kary
hi,
do you want to show the whole XML content (including tags and other things) 
or you want to extract data (tag text and attribute vaules) from it?

khalid





_
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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



[PHP] can a popup window get the page referer?

2002-11-12 Thread Joseph Szobody
Folks, I have a popup window that I would like to put a mild security constraint on. I 
don't want others to be able to directly type in the address of this page, modify url 
parameters, etc. I only want this page accessible if it was triggered from a link on 
my own website, then I know I can trust the URL parameters, etc. I had thought about 
parsing the HTTP_REFERER and extracting the host, and comparing it with my domain 
name. This would tell me if a valid link was clicked.

One problem... HTTP_REFERER appears to be empty when it's a new window. For some 
reason I thought the referer would still be detected.

Am I up a creek? Is there anyway for a popup window to get the page referer (in other 
words, the popup opener)?

Thanks, Joseph.


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




Re: [PHP] form with two actions

2002-11-12 Thread Cesar Aracena
Hi Scott,

what you want to do can be acomplished just by telling php what to do in
order... for example run the $query to insert the data into the DB and after
that, run a mail function that sends the mail. IF you want to be more
elegant in your scripting, do the mailing within an IF clause so the mail
will be sent ONLY and ONLY IF the data was succsesfully stored into the DB.

Cheers, Cesar

- Original Message -
From: "Scott" <[EMAIL PROTECTED]>
To: "php-general" <[EMAIL PROTECTED]>
Sent: Wednesday, November 13, 2002 2:05 AM
Subject: [PHP] form with two actions


> Hello
> I would like to know if it is possible to use Php to make a form perform 2
> actions by having the user click on a single submit button. For instance,
> send data to a database and email it simultaneously.  I would prefer not
to
> use javascript.  If someone could point me to an example I would
appreciate it
>
> Thanks,
> S.W.
>
> --
> 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] crypt/MD5 Problem

2002-11-12 Thread Todd Hight
Hello all,

I currently having some trouble getting PHP to compile with the correct 
crypt() support.  It seems that when compiled as a DSO under Apache 
crypt() will not do MD5 encryption.  However if I compile PHP standalone 
then all works correctly.  I have tried with and without mod_ssl.  I 
have tried building with Apachetoolbox and manualy.

I have searched this list and many others and see only people with 
issues with Apache 2.x.x with mod_ssl.  I dont think that applys here 
since I'm using Apache 1.3.27. The OS (RedHat 7.3) supports MD5 via 
crypt.  I have verified this with a sample C program and a Perl script, 
not to mention as I stated above PHP standalone works fine.

Im not sure what's happening to prevent the porper crypt support from 
getting in. Any suggestions would be appriciated.  System specs below.

TIA!!!

- Todd

--

Server: AMD 1.5G/256M Ram
OS:  RedHat 7.3
glibc:   2.2.5-34
apache:  1.3.27
php: 4.2.3
openssl: 0.9.6g
mod_ssl: 2.8.11-1.3.27
mm:  1.1.3
gd:  2.0.1


Excerpt from the config.log re: MD5
--
configure:58742: checking for MD5 crypt
configure:58777: gcc -o conftest -g -O2  -DLINUX=22 -DUSE_HSREGEX
   -Wl,-rpath,/usr/local/mysql//lib/mysql -L/usr/local/mysql//lib/mysql
   -Wl,-rpath,/usr/local/pgsql//lib -L/usr/local/pgsql//lib conftest.c
   -lpq -lmysqlclient -lcrypt -lresolv -lm -ldl -lnsl  -lresolv -lcrypt
   1>&5
configure: failed program was:
#line 58753 "configure"
#include "confdefs.h"

#if HAVE_CRYPT_H
#include 
#endif

main() {
#if HAVE_CRYPT
char salt[15], answer[40];

salt[0]='$'; salt[1]='1'; salt[2]='$';
salt[3]='r'; salt[4]='a'; salt[5]='s';
salt[6]='m'; salt[7]='u'; salt[8]='s';
salt[9]='l'; salt[10]='e'; salt[11]='$';
salt[12]='\0';
strcpy(answer,salt);
strcat(answer,"rISCgZzpwk3UhDidwXvin0");
exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer));
#else
exit(0);
#endif
}


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



[PHP] form with two actions

2002-11-12 Thread Scott
Hello
I would like to know if it is possible to use Php to make a form perform 2 
actions by having the user click on a single submit button. For instance, 
send data to a database and email it simultaneously.  I would prefer not to 
use javascript.  If someone could point me to an example I would appreciate it

Thanks,
S.W.

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




RE: [PHP] Trying to e-mail password

2002-11-12 Thread John W. Holmes
> I don't think so,
> data stored as plain text is almost stored intact in the file system.
> 
> Using stupid windows for example,
> you can easily open mysql file "table.MYD" in the folder database with
> NotePad, and you can read everything. Which means, everybody without
any
> hacking knowledge can access to user's password and mailbox stored in
your
> site, since he had access to the system folder. And if you have rented
> server it is recommanded to crypt strategic data.

Okay, so why are you giving users read access to the mysql data folder?
They can also open up your .php file and find your "secret code."

It won't hurt anything to encode it in the database, but just don't get
this overwhelming sense of security and think everything is safe.

---John Holmes...



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




[PHP] seeking good Bug Tracker in PHP

2002-11-12 Thread Peter J. Schoenster
Hi,

I'm seeking a good Bug Tracker in PHP. I've tried Mantis. I was at 
freshmeat and tried a bunch of those. Found nothing I liked. I did find 
one bug tracker that used Smarty but I did not like it.

I'm seeking a Bug Tracker where everything is in classes. Design is in 
a template class (strong preference for Smarty) and it uses as many 
Pear classes as possible. 

Anyone know of one?

Thanks,

Peter


http://www.coremodules.com/
Web Development and Support  at Affordable Prices
901-757-8322[EMAIL PROTECTED]




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




Re: [PHP] Multiple selections

2002-11-12 Thread Todd Cary
David -

Speaking of JavaScript, is there a way to block the Enter key?  If I 
have two buttons, the Enter key always pushes the one with focus.

What is the accepted way to handle this?  With one button it is nice to 
let the user press the Enter key and depress the one button - with two, 
it can be a problem.

Todd

David Rice wrote:

On Tuesday, November 12, 2002, at 07:34 PM, Ernest E Vogelsinger wrote:



Sure it is - just name the listbox control "myvar[]" (note the angle
brackets). PHP will recognize this being an array, and you'll end up 
with
$myvar = array('select1','select2');


Is this the only way to do this?

I just had to do some work with JavaScript and forms and the "myvar[]" 
name clobbered JavaScript's access to form elements by name. I had to 
do some ugly form.elements[x] looping to get at the "myvar[]" control.

This kind on external language hostility is not that cool, especially 
toward such a common language as JavaScript.

My apologies to PHP if the language provides a workaround :)

David




--
Ariste Software, Petaluma, CA 94952




Re: [PHP] Trying to e-mail password

2002-11-12 Thread rija
I don't think so,
data stored as plain text is almost stored intact in the file system.

Using stupid windows for example,
you can easily open mysql file "table.MYD" in the folder database with
NotePad, and you can read everything. Which means, everybody without any
hacking knowledge can access to user's password and mailbox stored in your
site, since he had access to the system folder. And if you have rented
server it is recommanded to crypt strategic data.



- Original Message -
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "'php'" <[EMAIL PROTECTED]>; "'Ben C.'"
<[EMAIL PROTECTED]>
Sent: Wednesday, November 13, 2002 2:05 PM
Subject: RE: [PHP] Trying to e-mail password


> If you want an email password feature, then just store it as plain text.
> If someone is able to get access to your database, that means they more
> than likely have access to the rest of your box, so your 'secret code'
> is worthless.
>
> ---John Holmes...
>
> > -Original Message-
> > From: rija [mailto:rija@;vatu.com]
> > Sent: Tuesday, November 12, 2002 9:37 PM
> > To: php; Ben C.
> > Subject: Re: [PHP] Trying to e-mail password
> >
> > ENCODE(value, 'secret code')
> > DECODE(field name, 'secret code')
> >
> > to record
> > " ... VALUES ( ... blahblah, ENCODE('$passord', 'secret code', ...
> BLAH
> > BHAL") ;
> >
> > and to read the value
> > do like this
> > MYSQL_QUERY("SELECT DECODE(password, 'secret code') as password, id,
> BLAH
> > BLAH
> >
> >
> > - Original Message -
> > From: "Ben C." <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, November 13, 2002 12:07 PM
> > Subject: Re: [PHP] Trying to e-mail password
> >
> >
> > > Is there not any way to reverse the crypted password before
> e-mailing??
> > >
> > > If not, how do I use ENCODE / DECODE?
> > >
> > >



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




RE: [PHP] $_SESSION

2002-11-12 Thread John W. Holmes
> I have some code that looks like this:
> 
> if(!session_is_registered('errors'))
>   session_register('errors');
> 
> but i want to do this using the $_SESSION, i tried
> doing it this way
> 
> if(!isset($_SESSION['errors']))
>   session_register('errors');
> 
> but when i echo(isset($_SESSION['errors'])) it prints
> false
> 
> So i am not sure how to register a variable with
> $_SESSION

You don't need to use session_register() when you're using $_SESSION.
Just treat $_SESSION as any other variable and assign values to it. To
remove values from it, use unset().

if(!isset($_SESSION['errors']))
{ $_SESSION['errors'] = 'default'; }

---John Holmes...



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




[PHP] $_SESSION

2002-11-12 Thread Donahue Ben
I have some code that looks like this:

if(!session_is_registered('errors'))
  session_register('errors');

but i want to do this using the $_SESSION, i tried
doing it this way

if(!isset($_SESSION['errors']))
  session_register('errors');

but when i echo(isset($_SESSION['errors'])) it prints
false

So i am not sure how to register a variable with
$_SESSION

Ben


__
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2

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




[PHP] Works in html, not when echoed in PHP

2002-11-12 Thread Aaron Merrick
Folks,

Can't see an answer anywhere in the archives, so here goes.

This works fine in plain html:



When I put it in PHP thus:

echo "";

When the page loads, I get an "Error: 'menuObj' is null or not an object"

The onoff() function is what contains the menuObj, so I suspect the single
quotes around the parameters mainmenu and on, but have tried everyway I can
think of and can't get rid of the Error.

The function is thus:

function onoff (elemparent,elem,state) {
if (loaded) {
newstate = eval(elem+"_"+state);
if (n4) {
menuObj = eval (doc + elemparent + doc2 + elem);
 }
else if (ie || n6) {
menuObj = eval (doc + elem + doc2);
 }

I would be grateful for any tips.

Thanks,
Aaron


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




[PHP] XML into PHP

2002-11-12 Thread Philip J. Newman
How would i call a page in PHP that is XML?

eg; if i had a file that was like below.

http://www.philipnz.com/news/rss.xml

and i wanted to include it onto a page.

HELP (looking through the docs now)

--- 
Philip J. Newman.
Head Developer.
PhilipNZ.com New Zealand Ltd.
http://www.philipnz.com/ 
[EMAIL PROTECTED]

Mob: +64 (25) 6144012. 
Tele: +64 (9) 5769491.

Family Site: 
Philip J. Newman
Internet Developer
http://newman.net.nz/
[EMAIL PROTECTED]

*
  Friends are like Stars,
  You can't always see them,
  But you know they are there.

*

ICQ#: 20482482
MSN ID: [EMAIL PROTECTED]
Yahoo: [EMAIL PROTECTED]
AIM: newmanpjkiwi



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




RE: [PHP] Why $ on variable names?

2002-11-12 Thread Jonathan Rosenberg \(Tabby's Place\)
In an earlier message, Ernest E Vogelsinger [mailto:ernest@;vogelsinger.at]
said ...

> Think of how an interpreter works. It parses the
> sourcecode in realtime, not as a compiler. People must
> _wait_, every time, until it is finished,
> not only once like a compiler. Thus designers of
> interpreted languages like something that can easily be
> distinguished, so you don't need to lookup a
> lot of hash tables to identify a symbol, or to
> resolve amiguities.

Lots of other popular interpreted languages managed to get by without the
need for something unique to identify a variable name: LISP, TCL,
JavaScript, Visual Basic.  During parsing an interpreter or compiler will
know when it might see a variable (or constant, which can be stored in the
same hash table).  Look at the syntax for any language.  There's really no
need for extraneous symbol table lookups.

> That's why the '$' preceds a variable name. Simply
> said, when the parser sees a '$', it knows which symbol
> table to look it up. If a token doesn't have a '$', it
> can be found in the table of keywords of the language's
> state machine.

But, that's not true.  If the token doesn't have a '$' it could be a
function or constant name, as well as a keyword.

> --
>>O Ernest E. Vogelsinger

--
JR



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




Re: [PHP] PHP and UTF-8

2002-11-12 Thread jacob
I utf8_encode and utf8_decode all data that I put into XML files. The 
application is on a large site so it is thoroughly tested and has encoded and 
decoded data without problems. I have run the application on Linux Slackware 
and FreeBSD.

Quoting Charles Wiltgen <[EMAIL PROTECTED]>:

> Hello,
> 
> I anyone out there using UTF-8 for files and databases?  I want to use it
> for everything, and it'd be a major hassle if PHP's UTF-8 support was super-
> dependent on underlying OS issues, so any feedback is appreciated.
> 
> -- Charles
> 
> 
> Charles Wiltgen wrote...
> 
> > How mature is PHP's support for UTF-8, real-world?  Is it ubiquitous
> enough
> > to use for commercial applications that'll be running on systems that you
> > don't configure yourself?
> > 
> > From the notes in the documentation, it sounds like there are dependencies
> > on the underlying OS, and that I wouldn't be able to count on this
> > functionality.
> > 
> > I'd love to hear about the experience of list members who use this on many
> > different PHP platforms.
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



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




Re: [PHP] PHP and UTF-8

2002-11-12 Thread Charles Wiltgen
Hello,

I anyone out there using UTF-8 for files and databases?  I want to use it
for everything, and it'd be a major hassle if PHP's UTF-8 support was super-
dependent on underlying OS issues, so any feedback is appreciated.

-- Charles


Charles Wiltgen wrote...

> How mature is PHP's support for UTF-8, real-world?  Is it ubiquitous enough
> to use for commercial applications that'll be running on systems that you
> don't configure yourself?
> 
> From the notes in the documentation, it sounds like there are dependencies
> on the underlying OS, and that I wouldn't be able to count on this
> functionality.
> 
> I'd love to hear about the experience of list members who use this on many
> different PHP platforms.


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




RE: [PHP] Trying to e-mail password

2002-11-12 Thread John W. Holmes
If you want an email password feature, then just store it as plain text.
If someone is able to get access to your database, that means they more
than likely have access to the rest of your box, so your 'secret code'
is worthless.

---John Holmes...

> -Original Message-
> From: rija [mailto:rija@;vatu.com]
> Sent: Tuesday, November 12, 2002 9:37 PM
> To: php; Ben C.
> Subject: Re: [PHP] Trying to e-mail password
> 
> ENCODE(value, 'secret code')
> DECODE(field name, 'secret code')
> 
> to record
> " ... VALUES ( ... blahblah, ENCODE('$passord', 'secret code', ...
BLAH
> BHAL") ;
> 
> and to read the value
> do like this
> MYSQL_QUERY("SELECT DECODE(password, 'secret code') as password, id,
BLAH
> BLAH
> 
> 
> - Original Message -
> From: "Ben C." <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, November 13, 2002 12:07 PM
> Subject: Re: [PHP] Trying to e-mail password
> 
> 
> > Is there not any way to reverse the crypted password before
e-mailing??
> >
> > If not, how do I use ENCODE / DECODE?
> >
> >
> > >
> > > From: "rija" <[EMAIL PROTECTED]>
> > > Date: 2002/11/12 Tue PM 07:32:28 EST
> > > To: "php" <[EMAIL PROTECTED]>,
> > > "Ben C." <[EMAIL PROTECTED]>
> > > Subject: Re: [PHP] Trying to e-mail password
> > >
> > > You should do like this:
> > >
> > > $password = $row['password'];
> > > This return weird crypted value of your password.
> > >
> > > Unless you want send the this weird password. The function
> mysql_password is
> > > irreversible, you cannot get back the value crypted by password.
Use
> ENCODE
> > > and DECODE instead,
> > >
> > >
> > >
> > > - Original Message -
> > > From: "Ben C." <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Wednesday, November 13, 2002 11:09 AM
> > > Subject: [PHP] Trying to e-mail password
> > >
> > >
> > > > I am trying to have a form that send a user their email and
password
> to
> > > login.  I am using the following:
> > > >
> > > > while ($row = mysql_fetch_array($result)) {
> > > > $email = $row['email'];
> > > > $password = $row['password(password)'];
> > > >
> > > > When I use the mail() function to send both $email and $password
I
> receive
> > > an e-mail with a blank password.
> > > >
> > > > What am I doing wrong.  Please help!
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




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




Re: [PHP] Trying to e-mail password

2002-11-12 Thread rija
ENCODE(value, 'secret code')
DECODE(field name, 'secret code')

to record
" ... VALUES ( ... blahblah, ENCODE('$passord', 'secret code', ... BLAH
BHAL") ;

and to read the value
do like this
MYSQL_QUERY("SELECT DECODE(password, 'secret code') as password, id, BLAH
BLAH


- Original Message -
From: "Ben C." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 13, 2002 12:07 PM
Subject: Re: [PHP] Trying to e-mail password


> Is there not any way to reverse the crypted password before e-mailing??
>
> If not, how do I use ENCODE / DECODE?
>
>
> >
> > From: "rija" <[EMAIL PROTECTED]>
> > Date: 2002/11/12 Tue PM 07:32:28 EST
> > To: "php" <[EMAIL PROTECTED]>,
> > "Ben C." <[EMAIL PROTECTED]>
> > Subject: Re: [PHP] Trying to e-mail password
> >
> > You should do like this:
> >
> > $password = $row['password'];
> > This return weird crypted value of your password.
> >
> > Unless you want send the this weird password. The function
mysql_password is
> > irreversible, you cannot get back the value crypted by password. Use
ENCODE
> > and DECODE instead,
> >
> >
> >
> > - Original Message -
> > From: "Ben C." <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, November 13, 2002 11:09 AM
> > Subject: [PHP] Trying to e-mail password
> >
> >
> > > I am trying to have a form that send a user their email and password
to
> > login.  I am using the following:
> > >
> > > while ($row = mysql_fetch_array($result)) {
> > > $email = $row['email'];
> > > $password = $row['password(password)'];
> > >
> > > When I use the mail() function to send both $email and $password I
receive
> > an e-mail with a blank password.
> > >
> > > What am I doing wrong.  Please help!
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




Re: [PHP] How To Delete All Files In A Directory

2002-11-12 Thread @ Edwin
Hello,

"@ Nilaab" <[EMAIL PROTECTED]> wrote:

> Hello Everyone,
>
> I have a directory that I want emptied everytime a script accesses a
certain
> function. I tried using rmdir() and then mkdir(), thinking that it will
> delete the directory and the contents within it, and would create a brand
> new directory for me to work with from scratch. Well, that didn't happen
and
> I read the PHP docs to see why.

I think you already saw the reason why.

  http://us.php.net/manual/en/function.rmdir.php

> I checked to see how else I can do this by reading about some other
> filesystem functions, and now I'm more confused than ever. Which
> combinations of functions would I need to empty a directory's entire
> contents? I just need some direction on this. Thanks.

Maybe you're looking for this:

  http://us.php.net/manual/en/function.unlink.php

You can find more info in the manual:

  http://us.php.net/manual/en/ref.filesystem.php

- E


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




RE: [PHP] How To Delete All Files In A Directory

2002-11-12 Thread Martin Towell
you could break out into the shell and do
rm $dir/*(rm -r $dir/*  if there's directories too)
 (or  del $dir/*.*  for dos)

or use opendir, readdir, closedir to read the directory's content and use
unlink to delete the file(s)

(if $dir is not hardcoded, I can see a security hole here)

-Original Message-
From: @ Nilaab [mailto:superbus22@;attbi.com]
Sent: Wednesday, November 13, 2002 1:32 PM
To: Php-General
Subject: [PHP] How To Delete All Files In A Directory


Hello Everyone,

I have a directory that I want emptied everytime a script accesses a certain
function. I tried using rmdir() and then mkdir(), thinking that it will
delete the directory and the contents within it, and would create a brand
new directory for me to work with from scratch. Well, that didn't happen and
I read the PHP docs to see why.

I checked to see how else I can do this by reading about some other
filesystem functions, and now I'm more confused than ever. Which
combinations of functions would I need to empty a directory's entire
contents? I just need some direction on this. Thanks.

- Nilaab


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

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




[PHP] How To Delete All Files In A Directory

2002-11-12 Thread @ Nilaab
Hello Everyone,

I have a directory that I want emptied everytime a script accesses a certain
function. I tried using rmdir() and then mkdir(), thinking that it will
delete the directory and the contents within it, and would create a brand
new directory for me to work with from scratch. Well, that didn't happen and
I read the PHP docs to see why.

I checked to see how else I can do this by reading about some other
filesystem functions, and now I'm more confused than ever. Which
combinations of functions would I need to empty a directory's entire
contents? I just need some direction on this. Thanks.

- Nilaab


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




Re: [PHP] PHP, MySQL, and Japanese text

2002-11-12 Thread @ Edwin
Hello,

"Step Schwarz" <[EMAIL PROTECTED]> wrote:

> Hi all,
>
> I was hoping to find some code examples or tutorials on using PHP/MySQL
with
> Japanese text.  The site I've built is very close, but apparently a very

I'm not sure about tutorials in English but if you know Japanese, I'm sure
you can just google for them. :)

> small subset of the characters become garbage when pulled from the
database
> into a form to be modified and resubmit to the database.  Text in

> tags seems immune -- it's only the text pulled into  tags.

I'm not really sure if I understand what you meant here--perhaps you can
post some sample codes?

> I've tried to follow the PHP documentation on handling multibyte
characters
> but without practical examples it really just doesn't make a lot of sense
to
> me.
>
> I'm not currently using encoding or output buffering at all -- I've just
set
> the language to be "shift_jis" in a meta tag.

You mean in your html pages? That wouldn't really work unless you've
configured php to handle multi-byte characters. (Maybe not necessary in
4.3.x versions...) Besides, you also need to configure MySQL to handle the
Japanese characters. You need to check your configuration/settings in your
my.cnf and php.ini.

Without any code snippets and environment info, it'll be hard for anybody to
help out...

- E


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




Re: [PHP] Would appreciate thoughts on session management

2002-11-12 Thread Charles Wiltgen
Michael Sims wrote...

> It's always been my experience that trans sid doesn't append the SID to header
> redirects.  You have to do it manually (I use the SID constant for this
> purpose).

When I test on a browser with cookies disabled, I imagine I'll find that I
have to do that.  That's okay, though.

> Of course, the above would work for clients that send the appropriate cookie,
> but if you're using cookies anyway why go to all this trouble?

Because (for example) you can't have a button on your page that adjusts a
property (represented as a PHP session variable) of some object on a page.
Instead, you have to use GET variables, PUT variables or cookies to pass
data to the next page.

GET variables seem to be the best choice for non-form items.  The problem
with GET variables is that, normally, you see them in the address bar.  This
is user-unfriendly, allows people to bookmark URLs that won't work outside
of their session, etc.  Today alone, 3 out of 4 URLs that people IM'd me
didn't work, because they were filled with session-specific properties.



My Invisible GET method avoids all of this.



-- Charles Wiltgen


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




Re: [PHP] syntax question...

2002-11-12 Thread @ Edwin
Hello

"Kelly Meeks" <[EMAIL PROTECTED]> wrote:

> I saw this used in a script, but after a couple of searches didn't come up
with anything on php.net.

I think you're looking for this:

http://www.php.net/manual/en/language.types.string.php#language.types.string
.syntax.heredoc

- E

...[snip]...

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




Re: [PHP] syntax question...

2002-11-12 Thread bahwi
There are typically called a 'heredoc' or 'here document'. basically it 
changes the double quotation mark(") to
'content' (in this case). To start, do this <<

and to end it just type content;
on a line by itself.

The example you showed does echo the stuff out. It sets all the internal 
html to $var and echo's $var afterwards.

Hope this helps!

--Joseph Guhlin
http://www.bahwi.cc/
Web Developer / Unix Consultant

Kelly Meeks wrote:

I saw this used in a script, but after a couple of searches didn't come up with anything on php.net.


$var=<<




$phpvarhere




content;
echo $var;
?>

So, does this allow you to output mixed html/php without having to escape offending characters with no echo or print?
Conceptually, would the syntax above work?

TIA

Kelly 
 



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




[PHP] syntax question...

2002-11-12 Thread Kelly Meeks
I saw this used in a script, but after a couple of searches didn't come up with 
anything on php.net.





$phpvarhere




content;
echo $var;
?>

So, does this allow you to output mixed html/php without having to escape offending 
characters with no echo or print?
Conceptually, would the syntax above work?

TIA

Kelly 

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




[PHP] constants and sessions

2002-11-12 Thread Eduardo M. Bragatto
	I have to change the constant "maximum_time_out" (via
set_timeout_limit) on the "first" script, and keep it seted
in a session, until the second script became to be loaded.
Is that possible?

		[[]]'s Bragatto

PS: sorry for my miserable english #)



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




RE: [PHP] File Upload problem

2002-11-12 Thread Van Andel, Robert
Upon reading my reply, I think perhaps I wasn't clear enough.  I am using
users_file, etc.  I am unable to upload a file because $users_file is given
the value of "none".


-Original Message-
From: Van Andel, Robert 
Sent: Tuesday, November 12, 2002 3:59 PM
To: Ernest E Vogelsinger
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] File Upload problem 


It was a typo.  Sorry.

-Original Message-
From: Ernest E Vogelsinger [mailto:ernest@;vogelsinger.at]
Sent: Tuesday, November 12, 2002 3:46 PM
To: Van Andel, Robert
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] File Upload problem 


At 00:25 13.11.2002, Van Andel, Robert said:
[snip] 
>encType=multipart/form-data>name=MAX_FILE_SIZE> 
>
> }
>?>
>When I submit the form at the bottom of the script, the $user_file variable
>equals "none".  I am unable to figure out what is going on.  The variable
>$users_file_name lists the file's name, but the $user_file is none and the
>$user_file_size =0. 
> 
>Why is $user_file equal to none?  Any help will be greatly appreciated. 
[snip] 

Try to use the name $users_file and $users_file_size (note the 's' after
user).
Just in case that was no typo in your message...


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



 "The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers." 




 "The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers." 





Re: [PHP] Would appreciate thoughts on session management

2002-11-12 Thread Michael Sims
On Tue, 12 Nov 2002 15:55:52 -0800, you wrote:

>It's simple, which is one thing I like about it.  My submit.php looks like
>this:
>
>session_start();
>header('Location: ' . $_REQUEST['target']);
[snip]

I'm curious...your redirect doesn't include the session ID, so how you
maintain session information for people who don't have cookies
enabled?  It's always been my experience that trans sid doesn't append
the SID to header redirects.  You have to do it manually (I use the
SID constant for this purpose).

Of course, the above would work for clients that send the appropriate
cookie, but if you're using cookies anyway why go to all this trouble?

I apologize if I'm not understanding what you're trying to
accomplish...

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




[PHP] jobs?

2002-11-12 Thread arch
Can anyone recommend a good resource for php -related jobs, especially in
the los angeles area?



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




RE: [PHP] Trying to e-mail password

2002-11-12 Thread Nick Richardson
If the password is md5, then no - you can't reverse it because md5 is a
one way hash.

If you want to have bi-direction encryption/decryption, look into using
mcrypt. - just not on windows... Because it will make you want to kill
yourself.

http://www.php.net/mcrypt

-Original Message-
From: Ben C. [mailto:benc@;cox.net] 
Sent: Tuesday, November 12, 2002 5:08 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Trying to e-mail password


Is there not any way to reverse the crypted password before e-mailing??


If not, how do I use ENCODE / DECODE?


> 
> From: "rija" <[EMAIL PROTECTED]>
> Date: 2002/11/12 Tue PM 07:32:28 EST
> To: "php" <[EMAIL PROTECTED]>, 
>   "Ben C." <[EMAIL PROTECTED]>
> Subject: Re: [PHP] Trying to e-mail password
> 
> You should do like this:
> 
> $password = $row['password'];
> This return weird crypted value of your password.
> 
> Unless you want send the this weird password. The function 
> mysql_password is irreversible, you cannot get back the value crypted 
> by password. Use ENCODE and DECODE instead,
> 
> 
> 
> - Original Message -
> From: "Ben C." <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, November 13, 2002 11:09 AM
> Subject: [PHP] Trying to e-mail password
> 
> 
> > I am trying to have a form that send a user their email and password

> > to
> login.  I am using the following:
> >
> > while ($row = mysql_fetch_array($result)) {
> > $email = $row['email'];
> > $password = $row['password(password)'];
> >
> > When I use the mail() function to send both $email and $password I 
> > receive
> an e-mail with a blank password.
> >
> > What am I doing wrong.  Please help!
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


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

---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
 


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




Re: [PHP] Trying to e-mail password

2002-11-12 Thread Ben C .
Is there not any way to reverse the crypted password before e-mailing??  

If not, how do I use ENCODE / DECODE?


> 
> From: "rija" <[EMAIL PROTECTED]>
> Date: 2002/11/12 Tue PM 07:32:28 EST
> To: "php" <[EMAIL PROTECTED]>, 
>   "Ben C." <[EMAIL PROTECTED]>
> Subject: Re: [PHP] Trying to e-mail password
> 
> You should do like this:
> 
> $password = $row['password'];
> This return weird crypted value of your password.
> 
> Unless you want send the this weird password. The function mysql_password is
> irreversible, you cannot get back the value crypted by password. Use ENCODE
> and DECODE instead,
> 
> 
> 
> - Original Message -
> From: "Ben C." <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, November 13, 2002 11:09 AM
> Subject: [PHP] Trying to e-mail password
> 
> 
> > I am trying to have a form that send a user their email and password to
> login.  I am using the following:
> >
> > while ($row = mysql_fetch_array($result)) {
> > $email = $row['email'];
> > $password = $row['password(password)'];
> >
> > When I use the mail() function to send both $email and $password I receive
> an e-mail with a blank password.
> >
> > What am I doing wrong.  Please help!
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


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




Re: [PHP] ereg_replace();

2002-11-12 Thread Gustaf Sjoberg
hi,
i tried to implement the code, but it does not work if the string:

a) doesnt contain any ..
b) doesnt contain any 
c) doesnt contain any 
d) contains multiple ..'s

so i altered it a little and this is what i came up with:

)(.*?)(<\/pre>)(.*)/is', $string))
{
if (!preg_match('//is', $string))
return $string;
else
$string .= "";
}
while ($string)
{
preg_match('/(.*?)(.*?)(<\/pre>)(.*)/is', $string, $arMatch); 
  
if (is_array($arMatch))
{
$result .= $arMatch[1];
$result .= str_replace('','',$arMatch[2]);
$result .= $arMatch[3];
if (!preg_match('//is', $arMatch[4]))
{
$result .= $arMatch[4];
return $result;
}
$string = $arMatch[4];
}
else break;
}
}
//test string
$param = 
"testtesttestingtestingtesttesttesttesttesttestingtest";
echo remove_br_in_pre($param);
?>

now, i've tried it in a few different scenarios and it seems to be working, although 
the function might be redundant and far from pretty - it gets the job done. however, i 
have a question; what does the "is" in //is denote? ;-) (doesnt it feel great to have 
code sniplets you have no idea what they do in your scripts? ;-))

also, do you see any direct "bugs slash features" in the current function? i'm not 
usually asking someone who spends his freetime helping others "baby sit" my code, but 
this was my first day using regular expressions so i've been taking a few sure shots.. 
so it would be great if you could just take a quick glance at it.

thanks in anticipation,
GS

On Tue, 12 Nov 2002 18:57:04 +0100
[EMAIL PROTECTED] (Ernest E Vogelsinger) wrote:

>At 18:44 12.11.2002, Gustaf Sjoberg spoke out and said:
>[snip]
>>many thanks, and kudos for the quick reply. i will try that right away!
>>
>>as a sub-question, do you mind telling me where you learned regexp? i've 
>>been searching google all day with no luck, i've just find more or less 
>>basic regexp guides. did you learn through practice or do you have a secret 
>>source? ;-)
>[snip] 
>
>This stems from my old Perl days - I recommend reading the "Camel Book" :)
>
>Refer to http://www.perldoc.com/perl5.6/pod/perlre.html and eat this page -
>you'll be a RegEx whiz in seconds (naahh - it takes a bit longer ;->)
>
>
>-- 
>   >O Ernest E. Vogelsinger 
>   (\) ICQ #13394035 
>^ http://www.vogelsinger.at/
>


-- 
Gustaf Sjoberg <[EMAIL PROTECTED]>
 <(" <) <(" )> <( ")> (> ")> 

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




Re: [PHP] Multiple selections

2002-11-12 Thread David Rice
On Tuesday, November 12, 2002, at 07:34 PM, Ernest E Vogelsinger wrote:


Sure it is - just name the listbox control "myvar[]" (note the angle
brackets). PHP will recognize this being an array, and you'll end up 
with
$myvar = array('select1','select2');

Is this the only way to do this?

I just had to do some work with JavaScript and forms and the "myvar[]" 
name clobbered JavaScript's access to form elements by name. I had to 
do some ugly form.elements[x] looping to get at the "myvar[]" control.

This kind on external language hostility is not that cool, especially 
toward such a common language as JavaScript.

My apologies to PHP if the language provides a workaround :)

David



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



Re: [PHP] Multiple selections

2002-11-12 Thread Todd Cary




Many thanks!!  One thing I do not understand in the "types" of variables
is the use and referencing of a variable with the "[]".  What I usually do
is define a variable as

$myvar = array();

And then I use the "[]" to refer to the elements.  However, if I understand
you suggestion, which works like a champ, the use of the "[]" tells the interpreter
to treat $myvar as an array.

Todd

Marco Tabini wrote:

  Sure! Just add [] to the end of the name of the field. PHP will return
all the values in an array:




Marco
  
  
  
  

  

Subject:

[PHP] Multiple selections
  
  

From: 
Todd Cary <[EMAIL PROTECTED]>
  
  

Date: 
Tue, 12 Nov 2002 16:37:43 -0800
  
  

To: 
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
  

  
  
 I have a pull-down with the MULTIPLE attribute.  If the Form is of Type
 GET and two values are selected (e.g. select1 and select2), I see in the
 URL the following: 
 
?myvar=select1&myvar=select2 
 
"myvar" appears twice, however, if I check the $HTTP_GET_VARS, I only  have
one value: myvar=select2. 
 
Is it possible to get both values? 
 
Todd 
 
 


-- 
 

  
 
 
 





Re: [PHP] ldap strong authentication

2002-11-12 Thread BigDog
Check the documentation on the openldap and see what you need to use for
the rdn..

if you are running gnome you might want to test it out with gq.  That is
what i use to test out my connection and stuff with...


On Wed, 2002-11-13 at 00:44, Karim Jafarmadar wrote:
> On 12 Nov 2002 17:33:35 +
> BigDog <[EMAIL PROTECTED]> wrote:
> 
> > You have two problems it seems.
> > 
> > 1. Wrong connection security...now you are using ldaps
> > 2. Now you have the incorrect rdn.
> 
> Oh .. i get it 
> you mean the second error is due to a ldap/nds problem but i got the connection right
>  
> > when you tried it with ldap you could not even pass the rdn because the
> > encryption was not sufficient.  Now you have the encryption down and now
> > it seems that the rdn is wrong.
> > 
> > Try fixing that and see what happens...
> 
> ok .. that was the problem
> i now get an "operations error" .. but since i am already connected, i hope i can 
>figure it out by myself
> 
> thank you !!
> karim jafarmadar
> 
>  
> > 
> > On Wed, 2002-11-13 at 00:30, Karim Jafarmadar wrote:
> > > On 12 Nov 2002 17:24:38 +
> > > Ray Hunter <[EMAIL PROTECTED]> wrote:
> > > 
> > > > So you are connecting via ldaps://host in the ldap_connect function
> > > > right?
> > > > 
> > > > then when you bind make sure you are using the appropriate rdn for that
> > > > ldap server.
> > > 
> > > do i have to use another rdn, than when connecting via ldap://?
> > > i mean, i give the same parameters to the bind function in both methodes (ldap, 
>ldaps), but get those different error messages.
> > > 
> > >  
> > > > That is probably why u are getting a "No such Object" error.
> > > > 
> > > > 
> > > > 
> > > > 
> > > > On Wed, 2002-11-13 at 00:19, Karim Jafarmadar wrote:
> > > > > thanks for your reply
> > > > > 
> > > > > the whole error message is
> > > > > 
> > > > > Warning: LDAP: Unable to bind to server: Strong authentication required
> > > > > 
> > > > > and when i connect via SSH its something like that
> > > > > 
> > > > > Warning: LDAP: Unable to bind to server: No such Object in ...
> > > > > 
> > > > > i am running this thing on a debian box with php4 and openldap-tls installed
> > > > > 
> > > > > bye
> > > > > karim jafarmadar
> > > > > 
> > > > > On 12 Nov 2002 17:13:17 +
> > > > > BigDog <[EMAIL PROTECTED]> wrote:
> > > > > 
> > > > > > What type of strong authentication does it want?
> > > > > > 
> > > > > > Do you need to connect via ssh or something...
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > On Tue, 2002-11-12 at 22:13, Karim Jafarmadar wrote:
> > > > > > > hello
> > > > > > > 
> > > > > > > I want to connect to a local NDS via LDAP, but when i try to bind i get 
> > > > > > > the error:
> > > > > > > 
> > > > > > > Unable to bind: Strong authentication required
> > > > > > > 
> > > > > > > after i search in google and php.net manual i wonder if it is possible 
> > > > > > > do connect with strong authentication
> > > > > > > 
> > > > > > > any further suggenstions would be great
> > > > > > > 
> > > > > > > tia
> > > > > > > karim jafarmadar
> > > > > > -- 
> > > > > > .: B i g D o g :.
> > > > > > 
> > > > > > 
> > > > -- 
> > > > Thank you,
> > > > 
> > > > Ray Hunter
> > > > 
> > > > 
> > -- 
> > .: B i g D o g :.
> > 
> > 
-- 
.: B i g D o g :.



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




Re: [PHP] ldap strong authentication

2002-11-12 Thread Karim Jafarmadar
On 12 Nov 2002 17:33:35 +
BigDog <[EMAIL PROTECTED]> wrote:

> You have two problems it seems.
> 
> 1. Wrong connection security...now you are using ldaps
> 2. Now you have the incorrect rdn.

Oh .. i get it 
you mean the second error is due to a ldap/nds problem but i got the connection right
 
> when you tried it with ldap you could not even pass the rdn because the
> encryption was not sufficient.  Now you have the encryption down and now
> it seems that the rdn is wrong.
> 
> Try fixing that and see what happens...

ok .. that was the problem
i now get an "operations error" .. but since i am already connected, i hope i can 
figure it out by myself

thank you !!
karim jafarmadar

 
> 
> On Wed, 2002-11-13 at 00:30, Karim Jafarmadar wrote:
> > On 12 Nov 2002 17:24:38 +
> > Ray Hunter <[EMAIL PROTECTED]> wrote:
> > 
> > > So you are connecting via ldaps://host in the ldap_connect function
> > > right?
> > > 
> > > then when you bind make sure you are using the appropriate rdn for that
> > > ldap server.
> > 
> > do i have to use another rdn, than when connecting via ldap://?
> > i mean, i give the same parameters to the bind function in both methodes (ldap, 
>ldaps), but get those different error messages.
> > 
> >  
> > > That is probably why u are getting a "No such Object" error.
> > > 
> > > 
> > > 
> > > 
> > > On Wed, 2002-11-13 at 00:19, Karim Jafarmadar wrote:
> > > > thanks for your reply
> > > > 
> > > > the whole error message is
> > > > 
> > > > Warning: LDAP: Unable to bind to server: Strong authentication required
> > > > 
> > > > and when i connect via SSH its something like that
> > > > 
> > > > Warning: LDAP: Unable to bind to server: No such Object in ...
> > > > 
> > > > i am running this thing on a debian box with php4 and openldap-tls installed
> > > > 
> > > > bye
> > > > karim jafarmadar
> > > > 
> > > > On 12 Nov 2002 17:13:17 +
> > > > BigDog <[EMAIL PROTECTED]> wrote:
> > > > 
> > > > > What type of strong authentication does it want?
> > > > > 
> > > > > Do you need to connect via ssh or something...
> > > > > 
> > > > > 
> > > > > 
> > > > > On Tue, 2002-11-12 at 22:13, Karim Jafarmadar wrote:
> > > > > > hello
> > > > > > 
> > > > > > I want to connect to a local NDS via LDAP, but when i try to bind i get 
> > > > > > the error:
> > > > > > 
> > > > > > Unable to bind: Strong authentication required
> > > > > > 
> > > > > > after i search in google and php.net manual i wonder if it is possible 
> > > > > > do connect with strong authentication
> > > > > > 
> > > > > > any further suggenstions would be great
> > > > > > 
> > > > > > tia
> > > > > > karim jafarmadar
> > > > > -- 
> > > > > .: B i g D o g :.
> > > > > 
> > > > > 
> > > -- 
> > > Thank you,
> > > 
> > > Ray Hunter
> > > 
> > > 
> -- 
> .: B i g D o g :.
> 
> 

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




Re: [PHP] Multiple selections

2002-11-12 Thread Marco Tabini
Sure! Just add [] to the end of the name of the field. PHP will return
all the values in an array:




Marco
-- 

php|architect - The magazine for PHP Professionals
The monthly worldwide magazine dedicated to PHP programmers

Come visit us at http://www.phparch.com!

--- Begin Message ---
I have a pull-down with the MULTIPLE attribute.  If the Form is of Type 
GET and two values are selected (e.g. select1 and select2), I see in the 
URL the following:

?myvar=select1&myvar=select2

"myvar" appears twice, however, if I check the $HTTP_GET_VARS, I only 
have one value: myvar=select2.

Is it possible to get both values?

Todd


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


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


Re: [PHP] Trying to e-mail password

2002-11-12 Thread rija
You should do like this:

$password = $row['password'];
This return weird crypted value of your password.

Unless you want send the this weird password. The function mysql_password is
irreversible, you cannot get back the value crypted by password. Use ENCODE
and DECODE instead,



- Original Message -
From: "Ben C." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 13, 2002 11:09 AM
Subject: [PHP] Trying to e-mail password


> I am trying to have a form that send a user their email and password to
login.  I am using the following:
>
> while ($row = mysql_fetch_array($result)) {
> $email = $row['email'];
> $password = $row['password(password)'];
>
> When I use the mail() function to send both $email and $password I receive
an e-mail with a blank password.
>
> What am I doing wrong.  Please help!
>
>
> --
> 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] Multiple selections

2002-11-12 Thread Ernest E Vogelsinger
At 01:37 13.11.2002, Todd Cary said:
[snip]
>I have a pull-down with the MULTIPLE attribute.  If the Form is of Type 
>GET and two values are selected (e.g. select1 and select2), I see in the 
>URL the following:
>
>?myvar=select1&myvar=select2
>
>"myvar" appears twice, however, if I check the $HTTP_GET_VARS, I only 
>have one value: myvar=select2.
>
>Is it possible to get both values?
[snip] 

Sure it is - just name the listbox control "myvar[]" (note the angle
brackets). PHP will recognize this being an array, and you'll end up with
$myvar = array('select1','select2');


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] ldap strong authentication

2002-11-12 Thread BigDog
You have two problems it seems.

1. Wrong connection security...now you are using ldaps
2. Now you have the incorrect rdn.

when you tried it with ldap you could not even pass the rdn because the
encryption was not sufficient.  Now you have the encryption down and now
it seems that the rdn is wrong.

Try fixing that and see what happens...



On Wed, 2002-11-13 at 00:30, Karim Jafarmadar wrote:
> On 12 Nov 2002 17:24:38 +
> Ray Hunter <[EMAIL PROTECTED]> wrote:
> 
> > So you are connecting via ldaps://host in the ldap_connect function
> > right?
> > 
> > then when you bind make sure you are using the appropriate rdn for that
> > ldap server.
> 
> do i have to use another rdn, than when connecting via ldap://?
> i mean, i give the same parameters to the bind function in both methodes (ldap, 
>ldaps), but get those different error messages.
> 
>  
> > That is probably why u are getting a "No such Object" error.
> > 
> > 
> > 
> > 
> > On Wed, 2002-11-13 at 00:19, Karim Jafarmadar wrote:
> > > thanks for your reply
> > > 
> > > the whole error message is
> > > 
> > > Warning: LDAP: Unable to bind to server: Strong authentication required
> > > 
> > > and when i connect via SSH its something like that
> > > 
> > > Warning: LDAP: Unable to bind to server: No such Object in ...
> > > 
> > > i am running this thing on a debian box with php4 and openldap-tls installed
> > > 
> > > bye
> > > karim jafarmadar
> > > 
> > > On 12 Nov 2002 17:13:17 +
> > > BigDog <[EMAIL PROTECTED]> wrote:
> > > 
> > > > What type of strong authentication does it want?
> > > > 
> > > > Do you need to connect via ssh or something...
> > > > 
> > > > 
> > > > 
> > > > On Tue, 2002-11-12 at 22:13, Karim Jafarmadar wrote:
> > > > > hello
> > > > > 
> > > > > I want to connect to a local NDS via LDAP, but when i try to bind i get 
> > > > > the error:
> > > > > 
> > > > > Unable to bind: Strong authentication required
> > > > > 
> > > > > after i search in google and php.net manual i wonder if it is possible 
> > > > > do connect with strong authentication
> > > > > 
> > > > > any further suggenstions would be great
> > > > > 
> > > > > tia
> > > > > karim jafarmadar
> > > > -- 
> > > > .: B i g D o g :.
> > > > 
> > > > 
> > -- 
> > Thank you,
> > 
> > Ray Hunter
> > 
> > 
-- 
.: B i g D o g :.



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




Re: [PHP] ldap strong authentication

2002-11-12 Thread Karim Jafarmadar
On 12 Nov 2002 17:24:38 +
Ray Hunter <[EMAIL PROTECTED]> wrote:

> So you are connecting via ldaps://host in the ldap_connect function
> right?
> 
> then when you bind make sure you are using the appropriate rdn for that
> ldap server.

do i have to use another rdn, than when connecting via ldap://?
i mean, i give the same parameters to the bind function in both methodes (ldap, 
ldaps), but get those different error messages.

 
> That is probably why u are getting a "No such Object" error.
> 
> 
> 
> 
> On Wed, 2002-11-13 at 00:19, Karim Jafarmadar wrote:
> > thanks for your reply
> > 
> > the whole error message is
> > 
> > Warning: LDAP: Unable to bind to server: Strong authentication required
> > 
> > and when i connect via SSH its something like that
> > 
> > Warning: LDAP: Unable to bind to server: No such Object in ...
> > 
> > i am running this thing on a debian box with php4 and openldap-tls installed
> > 
> > bye
> > karim jafarmadar
> > 
> > On 12 Nov 2002 17:13:17 +
> > BigDog <[EMAIL PROTECTED]> wrote:
> > 
> > > What type of strong authentication does it want?
> > > 
> > > Do you need to connect via ssh or something...
> > > 
> > > 
> > > 
> > > On Tue, 2002-11-12 at 22:13, Karim Jafarmadar wrote:
> > > > hello
> > > > 
> > > > I want to connect to a local NDS via LDAP, but when i try to bind i get 
> > > > the error:
> > > > 
> > > > Unable to bind: Strong authentication required
> > > > 
> > > > after i search in google and php.net manual i wonder if it is possible 
> > > > do connect with strong authentication
> > > > 
> > > > any further suggenstions would be great
> > > > 
> > > > tia
> > > > karim jafarmadar
> > > -- 
> > > .: B i g D o g :.
> > > 
> > > 
> -- 
> Thank you,
> 
> Ray Hunter
> 
> 

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




[PHP] Multiple selections

2002-11-12 Thread Todd Cary
I have a pull-down with the MULTIPLE attribute.  If the Form is of Type 
GET and two values are selected (e.g. select1 and select2), I see in the 
URL the following:

?myvar=select1&myvar=select2

"myvar" appears twice, however, if I check the $HTTP_GET_VARS, I only 
have one value: myvar=select2.

Is it possible to get both values?

Todd


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



Re: [PHP] ldap strong authentication

2002-11-12 Thread Ray Hunter
So you are connecting via ldaps://host in the ldap_connect function
right?

then when you bind make sure you are using the appropriate rdn for that
ldap server.

That is probably why u are getting a "No such Object" error.




On Wed, 2002-11-13 at 00:19, Karim Jafarmadar wrote:
> thanks for your reply
> 
> the whole error message is
> 
> Warning: LDAP: Unable to bind to server: Strong authentication required
> 
> and when i connect via SSH its something like that
> 
> Warning: LDAP: Unable to bind to server: No such Object in ...
> 
> i am running this thing on a debian box with php4 and openldap-tls installed
> 
> bye
> karim jafarmadar
> 
> On 12 Nov 2002 17:13:17 +
> BigDog <[EMAIL PROTECTED]> wrote:
> 
> > What type of strong authentication does it want?
> > 
> > Do you need to connect via ssh or something...
> > 
> > 
> > 
> > On Tue, 2002-11-12 at 22:13, Karim Jafarmadar wrote:
> > > hello
> > > 
> > > I want to connect to a local NDS via LDAP, but when i try to bind i get 
> > > the error:
> > > 
> > > Unable to bind: Strong authentication required
> > > 
> > > after i search in google and php.net manual i wonder if it is possible 
> > > do connect with strong authentication
> > > 
> > > any further suggenstions would be great
> > > 
> > > tia
> > > karim jafarmadar
> > -- 
> > .: B i g D o g :.
> > 
> > 
-- 
Thank you,

Ray Hunter



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




[PHP] Solution: Re: [PHP] No PHP question, rather Apache config

2002-11-12 Thread Ernest E Vogelsinger
Found it - sorry. For anyone curious here's what I found:

You _need_ to have an Order directove for Allow, so:
the .htaccess file reads
   AuthName "IPlease authenticate"
   AuthType Basic
   AuthUserFile /www/.htpasswd
   AuthGroupFile /www/.htgroup
   Require group internal
Order deny,allow
  deny from all
   Allow from 10.10.10.0/24
   Satisfy any

At 01:01 13.11.2002, Ernest E Vogelsinger said:
[snip]
>Hi folks,
>
>sorry, no PHP or else this time, just a quick OT question (don't want to
>need to subscribe to another mailing list).
>
>I'm just messing around with our Apache config and thought someone could
>give me a quick pointer...
>
>Here we go:
>
>
>AllowOverride AuthConfig Limit
>
>
>The .htaccess file reads
>AuthName "IPlease authenticate"
>AuthType Basic
>AuthUserFile /www/.htpasswd
>AuthGroupFile /www/.htgroup
>Require group internal
>Allow from 10.10.10.0/28
>Satisfy any
>
>If I remove the "Allow" and "Satisfy any" clause, Apache correctly
>authenticates a user. However I want to have our internal net
>(10.10.10.0/28) to get in w/o authentication.
>
>Unfortunately, adding the "Allow" and "Satisfy" clauses virtually renders
>the page unsecured, you can get in without auth from everywhere.
>
>Running Apache 1.3.23 on RHL 7.2. Any clues?
>
>Thanks, and sorry for OT
>
>
>-- 
>   >O Ernest E. Vogelsinger
>   (\)ICQ #13394035
>^ http://www.vogelsinger.at/
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
[snip] 

-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] ldap strong authentication

2002-11-12 Thread Karim Jafarmadar
thanks for your reply

the whole error message is

Warning: LDAP: Unable to bind to server: Strong authentication required

and when i connect via SSH its something like that

Warning: LDAP: Unable to bind to server: No such Object in ...

i am running this thing on a debian box with php4 and openldap-tls installed

bye
karim jafarmadar

On 12 Nov 2002 17:13:17 +
BigDog <[EMAIL PROTECTED]> wrote:

> What type of strong authentication does it want?
> 
> Do you need to connect via ssh or something...
> 
> 
> 
> On Tue, 2002-11-12 at 22:13, Karim Jafarmadar wrote:
> > hello
> > 
> > I want to connect to a local NDS via LDAP, but when i try to bind i get 
> > the error:
> > 
> > Unable to bind: Strong authentication required
> > 
> > after i search in google and php.net manual i wonder if it is possible 
> > do connect with strong authentication
> > 
> > any further suggenstions would be great
> > 
> > tia
> > karim jafarmadar
> -- 
> .: B i g D o g :.
> 
> 

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




RE: [PHP] Mcrypt Under IIS 5 / Win32?

2002-11-12 Thread BigDog
Can u not get it from php.net...the zip file that contains all the
extensions and dlls...not the installer...

That should have the one that you need.

I am still thinking it is an issue with the path...it took me about a
week to get it all working...


On Tue, 2002-11-12 at 23:08, Nick Richardson wrote:
> Still having problems getting mcrypt to work under Windows.  But I think
> I have narrowed it down to me not having the correct version of
> php_mcrypt.dll.
> 
> I downloaded the source for PHP and attempted to compile this myself,
> but can not get it to work.  If anyone has any information about where I
> can get a current php_mcrypt.dll or how I can compile it from the php
> source (and donÿt say google, because I've been there already), please
> let me know.
> 
> I'm about to lose my mind!!
> 
> Thanks!
> //Nick
> 
> -Original Message-
> From: Nick Richardson [mailto:esoteric.web@;gte.net] 
> Sent: Tuesday, November 12, 2002 12:18 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32?
> 
> 
> I'm trying to load it via php.ini w/ extension=php_mcrypt.dll and
> php_mcrypt.dll is in the extension_dir - When php_mcrypt.dll is not in
> the right place, it tells me it can't load the dll.
> 
> Is there something other than the cygwin1.dll and php_mcrypt.dll that I
> have to install on the system - all the documentation (what little there
> is that I have found) has said that I don't need anything other than
> these 2 files.
> 
> -Original Message-
> From: Ray Hunter [mailto:rhunter@;venticon.com] 
> Sent: Monday, November 11, 2002 12:48 PM
> To: Nick Richardson
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32?
> 
> 
> Basically, 
> 
> Are you loading the dll via the file or php?  Make sure that the
> directory(s) where the dlls are located are in your windows path.
> 
> If that doesnt work then you can always put the dll in your systems dll
> directory...
> 
> 
> On Mon, 2002-11-11 at 19:58, Nick Richardson wrote:
> > Ok, another question if you can help.
> > 
> > I have (I think) all the components I need (cygwin1.dll,
> > php_mcrypt.dll, etc...).  Php_mcrypt.dll is in the PHP dir, everything
> 
> > else is in %windir%.
> > 
> > When I try to use any of the mcrypt stuff now, I get:
> > 
> > PHP Warning: Unable to load dynamic library './php_mcrypt.dll' - The
> > specified procedure could not be found. in Unknown on line 0
> > 
> > You have any idea what I might be doing wrong?
> > 
> > //Nick
> > 
> > -Original Message-
> > From: .: B i g D o g :. [mailto:bigdog@;venticon.com]
> > Sent: Monday, November 11, 2002 4:50 AM
> > To: Nick Richardson
> > Cc: [EMAIL PROTECTED]
> > Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32?
> > 
> > 
> > You need to uncomment the dll in the php.ini file...do a search for it
> 
> > and then uncomment it or add it to the php.ini file...
> > 
> > That will load it...
> > 
> > *Note: i would add that directory to your path that contains the
> > mcrypt dll or all dlls for php and the extension directory to...
> > 
> > 
> > On Mon, 2002-11-11 at 19:42, Nick Richardson wrote:
> > > Yes, there is a DLL for it, but getting PHP to know it is there is 
> > > where I'm having the problem - I don?t know how to get PHP to under 
> > > windows to do the equivalent of --with-mcrypt in configure under 
> > > linux. - maybe I havn't registered the mcrypt dll's correctly or 
> > > something like that... But I just can't get it to work.
> > > 
> > > Everytime I try to do it I get 'call to undefined function . '
> > > 
> > > //Nick
> > > 
> > > -Original Message-
> > > From: .: B i g D o g :. [mailto:bigdog@;venticon.com]
> > > Sent: Monday, November 11, 2002 4:37 AM
> > > To: Nick Richardson
> > > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: Re: [PHP] Mcrypt Under IIS 5 / Win32?
> > > 
> > > 
> > > 
> > > is there not a dll for mcrypt?
> > > 
> > > 
> > > On Mon, 2002-11-11 at 19:34, Nick Richardson wrote:
> > > > I asked this before, but didn't get a response.
> > > > 
> > > > Anyone out there have any experience a/o know where I can find
> > > > information on getting the mcrypt functionality to work under 
> > > > Win32
> > -
> > > > I have found a port of mcrypt for Win32, and also learned that you
> > can
> > > 
> > > > compile it using cygwin - but I don?t know how to register mcrypt
> > > > w/ PHP and 'turn on' the mcrypt* functions.
> > > > 
> > > > If anyone has any information or urls / how-tos it would be
> > > > greatly appreciated!
> > > > 
> > > > Thanks!
> > > > 
> > > > //Nick Richardson
> > > > // [EMAIL PROTECTED]
> > > > 
> > > > 
> > > > ---
> > > > Outgoing mail is certified Virus Free. Can McAfee do that? - Hell 
> > > > NO! Checked by AVG anti-virus system (http://www.grisoft.com).
> > > > Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
> > > >  
> > > --
> > > .: B i g D o g :.
> > > 
> > > 
> > > 
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > T

Re: [PHP] ldap strong authentication

2002-11-12 Thread BigDog
What type of strong authentication does it want?

Do you need to connect via ssh or something...



On Tue, 2002-11-12 at 22:13, Karim Jafarmadar wrote:
> hello
> 
> I want to connect to a local NDS via LDAP, but when i try to bind i get 
> the error:
> 
> Unable to bind: Strong authentication required
> 
> after i search in google and php.net manual i wonder if it is possible 
> do connect with strong authentication
> 
> any further suggenstions would be great
> 
> tia
> karim jafarmadar
-- 
.: B i g D o g :.



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




RE: [PHP] Why $ on variable names?

2002-11-12 Thread brucedickey
Yeah, I wondered about that. Having heard that C was designed in part for
the parser. A parser with no lookahead (or maybe 1 char of lookahead) was
used, which is why hex numbers start with "0x" instead of being suffixed
with "_16", just to contrive an example.

I would be curious to hear the author say whether this played a part in his
decision.

Bruce


-Original Message-
From: Ernest E Vogelsinger [mailto:ernest@;vogelsinger.at]
Sent: Tuesday, November 12, 2002 3:54 PM
To: Jonathan Rosenberg (Tabby's Place)
Cc: Marco Tabini; Jonathan Rosenberg (Tabby's Place); PHP-General
Subject: RE: [PHP] Why $ on variable names?


At 22:40 12.11.2002, Jonathan Rosenberg \(Tabby's Place\) said:
[snip]
>I guess this could be true.  But I don't understand why someone would need
>an "easy" way to identify variables?  Why not an easy way to identify
>function names?  Or constants?
>
>In any case, I don't recall anyone complaining that they had trouble
>"identifying variables" in C, C++, Modula, Pascal, Java, etc.
[snip] 

Quite right. But, having developed a couple of interpreters myself, I
assume there's some sound reason.

Think of how an interpreter works. It parses the sourcecode in realtime,
not as a compiler. People must _wait_, every time, until it is finished,
not only once like a compiler. Thus designers of interpreted languages like
something that can easily be distinguished, so you don't need to lookup a
lot of hash tables to identify a symbol, or to resolve amiguities.

That's why the '$' preceds a variable name. Simply said, when the parser
sees a '$', it knows which symbol table to look it up. If a token doesn't
have a '$', it can be found in the table of keywords of the language's
state machine.

Easy explanation, huh? Simple example: taken that a PHP application
consists of 1000 tokens, 200 of the tokens are variable names, and 800
non-variable tokens, the interpreter would either 200 times look up the
wrong symbol table (if it chooses to lookup the keywords first), or 800
times (if it looks up the entity table first).

Simply saves time...

-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



-- 
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] Trying to e-mail password

2002-11-12 Thread Ernest E Vogelsinger
At 01:09 13.11.2002, Ben C. said:
[snip]
>I am trying to have a form that send a user their email and password to 
>login.  I am using the following:
>
>while ($row = mysql_fetch_array($result)) {
>   $email = $row['email'];
>   $password = $row['password(password)'];
>
>When I use the mail() function to send both $email and $password I receive 
>an e-mail with a blank password.  
>
>What am I doing wrong.  Please help!
[snip] 

I assume that the column holding the password is simnply named 'password',
not 'password(password)'.

while ($row = mysql_fetch_array($result)) {
$email = $row['email'];
$password = $row['password'];



-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




[PHP] Trying to e-mail password

2002-11-12 Thread Ben C .
I am trying to have a form that send a user their email and password to login.  I am 
using the following:

while ($row = mysql_fetch_array($result)) {
$email = $row['email'];
$password = $row['password(password)'];

When I use the mail() function to send both $email and $password I receive an e-mail 
with a blank password.  

What am I doing wrong.  Please help!


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




[PHP] No PHP question, rather Apache config

2002-11-12 Thread Ernest E Vogelsinger
Hi folks,

sorry, no PHP or else this time, just a quick OT question (don't want to
need to subscribe to another mailing list).

I'm just messing around with our Apache config and thought someone could
give me a quick pointer...

Here we go:


AllowOverride AuthConfig Limit


The .htaccess file reads
AuthName "IPlease authenticate"
AuthType Basic
AuthUserFile /www/.htpasswd
AuthGroupFile /www/.htgroup
Require group internal
Allow from 10.10.10.0/28
Satisfy any

If I remove the "Allow" and "Satisfy any" clause, Apache correctly
authenticates a user. However I want to have our internal net
(10.10.10.0/28) to get in w/o authentication.

Unfortunately, adding the "Allow" and "Satisfy" clauses virtually renders
the page unsecured, you can get in without auth from everywhere.

Running Apache 1.3.23 on RHL 7.2. Any clues?

Thanks, and sorry for OT


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




RE: [PHP] File Upload problem

2002-11-12 Thread Van Andel, Robert
It was a typo.  Sorry.

Robbert van Andel 
=== 
Network Operator 
NW Regional Operations Center 
Charter Communications 
ROC Phone: 866-311-6646 
Desk Phone: 360-828-6727 
email: DL NW ROC 
=== 


-Original Message-
From: Ernest E Vogelsinger [mailto:ernest@;vogelsinger.at]
Sent: Tuesday, November 12, 2002 3:46 PM
To: Van Andel, Robert
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] File Upload problem 


At 00:25 13.11.2002, Van Andel, Robert said:
[snip] 
>encType=multipart/form-data>name=MAX_FILE_SIZE> 
>
> }
>?>
>When I submit the form at the bottom of the script, the $user_file variable
>equals "none".  I am unable to figure out what is going on.  The variable
>$users_file_name lists the file's name, but the $user_file is none and the
>$user_file_size =0. 
> 
>Why is $user_file equal to none?  Any help will be greatly appreciated. 
[snip] 

Try to use the name $users_file and $users_file_size (note the 's' after
user).
Just in case that was no typo in your message...


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



 "The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers." 





Re: [PHP] Problem with sessions

2002-11-12 Thread rija
maybe you should remove the dot before the session path or do like this :

session.save_path = C:\PHP\sessions\tmp

- Original Message -
From: "Charlie Fowler" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, November 13, 2002 10:19 AM
Subject: [PHP] Problem with sessions


> Hi all,,
>
> Can some one help me with this little issue ... I am trying out some
> prewritten scripts curtesy of SAMS PHP and MYSQL Web Development, Ch24 -
> User Authenication & Personalisation on my server setup
>
> The Configuartion for my development environment is Apache 2.39, Win
> 2000, PHP 4.2.3
>
> The Ini file has the following session settings (as taken from
PHPInfo.php):
>
>
> session
>
> Session Support enabled
>
>
> Directive Local Value Master Value
> session.auto_start
> Off Off
> session.cache_expire
> 180 180
> session.cache_limiter
> nocache nocache
> session.cookie_domain
> no value no value
> session.cookie_lifetime
> 0 0
> session.cookie_path
> / /
> session.cookie_secure
> Off Off
> session.entropy_file
> no value no value
> session.entropy_length
> 0 0
> session.gc_maxlifetime
> 1440 1440
> session.gc_probability
> 1 1
> session.name
> PHPSESSID PHPSESSID
> session.referer_check
> no value no value
> session.save_handler
> files files
> session.save_path
> .c:/php/sessions/tmp .c:/php/sessions/tmp
> session.serialize_handler
> php php
> session.use_cookies
> On On
> session.use_trans_sid
> 0 0
>
>
> The error occurs after the registration page is submitted with the
> following using the function session_start() on the register page.:
>
> Warning:
> open(.c:/php/sessions/tmp\sess_fa42372dcdbde0e457309f134d71827f, O_RDWR)
> failed: Invalid argument (22) in C:\Program Files\Apache
> Group\Apache2\htdocs\SAMS\Chapter24\member.php on line 5
>
> I believe the problem is in my PHP setup and not the script. The Invalid
> arguement is the trigger for the config error to be initaited but I am
> not sure how to edit the php.ini file. I want to ensure that session are
> started when the server is started. I am also unsure of  the function
> and terminology of
>
> session.save_handler
> files files
>
>
> with the use of "files". Is this the correct default. Also is this the
> correct session save path:
>
> session.save_path
> .c:/php/sessions/tmp .c:/php/sessions/tmp
>
>
> What is wrong, please help.
>
> Charlie
>



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




Re: [PHP] Would appreciate thoughts on session management

2002-11-12 Thread Charles Wiltgen
Justin French wrote...

> Well, you seem so sure it will work, so give it a go... I can't see how, but
> am totally willing to learn!
> 
> Have you got any info on invisible gets?

It's simple, which is one thing I like about it.  My submit.php looks like
this:



Then to send a new value for a variable, I just have link that looks like
.

-- Charles Wiltgen


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




Re: [PHP] displaying a TIFF file

2002-11-12 Thread Ernest E Vogelsinger
At 00:36 13.11.2002, Joseph Szobody said:
[snip]
>Folks... when I execute the following code, I get a big black nothing. I 
>think it's the right size, but all black. No image is showing up. What gives?
>
>
>Header("Content-type: image/tiff");
>
>$filename = image.tif
>$file = fopen("$filename",rb);
>fpassthru($file);
>fclose($file);
[snip] 

You get a syntax error, but the browser cannot display it due to the MIME
type. You need to quote the filename (would read "imagetif" if unquoted),
and put a semicolon after the assignment.

$filename = 'image.tif';
$file = fopen($filename,rb);  // don't need quotes here
if ($file) {  // should always check if the file exists
Header("Content-type: image/tiff");
fpassthru($file);
fclose($file);
}

Using this sequence will send the MIME header only if the file is available
and could be opened.


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] File Upload problem

2002-11-12 Thread Ernest E Vogelsinger
At 00:25 13.11.2002, Van Andel, Robert said:
[snip] 
>encType=multipart/form-data>name=MAX_FILE_SIZE> 
>
> }
>?>
>When I submit the form at the bottom of the script, the $user_file variable
>equals "none".  I am unable to figure out what is going on.  The variable
>$users_file_name lists the file's name, but the $user_file is none and the
>$user_file_size =0. 
> 
>Why is $user_file equal to none?  Any help will be greatly appreciated. 
[snip] 

Try to use the name $users_file and $users_file_size (note the 's' after user).
Just in case that was no typo in your message...


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




RE: [PHP] Can you read a parsing PHP page's results

2002-11-12 Thread John W. Holmes
> Is there anyway at all of reading the results of a parsing PHP page
from
> within that same PHP page itself. In other words can you read the HTML
> code
> it's going to create. I know that you can use regular expressions to
parse
> the HTML page manually swapping variable content as you would with
most
> any
> template system... I guess I am asking if you can get the results of
an
> echo
> statement. If I had to write it in pseudo code it would be this:
> 
> $htmlCode = echo $myPHPcontent;
> 
> I find it highly unlikely but I thought I'd toss it out to those who
know.

You can do it with output buffering. 

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

---John Holmes...



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




[PHP] displaying a TIFF file

2002-11-12 Thread Joseph Szobody
Folks... when I execute the following code, I get a big black nothing. I think it's 
the right size, but all black. No image is showing up. What gives?


Header("Content-type: image/tiff");

$filename = image.tif
$file = fopen("$filename",rb);
fpassthru($file);
fclose($file);


Any help would be appreciated. Thanks.

Joesph


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




[PHP] Can you read a parsing PHP page's results

2002-11-12 Thread Colin Kettenacker
Is there anyway at all of reading the results of a parsing PHP page from
within that same PHP page itself. In other words can you read the HTML code
it's going to create. I know that you can use regular expressions to parse
the HTML page manually swapping variable content as you would with most any
template system... I guess I am asking if you can get the results of an echo
statement. If I had to write it in pseudo code it would be this:

$htmlCode = echo $myPHPcontent;

I find it highly unlikely but I thought I'd toss it out to those who know.

TIA,

ck

PS: I am a newbie who genuinely for the past hour has searched the archives,
the manual and tried writing several scripts to make this work with no
success. Forgive me if I missed something obvious.


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




[PHP] File Upload problem

2002-11-12 Thread Van Andel, Robert
I am having issues uploading a file.  I am trying to up load a file from my
computer to the server so taht I can run a mysql query using the load data
infile query.  here is the code



Remote File Name: $users_file";
echo "Local File Name: $users_file_name";
echo "Local File Size: $users_file_size";
if (isset($users_file_type))
{
echo "Local File Type: $users_file_type"; 
}

// Change $doc_directory to your 'DocumentRoot'.
$doc_directory = "/www/www.linuxguruz.org/htdocs/";
$my_file = "tmp/uploaded-".$users_file_name;
$copy_path = $doc_directory.$my_file;

if ($users_file != "none")
{
$query = "LOAD DATA LOCAL INFILE '$users_file' ";
$query .= "INTO TABLE `nrb_test` ";
$query .= "FIELDS TERMINATED BY ',' ENCLOSED BY '\"'
ESCAPED BY '' ";
$query .= "LINES TERMINATED BY '\r\n' ";
$query .= "IGNORE 1 LINES";

echo "$query\n";

if(!$result = mysql_query($query))
{
echo "File upload failed!";
}
else
{
?>Upload
Complete!You must select a file to upload!"; ?>
Back
to the Upload Form










When I submit the form at the bottom of the script, the $user_file variable
equals "none".  I am unable to figure out what is going on.  The variable
$users_file_name lists the file's name, but the $user_file is none and the
$user_file_size =0. 
 
Why is $user_file equal to none?  Any help will be greatly appreciated. 



 "The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers." 





Re: [PHP] Problem with sessions

2002-11-12 Thread Ernest E Vogelsinger
At 00:19 13.11.2002, Charlie Fowler said:
[snip]
>.c:/php/sessions/tmp .c:/php/sessions/tmp
>
>open(.c:/php/sessions/tmp\sess_fa42372dcdbde0e457309f134d71827f, O_RDWR) 
>failed: Invalid argument (22) in C:\Program Files\Apache 
>Group\Apache2\htdocs\SAMS\Chapter24\member.php on line 5
[snip] 

I believe the dot before the "c:" is the culprit. Remove it, restart Apache
and retry.


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] Query problem

2002-11-12 Thread rija
error_reporting() ;

  1 E_ERROR
  2 E_WARNING
  4 E_PARSE
  8 E_NOTICE
  16 E_CORE_ERROR
  32 E_CORE_WARNING
  64 E_COMPILE_ERROR
  128 E_COMPILE_WARNING
  256 E_USER_ERROR
  512 E_USER_WARNING
  1024 E_USER_NOTICE


- Original Message -
From: "Cesar Aracena" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Wednesday, November 13, 2002 9:35 AM
Subject: Re: [PHP] Query problem


> The problem is that I have a remote "rented" server and I don't have
access
> to these configurations
>
> any other ideas are welcome. Thanks
>
> any ot
>
> - Original Message -
> From: "BigDog" <[EMAIL PROTECTED]>
> To: "Cesar Aracena" <[EMAIL PROTECTED]>
> Cc: "PHP General" <[EMAIL PROTECTED]>
> Sent: Tuesday, November 12, 2002 11:51 AM
> Subject: Re: [PHP] Query problem
>
>
> > In your php.ini file you can turn on all the errors have have them
> > displayed...
> >
> > I would suggest doing that and you should see some errors if there are
> > any.
> >
> > Have you verified that dates in the database via mysql command line or
> > gui application.
> >
> >
> > On Tue, 2002-11-12 at 21:27, Cesar Aracena wrote:
> > > Hi all,
> > >
> > > I came back from vacations and forgot some things about queries... can
> > > anyone tell me what is wrong with this? of all the error messages I
set
> up
> > > in the script, none comes back on the page but the record is not
> saved...
> > >
> > >  > >
> > > $db = mysql_connect("www.icaam.com.ar", "icaam", "");
> > > if (!$db)
> > > {
> > >  die("No se pudo abrir la base de datos");
> > > }
> > >
> > > $ok = mysql_select_db("icaam");
> > > if(!$ok)
> > > {
> > >  die("No se pudo acceder a la base de datos");
> > > }
> > >
> > > $borndate = $bornd . $bornm . $borny;
> > > $phonenumber = $phone;
> > >
> > > $query = "INSERT INTO mararegistro (visitorid, fname, lname, borndate,
> > > address, city, country, phone, how) VALUES (null, 'c', 'c', 12, 'c',
> 'c',
> > > 'c', 12, 'c')";
> > > $result = mysql_query($query) or die (mysql_errno());
> > > if (mysql_affected_rows() != 1)
> > > {
> > >  die("Fallo al guardar datos");
> > > }
> > >
> > > echo "Gracias por administrarnos su información.";
> > >
> > > ?>
> > >
> > > Any thiughts? Thanks in advance,
> > >
> > > Cesar
> > --
> > .: B i g D o g :.
> >
> >
> >
>
>
> --
> 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] Problem with sessions

2002-11-12 Thread Charlie Fowler
Hi all,,

Can some one help me with this little issue ... I am trying out some 
prewritten scripts curtesy of SAMS PHP and MYSQL Web Development, Ch24 - 
User Authenication & Personalisation on my server setup

The Configuartion for my development environment is Apache 2.39, Win 
2000, PHP 4.2.3

The Ini file has the following session settings (as taken from PHPInfo.php):


   session

Session Support enabled


Directive Local Value Master Value
session.auto_start
Off Off
session.cache_expire
180 180
session.cache_limiter
nocache nocache
session.cookie_domain
no value no value
session.cookie_lifetime
0 0
session.cookie_path
/ /
session.cookie_secure
Off Off
session.entropy_file
no value no value
session.entropy_length
0 0
session.gc_maxlifetime
1440 1440
session.gc_probability
1 1
session.name
PHPSESSID PHPSESSID
session.referer_check
no value no value
session.save_handler
files files
session.save_path
.c:/php/sessions/tmp .c:/php/sessions/tmp
session.serialize_handler
php php
session.use_cookies
On On
session.use_trans_sid
0 0


The error occurs after the registration page is submitted with the 
following using the function session_start() on the register page.:

Warning: 
open(.c:/php/sessions/tmp\sess_fa42372dcdbde0e457309f134d71827f, O_RDWR) 
failed: Invalid argument (22) in C:\Program Files\Apache 
Group\Apache2\htdocs\SAMS\Chapter24\member.php on line 5

I believe the problem is in my PHP setup and not the script. The Invalid 
arguement is the trigger for the config error to be initaited but I am 
not sure how to edit the php.ini file. I want to ensure that session are 
started when the server is started. I am also unsure of  the function 
and terminology of

session.save_handler
files files


with the use of "files". Is this the correct default. Also is this the 
correct session save path:

session.save_path
.c:/php/sessions/tmp .c:/php/sessions/tmp


What is wrong, please help.

Charlie


Re: [PHP] Would appreciate thoughts on session management

2002-11-12 Thread Justin French
Well, you seem so sure it will work, so give it a go... I can't see how, but
am totally willing to learn!

Have you got any info on invisible gets?


Justin French

Creative Director
http://Indent.com.au
Web Developent & 
Graphic Design



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




Re: [PHP] Query problem

2002-11-12 Thread Ernest E Vogelsinger
At 23:35 12.11.2002, Cesar Aracena said:
[snip]
>The problem is that I have a remote "rented" server and I don't have access
>to these configurations
>
>any other ideas are welcome. Thanks
>
>any ot
>
>- Original Message -
>From: "BigDog" <[EMAIL PROTECTED]>
>
>> In your php.ini file you can turn on all the errors have have them
>> displayed...
[snip] 

You may always do two things to spot any error like this:

a) set error_reporting to a value where the error will be shown, e.g.
   "error_reporting(E_ALL | ~E_NOTICE);"
   This will override the INI file for the script instance

b) cluster your code with "echo" statements to see the value of certain
variables.


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




RE: [PHP] Mcrypt Under IIS 5 / Win32?

2002-11-12 Thread Nick Richardson
Still having problems getting mcrypt to work under Windows.  But I think
I have narrowed it down to me not having the correct version of
php_mcrypt.dll.

I downloaded the source for PHP and attempted to compile this myself,
but can not get it to work.  If anyone has any information about where I
can get a current php_mcrypt.dll or how I can compile it from the php
source (and don’t say google, because I've been there already), please
let me know.

I'm about to lose my mind!!

Thanks!
//Nick

-Original Message-
From: Nick Richardson [mailto:esoteric.web@;gte.net] 
Sent: Tuesday, November 12, 2002 12:18 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32?


I'm trying to load it via php.ini w/ extension=php_mcrypt.dll and
php_mcrypt.dll is in the extension_dir - When php_mcrypt.dll is not in
the right place, it tells me it can't load the dll.

Is there something other than the cygwin1.dll and php_mcrypt.dll that I
have to install on the system - all the documentation (what little there
is that I have found) has said that I don't need anything other than
these 2 files.

-Original Message-
From: Ray Hunter [mailto:rhunter@;venticon.com] 
Sent: Monday, November 11, 2002 12:48 PM
To: Nick Richardson
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32?


Basically, 

Are you loading the dll via the file or php?  Make sure that the
directory(s) where the dlls are located are in your windows path.

If that doesnt work then you can always put the dll in your systems dll
directory...


On Mon, 2002-11-11 at 19:58, Nick Richardson wrote:
> Ok, another question if you can help.
> 
> I have (I think) all the components I need (cygwin1.dll,
> php_mcrypt.dll, etc...).  Php_mcrypt.dll is in the PHP dir, everything

> else is in %windir%.
> 
> When I try to use any of the mcrypt stuff now, I get:
> 
> PHP Warning: Unable to load dynamic library './php_mcrypt.dll' - The
> specified procedure could not be found. in Unknown on line 0
> 
> You have any idea what I might be doing wrong?
> 
> //Nick
> 
> -Original Message-
> From: .: B i g D o g :. [mailto:bigdog@;venticon.com]
> Sent: Monday, November 11, 2002 4:50 AM
> To: Nick Richardson
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32?
> 
> 
> You need to uncomment the dll in the php.ini file...do a search for it

> and then uncomment it or add it to the php.ini file...
> 
> That will load it...
> 
> *Note: i would add that directory to your path that contains the
> mcrypt dll or all dlls for php and the extension directory to...
> 
> 
> On Mon, 2002-11-11 at 19:42, Nick Richardson wrote:
> > Yes, there is a DLL for it, but getting PHP to know it is there is 
> > where I'm having the problem - I don?t know how to get PHP to under 
> > windows to do the equivalent of --with-mcrypt in configure under 
> > linux. - maybe I havn't registered the mcrypt dll's correctly or 
> > something like that... But I just can't get it to work.
> > 
> > Everytime I try to do it I get 'call to undefined function . '
> > 
> > //Nick
> > 
> > -Original Message-
> > From: .: B i g D o g :. [mailto:bigdog@;venticon.com]
> > Sent: Monday, November 11, 2002 4:37 AM
> > To: Nick Richardson
> > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: Re: [PHP] Mcrypt Under IIS 5 / Win32?
> > 
> > 
> > 
> > is there not a dll for mcrypt?
> > 
> > 
> > On Mon, 2002-11-11 at 19:34, Nick Richardson wrote:
> > > I asked this before, but didn't get a response.
> > > 
> > > Anyone out there have any experience a/o know where I can find
> > > information on getting the mcrypt functionality to work under 
> > > Win32
> -
> > > I have found a port of mcrypt for Win32, and also learned that you
> can
> > 
> > > compile it using cygwin - but I don?t know how to register mcrypt
> > > w/ PHP and 'turn on' the mcrypt* functions.
> > > 
> > > If anyone has any information or urls / how-tos it would be
> > > greatly appreciated!
> > > 
> > > Thanks!
> > > 
> > > //Nick Richardson
> > > // [EMAIL PROTECTED]
> > > 
> > > 
> > > ---
> > > Outgoing mail is certified Virus Free. Can McAfee do that? - Hell 
> > > NO! Checked by AVG anti-virus system (http://www.grisoft.com).
> > > Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
> > >  
> > --
> > .: B i g D o g :.
> > 
> > 
> > 
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > ---
> > Outgoing mail is certified Virus Free. Can McAfee do that? - Hell
> > NO!
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
> >  
> > 
> > 
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> --
> .: B i g D o g :.
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> ---
> Outgoing mail is certified Vir

Re: [PHP] Error Message

2002-11-12 Thread Ernest E Vogelsinger
At 23:23 12.11.2002, Ben C. said:
[snip]
>I am receiving the following error on my change password form:
>
>Warning: Cannot send session cache limiter - headers already sent (output 
>started at /home/httpd/vhosts/localhost/httpdocs/order/change_psswd.php:14) 
>in /home/httpd/vhosts/localhost/httpdocs/order/change_psswd2.php on line 4
>
>Does anyone have a clue as to why?
[snip] 

You are opening your session with a specific cache-limiter. This requires
the server to transmit two MIME headers to the client.
header('Cache: none');
header('Pragma: No Cache');

Headers can only be sent _before_ any data gets flushed to the client. In
your source file (change_passwd.php on line 14) some MIME message body data
(web page content) has already been generated and transmitted to the
client, therefore no headers can be sent anymore.

Remedy:

1) don't send data before you're done with the headers, or
2) Use output buffering (ob_start(), ob_end_flush()) to avoid data being
transmitted prematurely.


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] PHP HTTP Forwarding / Port Translation

2002-11-12 Thread Ernest E Vogelsinger
At 23:00 12.11.2002, Mike MacDonald said:
[snip]
>Hi People ! (Diagram below in text)

Hi! I like your graphics, esp. the folded corner ;-)

>I'm interested in thoughts on how to effect the equivalent of Router 
>Network Address Translation for a PHP page.
>
>The feature that are important are:
> o Can process forms
> o Can pass images
> o Can manage relative HREFs
> o Least invasive to the end user
>
>I've tried PHP Proxy and it works fine for basic pages but Scott 
>thinks that it needs work to do forms.
>
>Along with this I'm just wondering if we can intercept the header at a 
>low
>level and just simply rewrite the port  -- or is this dumb thinking?

I'd either go with a _real_ NAT on the proxy host, or, if I must use PHP
for whatever reason (which will be slower than a kaernel-based NAT) I'd
think of using CUrl to transparently handle post data as well as URI-based
queries.

One last word - I hope the forms you are targetting remotely are your
own... "handling" foreign forms and web pages could be interpreted as
stealing; one might easily get into a copyright violation.


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] RE: Why $ on variable names?

2002-11-12 Thread Ernest E Vogelsinger
At 22:56 12.11.2002, Joel Boonstra said:
[snip]
>All I know is when I think back to programming C++, I can't imagine how
>I could deal with variables that didn't have something in front of them
>to separate them from barewords.
[snip] 

esp. in C++ you usually tend to use your own prefixes - something like 'm_'
for member variables, '_' for statics or locals, etc. It even goes further
using the hungarian notation (which I'm a great fan of).


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] phpMyAdmin please help

2002-11-12 Thread Iguider
Hi
thanks a lot John Nichel and Stephan , I understand now. I put blank in
password and it works.
thanks.
but after that in the next day (as I said my previous email) : Mysql stop
working and shows  : "Host 'localhost' is not allowed to connect to this
MySQL server"

thanks for help

- Original Message -
From: "John Nichel" <[EMAIL PROTECTED]>
To: "Iguider" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Tuesday, November 12, 2002 12:20 AM
Subject: Re: [PHP] phpMyAdmin please help


> See below
>
> Iguider wrote:
> > in my dtabase.php :
> > $dbHost = "";
> > $dbUser = "Amazigh";
> > $dbPassword = "mcamca";
> > $dbName = "Forum";
> > $db = mysql_connect($dbHost, $dbUser, $dbPassword);
> > mysql_select_db($dbName, $db);
>
> $dbHost is empty.  If the script is on the same machine as the MySQL db,
> set it to "localhost".  If the script is on a different machine, set it
> to the name of that machine (and make sure that your $dbUser has rights
> to access the database remotly).  MySQL usernames and passwords are case
> sensitive.
>
> > and in phpMyAdmin's config.inc.php :
> >
> > $cfgServers[$i]['user']  = 'root';  // MySQL user
> > $cfgServers[$i]['password']  = '';  // MySQL password
>
> If you have a root password, fill it in.  Seeing that it won't let you
> connect via phpMyAdmin, the db probably has a root password.
>
> > - Original Message -
> > From: "Stephen" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Cc: "PHP List" <[EMAIL PROTECTED]>
> > Sent: Monday, November 11, 2002 10:14 PM
> > Subject: Re: [PHP] phpMyAdmin please help
> >
> >
> >
> >>You may also want to check your forum's database.php after checking the
> >>phpMyAdmin's config.inc.php.
> >>
> >>
> >>- Original Message -
> >>From: "John Nichel" <[EMAIL PROTECTED]>
> >>To: "Iguider" <[EMAIL PROTECTED]>
> >>Cc: <[EMAIL PROTECTED]>
> >>Sent: Monday, November 11, 2002 4:47 PM
> >>Subject: Re: [PHP] phpMyAdmin please help
> >>
> >>
> >>
> >>>Look at the "config.inc.php" file in the phpMyAdmin install directory.
> >>>
> >>>Iguider wrote:
> >>>
> Hi
> I have a furom working under php 4.0  and when I upgrade it to php 4.2
> >>>
> >>by installing the new version of easyphp 1.6.0.0 . the new phpMyAdmin is
> >>2.2.6 .
> >>
> when I run the forum or I tried to re-create a tables in mySQL
> >>>
> > database
> >
> >>with a install.php it shows me the following errors :
> >>
> Warning: Unknown MySQL Server Host 'mySQL' (22) in e:\program
> >>>
> >>files\easyphp\www\forum\database.php on line 7
> >>
> Warning: MySQL Connection Failed: Unknown MySQL Server Host 'mySQL'
> >>>
> > (22)
> >
> >>in e:\program files\easyphp\www\forum\database.php on line 7
> >>
> Warning: mysql_select_db(): supplied argument is not a valid
> >>>
> > MySQL-Link
> >
> >>resource in e:\program files\easyphp\www\forum\database.php on line 8
> >>
> are there in phpMyAdmin where to give a database username and password
> >>>
> > ?
> >
> >>when I copy the old database and i try to start the forum it shows me
> >
> > "acces
> >
> >>denied to  name@localhost  (password : ok) ".
> >>
> Please help
> 
> 
> 
> 
> >>>
> >>>
> >>>--
> >>>By-Tor.com
> >>>It's all about the Rush
> >>>http://www.by-tor.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
> >>
> >>
> >>__
> >>Modem offert : 150,92 euros remboursés sur le Pack eXtense de Wanadoo !
> >>Haut débit à partir de 30 euros/mois : http://www.ifrance.com/_reloc/w
> >
> >
> >
> > __
> > Modem offert : 150,92 euros remboursés sur le Pack eXtense de Wanadoo !
> > Haut débit à partir de 30 euros/mois : http://www.ifrance.com/_reloc/w
> >
> >
>
>
> --
> By-Tor.com
> It's all about the Rush
> http://www.by-tor.com
>
>
> __
> Modem offert : 150,92 euros remboursés sur le Pack eXtense de Wanadoo !
> Haut débit à partir de 30 euros/mois : http://www.ifrance.com/_reloc/w



__
Modem offert : 150,92 euros remboursés sur le Pack eXtense de Wanadoo ! 
Haut débit à partir de 30 euros/mois : http://www.ifrance.com/_reloc/w


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




RE: [PHP] Why $ on variable names?

2002-11-12 Thread Ernest E Vogelsinger
At 22:40 12.11.2002, Jonathan Rosenberg \(Tabby's Place\) said:
[snip]
>I guess this could be true.  But I don't understand why someone would need
>an "easy" way to identify variables?  Why not an easy way to identify
>function names?  Or constants?
>
>In any case, I don't recall anyone complaining that they had trouble
>"identifying variables" in C, C++, Modula, Pascal, Java, etc.
[snip] 

Quite right. But, having developed a couple of interpreters myself, I
assume there's some sound reason.

Think of how an interpreter works. It parses the sourcecode in realtime,
not as a compiler. People must _wait_, every time, until it is finished,
not only once like a compiler. Thus designers of interpreted languages like
something that can easily be distinguished, so you don't need to lookup a
lot of hash tables to identify a symbol, or to resolve amiguities.

That's why the '$' preceds a variable name. Simply said, when the parser
sees a '$', it knows which symbol table to look it up. If a token doesn't
have a '$', it can be found in the table of keywords of the language's
state machine.

Easy explanation, huh? Simple example: taken that a PHP application
consists of 1000 tokens, 200 of the tokens are variable names, and 800
non-variable tokens, the interpreter would either 200 times look up the
wrong symbol table (if it chooses to lookup the keywords first), or 800
times (if it looks up the entity table first).

Simply saves time...

-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




RE: [PHP] Query problem

2002-11-12 Thread Davy Obdam
Hi Cesar,

> Hi all,
> 
> I came back from vacations and forgot some things about 
> queries... can anyone tell me what is wrong with this? of all 
> the error messages I set up in the script, none comes back on 
> the page but the record is not saved...

Dont we all forget 'things' after vacations eh? ;-)
I think you forgot a ' somewhere...

$query = "INSERT INTO mararegistro (visitorid, fname, lname, 
 borndate, address, city, country, phone, how) VALUES (null, 
'c', 'c', '12', 'c', 'c', 'c', 12, 'c')";

You forgot to put single qoutes around 12. Now it should work

Best regards,
 
Davy Obdam
mailto:info@;davyobdam.com




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




Re: Re: [PHP] Error Message

2002-11-12 Thread Kevin Stone
You must do session_start() before any output.  You can get around this with
output buffering.  ob_start(); ob_end_clean();
-Kevin

- Original Message -
From: "Ben C." <[EMAIL PROTECTED]>
To: "Adam Williams" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, November 12, 2002 3:35 PM
Subject: Re: Re: [PHP] Error Message


> I am using the require() function.
>
>  - 1st require() includes the top portion of my page on every page.
>
>  - 2nd require puts the following code in the middle:
> 
>  require("fns.php");
>  session_start();
>
>  if (!filled_out($HTTP_POST_VARS))
>  {
>echo "You have not filled out the form completely.
>  Please try again.";
> exit;
>  }
>  else
>  {
> if ($new_passwd!=$new_passwd2)
>echo "Passwords entered were not the same.  Not changed.";
> else if (strlen($new_passwd)>16 || strlen($new_passwd)<6)
>echo "New password must be between 6 and 16 characters.  Try
again.";
> else
> {
> // attempt update
> if (change_password($valid_user, $old_passwd, $new_passwd))
>echo "Password changed.";
> else
>echo "Password could not be changed.";
> }
>
>
>  }
>
> ?>
>
>  - 3rd require() includes the top portion of my page on every page.
>
> Does this help you understand???
>
> Thanks, Ben
>
>
> >
> > From: Adam Williams <[EMAIL PROTECTED]>
> > Date: 2002/11/12 Tue PM 05:26:09 EST
> > To: "Ben C." <[EMAIL PROTECTED]>
> > CC: <[EMAIL PROTECTED]>
> > Subject: Re: [PHP] Error Message
> >
> > are you using header() after you've already sent data to the browser
(such
> > as printing something to the user)?
> >
> > Adam
> >
> > On Tue, 12 Nov 2002, Ben C. wrote:
> >
> > > I am receiving the following error on my change password form:
> > >
> > > Warning: Cannot send session cache limiter - headers already sent
(output started at
/home/httpd/vhosts/localhost/httpdocs/order/change_psswd.php:14) in
/home/httpd/vhosts/localhost/httpdocs/order/change_psswd2.php on line 4
> > >
> > > Does anyone have a clue as to why?
> > >
> > > Please help!
> > >
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



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




Re: [PHP] Query problem

2002-11-12 Thread rija
$query = "INSERT INTO mararegistro (visitorid, fname, lname, borndate,
address, city, country, phone, how) VALUES (null, 'c', 'c', '12', 'c', 'c',
'c', '12', 'c')";

I think you should put quotes around all of these values 12 exept null or
change null to '' ///


- Original Message -
From: "Cesar Aracena" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Wednesday, November 13, 2002 8:27 AM
Subject: [PHP] Query problem


> Hi all,
>
> I came back from vacations and forgot some things about queries... can
> anyone tell me what is wrong with this? of all the error messages I set up
> in the script, none comes back on the page but the record is not saved...
>
> 
> $db = mysql_connect("www.icaam.com.ar", "icaam", "");
> if (!$db)
> {
>  die("No se pudo abrir la base de datos");
> }
>
> $ok = mysql_select_db("icaam");
> if(!$ok)
> {
>  die("No se pudo acceder a la base de datos");
> }
>
> $borndate = $bornd . $bornm . $borny;
> $phonenumber = $phone;
>
> $query = "INSERT INTO mararegistro (visitorid, fname, lname, borndate,
> address, city, country, phone, how) VALUES (null, 'c', 'c', 12, 'c', 'c',
> 'c', 12, 'c')";
> $result = mysql_query($query) or die (mysql_errno());
> if (mysql_affected_rows() != 1)
> {
>  die("Fallo al guardar datos");
> }
>
> echo "Gracias por administrarnos su información.";
>
> ?>
>
> Any thiughts? Thanks in advance,
>
> 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: Re: [PHP] Error Message

2002-11-12 Thread Ben C .
I am using the require() function.  

 - 1st require() includes the top portion of my page on every page. 

 - 2nd require puts the following code in the middle:
16 || strlen($new_passwd)<6)
   echo "New password must be between 6 and 16 characters.  Try again.";
else
{
// attempt update
if (change_password($valid_user, $old_passwd, $new_passwd))
   echo "Password changed.";
else
   echo "Password could not be changed.";
}


 }

?>

 - 3rd require() includes the top portion of my page on every page. 

Does this help you understand???

Thanks, Ben


> 
> From: Adam Williams <[EMAIL PROTECTED]>
> Date: 2002/11/12 Tue PM 05:26:09 EST
> To: "Ben C." <[EMAIL PROTECTED]>
> CC: <[EMAIL PROTECTED]>
> Subject: Re: [PHP] Error Message
> 
> are you using header() after you've already sent data to the browser (such
> as printing something to the user)?
> 
>   Adam
> 
> On Tue, 12 Nov 2002, Ben C. wrote:
> 
> > I am receiving the following error on my change password form:
> >
> > Warning: Cannot send session cache limiter - headers already sent (output started 
>at /home/httpd/vhosts/localhost/httpdocs/order/change_psswd.php:14) in 
>/home/httpd/vhosts/localhost/httpdocs/order/change_psswd2.php on line 4
> >
> > Does anyone have a clue as to why?
> >
> > Please help!
> >
> >
> >
> 
> 
> -- 
> 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] Query problem

2002-11-12 Thread Cesar Aracena
The problem is that I have a remote "rented" server and I don't have access
to these configurations

any other ideas are welcome. Thanks

any ot

- Original Message -
From: "BigDog" <[EMAIL PROTECTED]>
To: "Cesar Aracena" <[EMAIL PROTECTED]>
Cc: "PHP General" <[EMAIL PROTECTED]>
Sent: Tuesday, November 12, 2002 11:51 AM
Subject: Re: [PHP] Query problem


> In your php.ini file you can turn on all the errors have have them
> displayed...
>
> I would suggest doing that and you should see some errors if there are
> any.
>
> Have you verified that dates in the database via mysql command line or
> gui application.
>
>
> On Tue, 2002-11-12 at 21:27, Cesar Aracena wrote:
> > Hi all,
> >
> > I came back from vacations and forgot some things about queries... can
> > anyone tell me what is wrong with this? of all the error messages I set
up
> > in the script, none comes back on the page but the record is not
saved...
> >
> >  >
> > $db = mysql_connect("www.icaam.com.ar", "icaam", "");
> > if (!$db)
> > {
> >  die("No se pudo abrir la base de datos");
> > }
> >
> > $ok = mysql_select_db("icaam");
> > if(!$ok)
> > {
> >  die("No se pudo acceder a la base de datos");
> > }
> >
> > $borndate = $bornd . $bornm . $borny;
> > $phonenumber = $phone;
> >
> > $query = "INSERT INTO mararegistro (visitorid, fname, lname, borndate,
> > address, city, country, phone, how) VALUES (null, 'c', 'c', 12, 'c',
'c',
> > 'c', 12, 'c')";
> > $result = mysql_query($query) or die (mysql_errno());
> > if (mysql_affected_rows() != 1)
> > {
> >  die("Fallo al guardar datos");
> > }
> >
> > echo "Gracias por administrarnos su información.";
> >
> > ?>
> >
> > Any thiughts? Thanks in advance,
> >
> > Cesar
> --
> .: B i g D o g :.
>
>
>


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




[PHP] phpMyAdmin 2.2.6

2002-11-12 Thread Iguider
Hi
I am running normally a phpMyAdmin 2.2.6, until yesterday it shows me :
Host 'localhost' is not allowed to connect to this MySQL server

please help




  1   2   3   >