Re: [PHP] htmlentities()

2007-11-17 Thread Ludovic André

Hi,

I tried to understand htmlentities by putting this code into a test.php:

[...]

The output on the screen is:

field1=*Greater input and lower input*
field2=bGreater input and lower input/b

bGreater input and lower input/b

A 'quote' is bbold/b
A 'quote' is bbold/b


I expected that it would give me in the second line:
field2=lt;bgt;Greater input and lower inputlt;/bgt;

and the lower two lines I expected as:

A 'quote' is lt;bgt;boldlt;/bgt;
A #039;quote#039; is lt;bgt;boldlt;/bgt;


What do I miss understand here


did you try to 'view-source' the page ?

--
Ludovic André

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



Re: [PHP] Not quite OT but maybe close... Help with MySQL

2007-08-08 Thread Ludovic André

Hi,

Jason Pruim a écrit :
I tried asking this question on the MySQL list but haven't gotten very 
many helpful responses... Does anyone know how to successfully import 
a excel file into MySQL (To make it on topic) Using PHP? I have tried 
using LOAD FILE in mysql and it just imports the first row of my excel 
file with no errors...
You will need to convert your Excel file to a CSV format (or a similar 
text file with a separator for the different fields - which you'll 
specify later on) before trying to import with the LOAD DATA INFILE 
functionnality of MySQL.


Doc: http://dev.mysql.com/doc/refman/5.0/en/load-data.html

Ludo

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



Re: [PHP] upload temp dir in vhost env.

2007-08-26 Thread Ludovic André

Hi,

that's not a problem to specify where the uploaded file has to be moved 
after upload.  As you specify for each user a personal directory in the 
system, you just need to use a function like move_uploaded_file() to 
move the uploaded file to this directory.  Each uploaded file goes to, 
let's say, /tmp (the directory specified in your php config), and 
inherits from a unique filename.  This filename is contained in the 
$_FILES array available in the script which handles the upload. So if 
you have a form containing a file upload field called file, you can 
retrieve the filename of the newly uploaded file using: 
$_FILES['file']['tmp_name'] (if the upload went successfully).

You can then simply use:
move_uploaded_file( $_FILES['file']['tmp_name'], 
'/path/to/user/personal/dir');


This will work even if multiple users are uploading a file at the same 
time, as the $_FILES array will contain the info related to a single user.


I hope I've been clear enough...

Ludo

Hello again;

I have a question about  upload temp dir as defined in php.ini;

I have been working on a project that has registered users, each having
a user space portion of the web site file system. I want them to be
able to upload images and such and have the stuff transfered to their
own user spaces. With one up load temp dir designated, how do I
insure that the uploaded files get to the correct destination?
Or, is it possible to designate more than one up load temp dir in
php.ini. (that would be the best solution)
This situation is not a virtual host environment, but one site that
will be using ssl.
I am using Apache on unix based host and am aware that php
assigns a temp name to files that are uploaded, but if different
users are uploading files concurrently, there could be a confusion
as to where each file should be transfered to.
I do not know where else to look for an answer to this question
at present.
Any knowledgeable response appreciated.
Thanks in advance:
Jeff K.



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



Re: [PHP] A simple PHP script to generate a Pie Chart based on SQL query

2007-08-27 Thread Ludovic André



I am looking for a simple PHP script that can generate Pie Chart based
on SQL query resultset.
  

http://www.aditus.nu/jpgraph/

This lib works great!

Ludo

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



Re: [PHP] PhP / MySQL problem

2007-08-29 Thread Ludovic André



Hi,

I created a form asking username, password, country, etc.
On the submit of this form I make a sql connection and update the database,
add the user.

The problem is that whenever the field 'password' is filled in,
it (I don't know what) is asking to confirm the change of the password.

I made a printscreen to clarify :

http://matthew16.free.fr/sql.jpg

This is what I get when I try to submit the form and I filled in field
password.
The users displayed in the pop-up are the MySQL users.
This has nothing to do with your PHP/MySQL, but it's a feature of your 
browser (you're using Firefox, aren't you?)
Did you use the functionnality remember the password ? If so, then the 
users listed here are the ones for whom you wanted to remember the 
password. Firefox tries to be smart in this case: if you're updating the 
password, it asks you which user has changed...


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



Re: [PHP] Perhaps an incomplete $_POST

2007-08-29 Thread Ludovic André
Yep, the form name is never submitted with the form info.  However, the 
submit button will be submitted along.
So, as an alternative, you could name the submit button in a way to 
recognize the submitted form:

form name=foo
...
input type=submit name=fooSubmitBtn ...
/form

Ludo

To the best of my knowledge, the name attribute of the FORM tag is
never submitted with the request, whether it be GET or POST. It's
there for client-side scripting (JavaScript, etc.) only.

One trick that might help you - if your form action is POST, add a
querystring to the action, something like foo.php?formname=foo, then
check $_GET['formname']. Of course, it might be just as easy to drop
in a hidden input instead.

Hope this helps.

On 8/29/07, Jay Blanchard [EMAIL PROTECTED] wrote:
  

I just noticed something a little odd, and maybe there is a simple
solution. Given a form;

form name=foo action=foo.php method=POST

The attributes, especially the name foo, never appear in any variables
array. I am thinking that this might be handy to have for several
reasons when processing the form. I have several reasons for needing the
information, does anyone know how to get this in the processing script
without having to add hidden fields or do some Ajax magic?



  


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



Re: [PHP] mail() silly question

2007-09-01 Thread Ludovic André

Hi,

Question:

Why? What's the real difference between
   $header .= 'From: [EMAIL PROTECTED]' . \r\n;
and
   $header .= 'From: [EMAIL PROTECTED];

Your second declaration is incorrect: you start with a single quote ('), 
and you end with a double ().


So, you'd say ok, let's fix it:
$header .= 'From: [EMAIL PROTECTED]';

BUT, special chars like \n or \r need to be inside a double-quoted 
string in order to be taken into account.


This one is then correct:
$header .= 'From: [EMAIL PROTECTED]' . \r\n;

This one as well:
$header .= From: [EMAIL PROTECTED];


Ludovic André

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



Re: [PHP] remove page referrer

2007-09-11 Thread Ludovic André

Hi,
You can not control this, but you might be able to control the page 
where the user is going back through the third page :)


like this:

page 1: submit to page 2
page 2: header('Location: /page 3');
page 3: the final page

if the user clicks back he is going to end up on page 2 which has 
location redirect to page 3. True?

Nope, this ain't true: if he goes back, he'll land on page 1.


-Xander


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



Re: [PHP] problem with foreach

2007-10-22 Thread Ludovic André

Adam Williams a écrit :

I have an html page with checkboxes:
[...]
but I'm getting the error:

you selected:

*Warning*: Invalid argument supplied for foreach() in 
*/var/www/sites/mdah-test/museum/mmhsurvey/mailform2.php* on line *81*


I googled some checkbox/foreach pages on google, but I don't see where 
I'm going wrong.  I'm running php 5.2.5 on Apache 2.2.4 on Fedora 
Linux.  Any help?


Simple question: did you check any of the boxes before submitting? If 
not, then it's the reason of this error...  The array does not appear in 
the posted variables as a not-checked checkbox is not submitted along.
But all the other comments of this thread are to be taken into account 
as well ( $_POST['option'], trying to print_r($_POST), ...)


Ludovic André

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



Re: [PHP] Class Load twice

2008-05-31 Thread Ludovic André

Hi,

I just do not want to load mail() when load.php is load.
if you know how to solove it, please teach me it!
  

I assume that the second file is named 'load.php' ?
Then you should just comment the line starting with mail(... in MyClass.php
So:

*MyClass.php***
?php
$objRef=new MyClass(hui7gutWSFrh6zt);
$objRef-buff();
//mail([EMAIL PROTECTED],test,test);
class MyClass{
 Private $google;
 function __construct($googleKEY){
$this-google=$googleKEY;
}
public function buff(){
echo $this-google;
}
}

?

That was an easy one ;)


Best regards,

Ludovic André


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