[PHP] How PHP recover value from another frame?

2003-03-05 Thread M
Hello, I know probably this question already solved, but I couldnt find
msgs about.

I have page with two frames.

frameA is built by frameA.php and frameB is built by frameB.php scripts.

Into frameA is form variable named 'varA',  frameA.formA.varA.value =
'ok' . I know PHP knows this variable as '$varA' when frameA.php
executed.

The problem is I need execute frameB.php and recover frameA varA value
to decide some actions, BUT at PHP time, not at document time (since at
document time I can recover via javascript).

Is this possible?

Thanks

Mig


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



[PHP] How retrieve database data from email?

2002-08-15 Thread M

Hello People:

I have my pages built in PHP / Mysql, all working ok, but now I need
solve a problem I don't know how to solve or even how search about. Case
this problem was already discussed in this list, I would be grateful if
someone pass to me correct date so I can search about.

My problem is very simple: I have customers who dont want enter into
html pages to retrieve some info (suppose info are stock values), but
rather they want to send email with formatted query into mail subject
(or at least in body) , and then receive response again by email.

For instance, customer could send this for [EMAIL PROTECTED]

to: [EMAIL PROTECTED]
subject: name=ibm, year=2001
body: (empty)

In response, he should receive an email with all IBM stock prices day by
day.

That't all, I hope this will have solution, but I can't figure how email
could communicate automatically with PHP/Mysql.

Thanks

Miguel



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




[PHP] How to program very basic chat on PHP?

2002-09-07 Thread M

Hello, this question is about dynamic communication between browsers.

I have a site to meet people (PHP/Mysql).These people have their
profiles and pictures stored into the site.
I would like to make some kind of chat (very single chat), so when
people log into system, I can trace their nicknames and list all active
users onto some table.

When someone wants talk to any other listed person, he just click on
nick name, and some window will open on the other people browser's. This
way, a single chat between two users could be stablished easily.

Is this possible to program just using PHP?. I cant figure here how to
control remotely the other user's browse (open chat window for instance)
using only PHP.

Thanks for any help

Mig


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




Re: [PHP] How to program very basic chat on PHP?

2002-09-08 Thread M

"Philip J. Newman" wrote:

> You could create a scema, or module that is called with each page load, that
> checks for messages when the user is logged in.  So when the message is
> stored into the databace, when the user loads the anypage while logged in it
> checks for new messages, and if the user has messages then the window pops
> up and the user can eather reply etc etc
>
> Phil

Hello Phil, your idea is interesting. I am evaluating it because it is not a
true 'chat' (if user doesnt load any page he will never see incoming msg), but
your idea is the only thing I have to this time.

Thanks

Mig



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




Re: [PHP] How to program very basic chat on PHP?

2002-09-08 Thread M

timo stamm wrote:

> Hi Mig,
>
> to create something that behaves more like a true "chat", you
> need an active client side.
> For example, you could let a frame with the PHP be reloaded in a
> short interval.
>
> To create a real chat, you need a socket connection. The best
> solution would be Flash (which has great functions for that).
> Java is another option.
>
> Timo

Hello Timo, thanks very much. I don't know flash, but do you think Flash
5 has this option also?. I read a basic Flash manual and didn't find
some feature for 'sockets' or something else.
For Java, I know a very basic programming of it, I will try study more
of it to understand socket functions.

Thanks all of you for your responses.

Mig



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




Re: [PHP] How to program very basic chat on PHP?

2002-09-08 Thread M

Gerhard Hoogterp wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> > Hello Phil, your idea is interesting. I am evaluating it because it is not
> > a true 'chat' (if user doesnt load any page he will never see incoming
> > msg), but your idea is the only thing I have to this time.
>
> But with a frame or iframe and a little javascript the reloading can be
> automated..
>
> gerhard

Hello Gerhard, I had an idea, and would like  you say to me if it is possible or
not. I program little javascript, and I think there is a timer function into JS.

My question is: what if some timer start every nn seconds a function to read
stored msgs table?

My doubt is: how to start a function in JS to read a table?. Remember PHP and
Mysql are server-sided operations, while JS is cliente side op.

Maybe your idea is JS start a new window embedded into iframe, and this window
then would exec a PHP script to check msgs table.

Is this true?

Thanks

Mig



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




Re: [PHP] How to program very basic chat on PHP?

2002-09-09 Thread M

Justin French wrote:

> An extremely basic chat would be a frame or iframe which has a meta tag
> refresh (or javascript refresh) of a plain HTML page every 10-20 seconds.
>
> As far as the flash stuff goes, have a look at macromedia.com or the 1000's
> of flash sites... I'm positive you'll find some development tools for a
> pre-built chat room that you can modify.  I'm certain I got one of
> macromedia.com a few years back (flash 4 days i think).
>
> Justin

Hello Justin

Ok, you are right, I know it is possible to get complete chat services at free (just
install it in your page).

I think I forgot mention something. The reason I don't want use these services is
because I want people be able to retrieve info of my database when chatting.

Since I have profiles and pictures of people stored in databases, I want people
instantly getting these info through chat services.

For instance, when presenting list of chatters, just with a click you can see
picture and profile of that person.

This connection is impossible to stablish when using predefined chats, thats the
reason I want to make my own chat.

Thanks

Mig


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




[PHP] Why MySql doesn't free space when erasing BLOB fields?

2003-11-22 Thread M
Hello, sorry this mysql question here, but I cant't answer this one.

I have database with BLOB fields to hold pictures (60-90 kb each).
Actually I am erasing these BLOB fields (move '' into and update rcord)
to free some space from my DB, but space is not released by mysql. I
verified BLOB fields really were erased.

How can I tell mysql recover these space?

Thanks

Miguel

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



[PHP] About thumbnail functions

2002-02-12 Thread M

From:  "Torkil Johnsen" <[EMAIL PROTECTED]>
 Subject:   How do I check GD version?
To:   <[EMAIL PROTECTED]>

Cheers all...

This mail got rather long, so here are my 3 questions in a short
version:
1) What is GD? (fore use with imagecopyresampled function)
2) How can I run a function that will tell me what version of GD is
installed on my server, if any version at all?
3) Anyone know of some good hosts out there which has got all of this
under
control? (basically people who has a clue about what they're doing)



Hello Torkil

I face same problem. I tried to make a thumbnail function by analyzing
directly string of image, but this is not single task, specially for JPG
images. I also buy my site and pay monthly, but I prefer no to trust on
GD and other features because these people who sell sites often change
PHP features and disables/enables apache / mysql / php parameters
crashing entirely my sites. Then to convince them that they should
restart disabled features pass some weeks. My customers don't want to
know about these problems.

I still dream some clever people (and charitative one!) already
developed a function like $mythumb =
thumbnail($image,new-size,new-size)  then $mythumb will carry binary
string for image (no file names of course because my images are stored
into blob fields), and I hope someday to discover these function.

I often search for some C++ routine, so it could be translated to PHP,
but also none found.

It appears this dream is over. I will continue to work in this problem
as longer as I can.

Thanks

Mig



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




[PHP] How program automatic 'filler forms' robots?

2002-05-15 Thread M

Hello, I am interested on some info - how do robots  work to fill web
forms authomatically?
Sometimes I notice a blurr code to be manually writen to avoid these
robots when filling forms, but I am interested in programm just one of
these machines. Is it necessary PHP of another script for this task?

Thank for any info

Mig




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




Re: [PHP] How program automatic 'filler forms' robots?

2002-05-15 Thread M

"1LT John W. Holmes" wrote:

>
> You need to get a little more specific. Is this a specific form, or do you
> want to be able to post any form? What kind of script is processing the
> form? Is it looking for GET or POST data? GET data is as simple as creating
> a URL with the nec. fields. POST is a little harder, but just required you
> to send the appropriate headers with the data. "filling out a form" isn't
> much different than any other web request. The "data" just included in the
> URL or in the headers, and the "action" page of the form processes that
> data...

Hello John, thanks for your reply.

suppose this form into myurl.html (i will replace < and >  by [ and ] to avoid
unwanted url treatment into msgs)

[form]
[input type=text name=driver length=20]
[input type=text name=os length=20]
[/form]

I figured could open myurl.html already with filled values by calling

http://.../myurl.html?driver=midi&os=windows

but it appears not working. I regularly program PHP and pass url parameters in
this way to my php scripts successully.

My problem is as follow: there are many forms around web I will need fill
regularly with values at every week (or months). My idea is to create a
database with these web urls, containing all info needed to fill automatically
these forms. Probably will need to store info about these pages uses get or
post commands, I really don't know how to begin with.

At every week, I would call my PHP script and browse all these urls and
automatically fill values to call pages with values already filled. I even
don't know how my 'robot' could send button action commands to these forms.

Ok, thats all.

Thanks for any info on this subject.

Mig



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




Re: [PHP] How program automatic 'filler forms' robots?

2002-05-15 Thread M

"SHEETS,JASON (Non-HP-Boise,ex1)" wrote:

> You need to tell PHP to input the value and you should be using "'s
>
> example:
>
> 
>
> This example assumes you are using at least PHP 4.1, also you may use
> $_REQUEST instead of $_GET if you are going to be using both GET and POST
> methods.
>
> Jason

Hello Jason

Well, maybe I got little confusion by naming 'myurl.html' rather than
'yoursurl.html', because web pages I want to fill automatically are web pages
built by another people I have no contact with. For instance (it is not true,
but it worth like example), I want to fill automatically some creditcard page
with name, account , address and so. I want to program my script to fill exactly
that page, because I know that URL, I can peruse through that html source and
learn what name values are into form and I know exactly how that url treat those
names (get, post etc). The only problem is: I am obligued to call that url and
write manually all data.

Suppose I need to fill that web page thounsand times (to all my employers), then
I want to make some kind of script to call url passing parameters, in a way when
that page appears to me, it already has all fields filled with correct values (I
only would need to press the 'send' button). If possible, I would like to press
'send' button also automatically.

I know there are programs that perform this task, because I noticed some search
engines (ie altavista) ask you type some blurr code appearing as image, just to
avoid these robots fill automatically fields. Since robots can't read (for a
while) that blurr images, it is necessary a human to type that info.

Mig



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




[PHP] How creat image pointer from JPG/GIF string?

2002-04-09 Thread M

Hello, you know all GD functions work via image pointer , which appoints
to some file, or else empty image

$img_pointer = imagecreatefromjpeg("$image_file_name");

or

$img_pointer = imagecreate($width,$height);

I have stored lot of images into BLOB Mysql fields, and need recover it
to resize. How can I create some image pointer from string stored into
BLOB field?

Thanks

Miguel




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




Re: [PHP] How creat image pointer from JPG/GIF string?

2002-04-09 Thread M

Robert Cummings wrote:

> M wrote:
> >
> > I have stored lot of images into BLOB Mysql fields, and need recover it
> > to resize. How can I create some image pointer from string stored into
> > BLOB field?
> >
> > Thanks
> >
> > Miguel
>
> imagecreatefromstring() seems to be the candidate... however a comment
> attached to the help page indicates it is buggy. I suggest trying it out
> and if that fails then pull your image from the database, write to a
> temporary file, and then use imagecreatefromjpeg() as per usual.
>
> Cheers,
> Rob.

ops!, thanks Rob, it appears my PHP local manual is old version. I checked
around the net and really this function exists. I am going to checkt it now.

Thanks again

Miguel



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




Re: [PHP] How creat image pointer from JPG/GIF string?

2002-04-10 Thread M

Robert Cummings wrote:

> M wrote:
> >
> > I have stored lot of images into BLOB Mysql fields, and need recover it
> > to resize. How can I create some image pointer from string stored into
> > BLOB field?
> >
> > Thanks
> >
> > Miguel
>
> imagecreatefromstring() seems to be the candidate... however a comment
> attached to the help page indicates it is buggy. I suggest trying it out
> and if that fails then pull your image from the database, write to a
> temporary file, and then use imagecreatefromjpeg() as per usual.
>
> Cheers,
> Rob.

Hello Rob, just to inform that function ImageCreateFromString works ok

Thanks for your valuable info

Miguel



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




[PHP] Running WML (WAP services) under PHP

2001-12-09 Thread M

Hello, I am trying to develop some WML apps using PHP.
To run WML apps into my local Apache (win98) server, I added

AddType application/x-httpd-php .wml

into httpd.conf. This works ok when calling directly from netscape
http://localhost/mywml.wml ,
treating script like a true PHP program.

BUT when writing a REAL WML app. (cards and so) and trying to run on
NOKIA simulator (by calling URL), it shows a parse error on line 1 (for
all scripts).
The same script, when executed in file mode on NOKIA sim (that is first
load .wml file and then press SHOW button) , works fine, proving the
error is not in script, but in way PHP interpret .WML pages.

I suspect PHP introduces some invisible code (just 1 byte?) or something
at beginning of .WML page.


Thanks for your attn.

Miguel



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Uploading files with on webhostings

2001-12-10 Thread M

Hello, first of all, thanks very much for your answer about WAP and WML
php headers. I corrected headers and page works ok now.

==

Now a question about uploading files (.gif .jpg) using  to be stored into Mysql blob fields.

I hope somebody here having sites on www.blueboxinternet.com hosting
company, because I have big trouble there I can't solve, and support
says I first shoud read faq because they have lot of customers with no
problems.

I make industrial and commercial catalogs, so my customers should be
able to send (upload) pictures of products and goodies directly from
their HD to site, these pictures stored in Mysql tables and shown when
customer pages are called by someone.
The only way I know to perform this is



Enter filename 






This script will store picture-file into some tmp directory on bluebox
servers and will return tmp file name into $myfile var when script
called again by 'form action' command. Then I can treat file and store
in DB.

This script worked fine on bluebox servers  until NOVEMBER 1st ,
when they made some important changes on their servers. When this change
happened, my script began to receive this error:

Warning: open_basedir restriction in effect. File is in wrong directory
in
/home/httpd/vhosts/meucatalogo.com/web_users/gratis/rest_prox.php on
line 25

Bluebox support says I am recording my files on tmp directory with owner
'someowner' and trying to read file with 'anotherowner' owner.
I argue I have no control about owners and file modes into their servers
(specially into their tmp directories), and that PHP performs this task
in a transparent way for me. Thats to say, I have no tools to bypass
this problem.
Then they answer I shoud read faq.

Case some of you have site using this (otherwise excellent web hosting)
company, I would greatly appreciate what solution for upload files thru
HTML forms there exists.

Thanks very much

Miguel



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] OPEN_BASEDIR from user point of view (instead server admin)

2001-12-18 Thread M

Hello, I posted a question some days ago, but no answers received. I
notice many people discussing OPEN_BASEDIR apache restriction here, but
all discussion are from server admin point of view.

Let me ask question in another way:

Is it possible to tell HTTP  command the complete path/name
into local server for file being uploaded?. Note upload made by  command.

The reason for this question is posted into my original question (below)

Thanks

Miguel

= previous msg posted at 10/12/01 =

Now a question about uploading files (.gif .jpg) using  to be stored into Mysql blob fields.

I hope somebody here having sites on www.blueboxinternet.com hosting
company, because I have big trouble there I can't solve, and support
says I first shoud read faq because they have lot of customers with no
problems.

I make industrial and commercial catalogs, so my customers should be
able to send (upload) pictures of products and goodies directly from
their HD to site, these pictures stored in Mysql tables and shown when
customer pages are called by someone.
The only way I know to perform this is



Enter filename 






This script will store picture-file into some tmp directory on bluebox
servers and will return tmp file name into $myfile var when script
called again by 'form action' command. Then I can treat file and store
in DB.

This script worked fine on bluebox servers  until NOVEMBER 1st ,
when they made some important changes on their servers. When this change

happened, my script began to receive this error:

Warning: open_basedir restriction in effect. File is in wrong directory
in
/home/httpd/vhosts/meucatalogo.com/web_users/gratis/rest_prox.php on
line 25

Bluebox support says I am recording my files on tmp directory with owner

'someowner' and trying to read file with 'anotherowner' owner.
I argue I have no control about owners and file modes into their servers

(specially into their tmp directories), and that PHP performs this task
in a transparent way for me. Thats to say, I have no tools to bypass
this problem.
Then they answer I shoud read faq.

Case some of you have site using this (otherwise excellent web hosting)
company, I would greatly appreciate what solution for upload files thru
HTML forms there exists.
=




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] OPEN_BASEDIR from user point of view (instead server admin)

2001-12-18 Thread M

Jim Lucas wrote:

> php will return you four $vars to work with.
> check this out.
> http://www.php.net/manual/en/features.file-upload.php
>
> then work with the tmp file and get done with it what needs to be done
> before the script closes cause php will delete the file when the script is
> done.
>
> jim

Thanks Jim. Yes, I know about these variables. I am using there (specially
$userfile) to fopen. Problem is with file permission on server side. I don't
know how to bypass this problem unless I could say to HTTP where to store temp
files instead storing in tmp default dir. Support people insists I am trying
to read files with different owner, but I am just client.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] passing variables from - to frames

2001-06-26 Thread M

Hello, sorry this question here (it is not true PHP question), but I use
some variables into PHP scripts and need
pass these variables from one frame to another.

I want pass variable values between frames, these definded via input
hidden tags into form definition.
I have first frame name=framea containing form name=forma
then second frame name=frameb form name=formb
I have forma input type=hidden name=vara value=valuea and want to pass
this value to formb type=hidden name=varb

I wrote little javascript into framea something like
frameb.formb.varb.value = framea.forma.vara.value  but only got
'javascript error'. Java doesnt reckognizes frameb.formb.varb names at
all. I tried also by creating  into frameb header
but this also didnt work.
Is there some other solution?

Please help to solve this one

Thanks very much

Miguel



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: Dynamic Thumbnail From Database Solution!

2001-08-01 Thread M




> Subject: Dynamic Thumbnail From Database Solution!
> Date: Mon, 23 Jul 2001 17:37:56 -0700
> From: "Jason Bell" <[EMAIL PROTECTED]>
> To: "PHP Users" <[EMAIL PROTECTED]>
> CC: <[EMAIL PROTECTED]>



>
> Using getpic.php in conjuction with the  tag can display the fullsize picture.
>
> Now, to the fun part! Dynamicly creating a thumbnail from the fullsize binary within 
>your database. To create the thumbnail, I have a script called mkthumb.php:
>
>$src = 
>imagecreatefromjpeg("http://www.barkingrat.com/photo/getpic.php?id=$id";);
>   $twidth = imagesx($src)/3;
>   $theight = imagesy($src)/3;
>   $img = imagecreate($twidth,$theight);
>   
>imagecopyresized($img,$src,0,0,0,0,$twidth,$theight,imagesx($src),imagesy($src));
>   imagejpeg($img);
>   imagedestroy($img);
> ?>
>
> You use mkthump.php in the same exact way that you use getpic.php.  Now, obviously, 
>mkthumb.php needs to be modified to handle filetypes other than jpeg. That should be 
>a simple task, I just haven't done it yet should be as simple as checking the 
>file type (I insert the type into a column when I store the original image)
>
> this works.  if anyone can think of a better way to do anything I have done, 
>feel free to add your 2 cents  I'm certainly open to it.  :)
>
> Jason Bell

Hi Jason!

Your solution is very interesting, but I think it is necessary GD library to built 
dynamic thumbnails. My PHP provider has no GD library installed, so I am searching for 
some other miraculous solution. Here another idea: it is possible to store thubnails 
into JPG header files, this is allowed by JPG specifications, but I don't
know PHP functions to retrieve thubnails from into JPG streams. The  html code won't prevent downloading all bytes from image. I 
think I am lost.

Any idea?







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP] How to index HTML fields for Javascript and PHP at same time?

2001-09-03 Thread M

Hello, I have table with lot of 
fields.
I need to refer these fields like vector in PHP and Javascript mode.
When I write  then I can see values
in PHP sccript, BUT can't see values in javascript mode, thats to say
document.form.myfield[index].value doesnt work.
On the other side, when I make  I can
see indexed values in Javascript BUT not in PHP script.

Thanks in advance

Miguel



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] About old msg on attachements using PHP mail function

2001-09-20 Thread M

Hello, regarding old email from [EMAIL PROTECTED] about mail
attachements

From: py" <[EMAIL PROTECTED]>  21/05/01 08:25
Subject: Re: [PHP] sending attachements with mail
To: "Tolga \"thorr\" Orhon" <[EMAIL PROTECTED]>
CC: <[EMAIL PROTECTED]>

Here is a nice class that handles e-mail attachment.
Works fine for me.



function write_mimeheaders($filename, $mime_filename) {
 if ($mime_filename) $filename = $mime_filename;
 $out = "MIME-version: 1.0\n";
 $out = $out . "Content-type: multipart/mixed; ";
 $out = $out . "boundary=\"$this->mime_boundary\"\n";
 $out = $out . "Content-transfer-encoding: 7BIT\n";
 $out = $out . "X-attachments: $filename;\n\n";
 return $out;
}

function write_smtpheaders($addr_from) {
 $out = "From: $addr_from\n";
 $out = $out . "Reply-To: $addr_from\n";
 $out = $out . "X-Mailer: PHP3\n";
 $out = $out . "X-Sender: $addr_from\n";
 return $out;
}

...

I am trying to attach single text file to mail, then don't want to
implement new class for this task.
I imagine to send MIME messages, it would be enough build appropriate
headers, in same way PY wrote these functions above, then send these
headers into PHP mail function.

PHP mail function has parameters ($TO,$SUBJECT,$BODY,$HEADERS) , then I
built MIME headers into $HEADERS parameter. Message arrives ok to me,
headers are right placed into message headers, but no attachements
appears for me (and no body also!)
My doubt is: when sending MIME parts, should $BODY be empty (and actual
body sent like MIME part), or rather should I mount all my headers into
$BODY and let $HEADERS empty?

What I made is:

$mime = 'From: [EMAIL PROTECTED]\n';
$mime = $mime . 'MIME-version: 1.0\n';
$mime = $mime . 'Content-type: multipart/mixed\n';
$mime = $mime . 'Boundary="1234567890"\n';
$mime = $mime . '--1234567890';
$mime = $mime . 'Content-type: text/plain; name="myfile.txt";';
$mime = $mime . 'this is my text file to be attached, blha blha
blha...';

mail([EMAIL PROTECTED],"mysubject","mybody",$mime)

mail arrives ok, but no body and no attachement into.

Thanks in advance.

Miguel



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Javascript document variable names for complex forms

2001-09-24 Thread M

Hello people.

First , let me thanks all of you who answered  my mime-mail question
(special Richard Lynch).

Next question (probably not for proper list, but I couldn't get answer,
so please sorry me).

I have http frame page (classical 'top', 'left' and 'center' frames),
then 'center' frame opens new window. From this new windows, I need
access some 'top' document variable names-values. I tried all possible
combinations, but couldn solve this.

Examples:

(from into new-window, child of 'center' frame)

var myvar = parent.top.document.form.var.value
var myvar = top.document.form.var.value
var myvar = parent.parent.top.document.form.var.value

Thanks in advance

Miguel



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] User IP

2004-08-04 Thread M
How can I get a user's IP who is behind a proxy?

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



Re: [PHP] Issue when inserting Slovak characters in database via PHP code

2006-11-05 Thread M
The important steps:

1. display the form on utf-8 page:
header('Content-Type: text/html; codepage=utf-8');
... and the same in  tag
2. use pg_set_client_encoding('UTF8') after connecting to posgres
3. have your database, tables and rows in UTF8 (you have already)
4. again, when retrieving, pg_set_client_encoding('UTF8')
5. display the form on utf-8 page

Alain Roger  wrote / napísal(a):
> Hi,
> 
> Sorry to cross post this mail but i'm not able to know from where comes my
> issue.
> I have a postgreSQL database in UNICODE (UTF-8 in v8.1.4 and UNICODE in
> v8.0.1).
> 
> Via my web application i type a sentence in Slovak language and it is
> stored
> into DB without any slovak characters. Instead of that, all particular
> characters are replace with \303\251 or \303\206 or \304\314 and so on...

perhaps the characters are stored as UTF-8, but you view them over ASCII
connection

> 
> I was thinking that issue was coming from DB encryption but on 2 different
> versions of DB (see above) i get the same result.
> after, i was thinking that it was coming from my web browser, but even if i
> setup character mode in central europe and Slovak language as default
> coding...nothing change...i tried on IE and Firefox.
> 
> Last step, i tried to type directly from my PhpPgAdmin (direct typing
> sentence there to DB), and i realize that when i click on save...the
> changes
> appear in DB aswritten above (e.g. : \303\251,...)
> 
> My latest test was to write via PhpPgAdmin (directly to DB) the UNICODE of
> slovak character contained within my sentence...so i used ý, í and
> so on...
> if i do that, those code are correctly saved into DB and when my PHP code
> show web pages, all sentences are correct.

these are html entities, they are different, they use only 7 bits. I
would not recomend on using them, you will use many capabilities.

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



Re: [PHP] Sending UTF-8 mail with mail()

2006-06-13 Thread M

Peter Lauri wrote:

How can I send UTF-8 mails with the mail() function. Right now I am doing:

mail('[EMAIL PROTECTED]', 'Subject', 'Message', 
"From: The Sender <[EMAIL PROTECTED]> \n" . 
"Content-Type: text/plain; charset=utf-8 \n" .

"Content-Transfer-Encoding: 7bit\n\n")

The message is being sent, but the UTF-8 specific characters are not being
presented. Is there any fix on this?

The messages etc are coming from a form. Is it possible to set the charset
for the form?

/Peter



Content-Transfer-Encoding is 7-bit, but utf-8 is 8-bit. So you need to 
encode it (see notes in http://sk.php.net/quoted_printable_decode), or 
leave the Content-Transfer-Encoding header.


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



[PHP] How check if URL is running ok before try open it?

2004-02-19 Thread M
Hello, I decided to make a pre-URL caller into my script, so when user
try link to another URL, instead show these annoying http errors (when
URL off), I could direct him to more user friendly environment.

I checked FOPEN($url-name,'R') command, but in some cases it will pop up
fire-walls alerts for users who uses firewalls, when FOPEN is executed.

I would like to try more silent tricks for this task, and appreciate any
help.

Mig

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



[PHP] PHP ImageCreateFrom.. malfunctioning in last PHP releases...

2005-06-12 Thread M
Hello people,

I use ImageCreateFromString PHP functions to resize (thumbnails and so)
dynamically my JPG images.

I use third party WEB hosting provider , so I have no control about new
releases and updates of server softwares.

I have not changed my images in last 3 years (they are used for virtual
stores), they appeared beautiful in these 3 years, but from some days
ago, they are appearing with terrible filter colors (all blue for
instance, some entirely black and so). When bypassing image PHP
functions, images again appear beautiful in my page, but site
performance to show product catalogs gets terrible, not to say
impossible for customers browse on it.

I wrote web provider to check what changed in their PHP environment, but
I am afraid they will answer none has changed.

I use the following sequence of commands to rebuild thumb images:

$orimage = ImageCreateFromString(string) to get original image
from opened JPG file
$thumb =  ImageCreate(new-width, new-height) to create empty new
thumbnail
ImageCopyResized($thumb,$origame,)  to fill thumbnail
ImageJpeg($thumb)  to show thumbnail

I checked by increasing 'quality' parameter  ImageJpeg($thumb,'',100)
but result continue to be wrong.

Is anobody else experiencing these problems lately?, how did you solve
it?

Thanks very much

(I would appreciate cc to [EMAIL PROTECTED] if possible)

Mig

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



Re: [PHP] whitch class can I read EXCEL .xls file

2005-11-03 Thread M

Manish Marathe wrote:

On 11/2/05, bala chandar <[EMAIL PROTECTED]> wrote:


Hi,

On 11/3/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:


Dear all:

whitch class can I read EXCEL .xls file
I want to read data from a excel's .xls file on Linux use php,please


tell


me way.


There is a phpexcelreader project going on sf.net . check
out there it works fine




Or if you do not want it to be completely automatic, export the .xls file in
.csv (comma separated values) and then do the usual file read, line by line.
For each line you get use the explode() function with the delimiter you have
set and then finally you will get an array of all values per line. Loop
through this till the end of the file.


There's fgetcsv()

http://www.php.net/fgetcsv

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



Re: [PHP] FileExists?

2005-11-07 Thread M

Gustav Wiberg wrote:

Hi there!

File_exists doesn't seem to work with URLs that point to another domain. 
What to use?


$x = fopen(http://www.stammis.com/getstart.php);
if file_exists($x) 




file_exists() takes filename as parameter, not file pointer.

besides, spare the one http request and use @fopen() (@ will suppress 
eventual  warning), it will speed up your script.


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



Re: [PHP] FileExists?

2005-11-07 Thread M

Gustav Wiberg wrote:


- Original Message - From: "M" <[EMAIL PROTECTED]>
To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Sent: Monday, November 07, 2005 11:12 PM
Subject: Re: [PHP] FileExists?



Gustav Wiberg wrote:


Hi there!

File_exists doesn't seem to work with URLs that point to another 
domain. What to use?


$x = fopen(http://www.stammis.com/getstart.php);
if file_exists($x) 






file_exists() takes filename as parameter, not file pointer.

besides, spare the one http request and use @fopen() (@ will suppress 
eventual  warning), it will speed up your script.



I tested to use @fopen instead of fopen and it took 1 second longer...



I meant using:

if(($x = @fopen('http://www.stammis.com/getstart.php')) !== false) {

}

instead of:

if(file_exists('http://www.stammis.com/getstart.php')) {
$x = fopen('http://www.stammis.com/getstart.php');

}

And you need to check the speed more than once.

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



Re: [PHP] Catch the WMV first frame picture in PHP script?

2005-11-08 Thread M
張 峰銘 wrote:
> Hello:
>  
> I'm try to design WMV movie upload system im my school.
>  
> when teachers upload the wmv movie to the web ,
>  I hope I can grab the first frame picture of wmv 
> and save it to a jpeg file.
>  
> Dose any one do that before ?  Is is difficult to implement in PHP ?
>  
> (I'm in the Linux with Apache & PHP & MySQL)
> Thanks for any helps.

You can execute totem-video-thumbnailer. It captures the middle frame, I
think. The first one is mostly irrelevant or even blank anyway.

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



Re: [PHP] PEAR on PHP 5+?

2005-11-09 Thread M

Minuk Choi wrote:

I can't seem to get pear to work correctly.

if I type

[/]# pear install DB

I get the usage printed out back(no error message, no action)

and if I go to the PHP-5.0.4/lib/php directory, I get
[PHP-5.0.4/lib/php]# pear install DB


Fatal error: Call to undefined function: getoptions() in 
/usr/bin/pear on line34


I tried with PHP-5.0.3 and PHP-5.0.2 with the same result.  With some 
google-assisted digging, I found that PEAR/Command.php doesn't have a 
getOptions function defined... but instead of me trying to overwrite a 
file or two, I'd like to ask this question


Is PEAR broken with PHP5?

I mean, I tried re-installing it... (only PHP-5.0.2 - PHP-5.0.4) and 
pear or pearcmd.php doesn't work.  It worked fine for PHP 4, so I'm a 
little surprised.  Any insight?


do you have only php5 version installed? If you execute
$ php -v
what version do you get?

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



Re: [PHP] Re: Session's across Domains...

2005-11-09 Thread M

Ben Ramsey wrote:
B is a secure page, with a CC info form that when submitted will 
process their card, charging the amount of money passed in the 
encrypted packet, and if the charge succeeds, redirecting back to A. A 
would probably need to send an order number to B, and B could pass 
that back to A upon success or failure.


All of this is to get around the Apache limitation of allowing only 
one virtual host to use SSL.


apache does not have this limit. this is limit of https protocol, 
because encryption takes place before any request is made, so the only 
way to know what SSL certificate to use is the IP address. You can get 
apache to listen on more than one IP and use as many certificates as you 
like.




Anyhow, B could keep track of all of the order numbers it was sent by 
A, and if it was re-sent a duplicate could simply deny the whole 
transaction. Thus, if someone sniffed my encrypted "data burrito", and 
attempted to re-use it to gain access to B, they would fail, since B 
will only allow that burrito ONCE. Perhaps these order numbers could 
be GUID's.


You can look at how payment gateways do this. There are basicly 2 ways:

1. postback - when user is redirected from B to A with the result status 
and order id, A asks B (rpc, simple get method, anything...) if the 
result is really what it got from the user. Check every important 
information - order id, amount


2. signing - site B computes a sign from important information of the 
transaction (at least order id and amount) and a secret key, and adds 
this sign to the redirect url that leads to site A. Site A can then 
compute the sign from the same values and check it against sign received 
from the server.


In both cases you should also incorporate site id, so site A is not the 
only one that can use the interface of site B.


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



Re: [PHP] Unable to send variables to MySQL table

2005-11-09 Thread M

Stewart Priest wrote:


What is the structure of that table?


+---+--+--+-+-+---+
| Field | Type | Null | Key | Default | Extra |
+---+--+--+-+-+---+
| invoice_no| int(10)  | YES  | | NULL|   |
| item1_desc| varchar(255) | YES  | | NULL|   |
| item1_cost| float| YES  | | NULL|   |
| item2_desc| varchar(255) | YES  | | NULL|   |
| item2_cost| float| YES  | | NULL|   |
| item3_desc| varchar(255) | YES  | | NULL|   |
| item3_cost| float| YES  | | NULL|   |
| item4_desc| varchar(255) | YES  | | NULL|   |
| item4_cost| float| YES  | | NULL|   |
| delivery_cost | float| YES  | | NULL|   |
| customer_id   | int(10)  | YES  | | NULL|   |
| comments  | varchar(255) | YES  | | NULL|   |
+---+--+--+-+-+---+



This is not a good structure. Have you thought about taking item* 
columns to a separate table?


Table invoices:
+---+--+--+-+-+---+
| Field | Type | Null | Key | Default | Extra |
+---+--+--+-+-+---+
| invoice_no| int(10)  | YES  | | NULL|   |
| delivery_cost | float| YES  | | NULL|   |
| customer_id   | int(10)  | YES  | | NULL|   |
| comments  | varchar(255) | YES  | | NULL|   |
+---+--+--+-+-+---+

Table invoices_items:
+---+--+--+-+-+---+
| Field | Type | Null | Key | Default | Extra |
+---+--+--+-+-+---+
| item_no   | int(10)  | YES  | | NULL|   |
| invoice_no| int(10)  | YES  | | NULL|   |
| item_desc | varchar(255) | YES  | | NULL|   |
| item_cost | float| YES  | | NULL|   |
+---+--+--+-+-+---+

And columns should be able to hold NULL values only if they can be 
empty. I'm sure you don't want invoice_no to be NULL ;)


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



Re: [PHP] Re: Select and $_POST

2005-11-10 Thread M

Chris Shiflett wrote:

Ben Ramsey wrote:


$clean = array();
$sql   = array();



Glad to see someone spreading this habit. :-) Thanks, Ben.


if (ctype_alnum($_POST['pass']))
{
$clean['pass'] = $_POST['pass'];
}



I think it's fine to cheat a bit with the password and trust the output 
format of md5():




$clean['pass'] = md5((ini_get('magic_quotes_gpc') ? 
stripslashes($_POST['pass']) : $_POST['pass']));


or users with quotes in their password won't be able to log in.


$clean['pass'] = md5($_POST['pass']);

Of course, it is best to use a salt:

$salt = 'SHIFLETT';
$clean['pass'] = md5($salt . md5($_POST['pass'] . $salt));

Chris



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



Re: [PHP] php session in ie

2005-11-11 Thread M

sunaram patir wrote:

Hi, i am having problem with internet explorer. i am working on a
project on building a website where i need to keep track of the users
i.e. i use a login system in there in short. with the following code i
check whether the user is logged in or not.


It might not fix your problem but you should exit after location header.

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



Re: [PHP] php session in ie

2005-11-11 Thread M

Stephen Leaf wrote:

For security.. *never* store the password in a cookie..


OP stores the password in session

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



Re: [PHP] Catch the WMV first frame picture in PHP script?

2005-11-12 Thread M
張 峰銘 wrote:
> Mr. M:
> Hello, thanks for your kind help.
> But my Linux system is Fedora Core 1 ,
> there isn't any totem-video-thumbnailer.
> What should I do?
>  
> Do I have to upgrade the Linux system to FC 3 or heigher  ?
> (the Totem  exists in FC3 )
> or Is there any  other method to solve this problem?

totem-video-thumbnailer should be in of totem rpm. install totem and you
are done.

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



Re: [PHP] Regex to wrap tag around a tag

2005-12-01 Thread M
The second parameter to preg_replace is the replacement string (with 
optional backreferences), not another patern.


Use '/(.*)(?=<\/p>)/' for patern, 'href="edit_paragraph&text=$1">$1' for replacement string, however, 
this does not urlencode the text parameter. You can use 
preg_replace_callback instead of preg_replace to encode it in the 
callback function.


This won't work for long paragraphs because the lenght of GET request is 
limited. Change it to use forms instead.


Shaun wrote:

Hi,

I am trying to read the contents of a file into a string and wrap an href=""> tag around every  tag and output it to the browser. This is how 
far I have got:


// Get file contents
$file_contents = file_get_contents($file);
// Replace  tags
$file_contents = preg_replace('/^[a-z][0-9]<\/p>$/', '/^href="edit_paragraph&text="">\[a-z][0-9]<\/p><\/a>$/', $file_contents);

// Output to browser
echo $file_contents;

I have two problems.

1. - The regex doesn't work!
2. - I need to add the  tags and all contents to the link

Here is an example



Here is a paragraph
Here is another paragraph



would become



Here is a paragraph">Here is a 
paragraph
Here is another paragraph">Here is 
another paragraph




Any advice would be greatly appreciated 



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



Re: [PHP] need session_start() to recall session data.

2005-12-04 Thread M

Matt Monaco wrote:
Yes, I actually changed the destructors to handle the session as you 
indicated a few minutes after I posted, however I still have no clue as to 
why I would need to do a session_start() to get data from the session.


How else would php know you want session started? You can turn 
session.auto_start on, but then you don't have control over session 
parameters.


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



Re: [PHP] href links not working in XP

2005-12-10 Thread M

Marlin Unruh wrote:
Sure, here is the main function and the function that sends the 
files/links to the browser. This works fine on two w2k machines, but not 
on our XP machine. If I place the mouse pointer over the link on the web 
page it shows correct in the IE status bar. Example:( 
file:///c:/suncosys/act/2d/file_name.vc6 )




Does it work if you copy&paste the link? It might be a security feature.

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



Re: [PHP] Transfer-Encoding: chunked problem

2005-12-10 Thread M

kumar kumar wrote:

Hi

i am sending  encrypted data(AES-CBC) every large
files to the php pages as streams, in php i am
decrypting the data .

The code is working fine for the filesize less than
12MB each (if 30files each of 12 Mb total = 360 Mb)
its working file .

If i am trying to upload a file greater than 15 mb the
upload is hanging at 13.43Mb 


And after some time i am getting following msg
 
Server: Apache/2.0.53 (Win32) PHP/5.0.3

X-Powered-By: PHP/5.0.3
Transfer-Encoding: chunked
Content-Type: text/html; charset=ISO-8859-1

‚ìD0Ρ)›ÝT5 ‚ìD0Ρ)›ÝT5 and junk values



What is the maximum post size?

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



Re: FW: [PHP] IE6 not returning POST data from a textarea

2005-12-12 Thread M

Jay Blanchard wrote:

[snip]
Everyone keeps asking it.  Of course it's named or Mozzilla wouldn't work.
[/snip]


You can insert a textarea into a page without a name and mozilla will work.


Are you sure? I just tried it using FF and textarea is not posted. Even 
if I set id attribute.


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



Re: [PHP] HTML rendering extension?

2005-12-21 Thread M

Marcus Bointon wrote:
Has anyone seen such a thing? I'm looking to be able to generate web  
page previews dynamically and automatically, so I need to render the  
page on the server. The most efficient way would be if there was a  PHP 
HTML rendering extension - gecko or KHTML perhaps. HTML2PDF  doesn't go 
nearly far enough. Alternatively something like a CLI  option to firefox 
to run without X (i.e. no visible windows) and  output to a file instead 
of a display device. The options here don't  indicate that it can do that:


http://kb.mozillazine.org/Command_line_arguments

Any other ideas?

Marcus


http://marginalhacks.com/Hacks/html2jpg/

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



Re: [PHP] MySQL update killed my login...

2006-01-03 Thread M
It seems the upgrade was from Mysql 4.0. PASSWORD() function changed 
between 4.0 and 4.1, it uses longer hashes now. You can still use 
OLD_PASSWORD() function instead.


William Stokes wrote:

Hello,

My ISP updated their MySQL DB to 5.0.18 and that killed my login procedure 
which was OK yesterday. Any ideas how to start to debug this?


The login updates 2 fields in users table row where username and password 
macthes. This is the code:



if (!$query = mysql_query("update tbl_users set sess_id='$sess_id', 
sess_id_start='$date'
where md5(usr_name)='$usr_name' and password=PASSWORD('$password') 
",$connection))

{
header("Location: http://www.domain.net/loginscreen.php";);
exit;
}
else
{
Do Login and stuff...

This worked until today. I called the ISP and they confirmed that there was 
a database update yesterday.


-Will



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



Re: [PHP] Problems requesting page

2006-01-03 Thread M

PHP Superman wrote:

Hey everyone, i'm on a windows box with PHP 5 on Apache 2 and I have a
strange problem. When i try to access a page it seems to be blank, before it
always worked but now it sudenly stopped. I am not a big computer techy but
i cleared IE's cache and it still doesen't work.


you should turn display_errors on on your development box. Turn it on, 
or check your logs, if you log php errors





Source Code in IE for requested Page:









Code in requested page:




http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
http://www.w3.org/1999/xhtml";>


Register for an account




Username: 

Password: 

Confirm your password: 

E-mail Address: 














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



Re: [PHP] Timezone and DST

2006-01-06 Thread M

Mark Steudel wrote:

Hi All,
 
I've got a little problem where our servers are in PST but the customer

operates in Hawaii (-10 GMT). I believe I can just get the time for them by
doing something like
 
date("d H i", strtotime('now -2 hours') );
 
But here's the catch, how should I deal with day light savings ( DST) . In

hawaii they don't observer DST, but in Washington State we do.
 
We're on php 4.x so I can't use the  date_default_timezone_set

  that
was added in PHP 5
 
Thanks, Mark




set TZ enviroment variable, it should point to a file containing 
timezone information for Hawaii, for example:


putenv('TZ=/usr/share/zoneinfo/US/Hawaii');

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



Re: [PHP] Re: Using GPG in Safe Mode

2006-01-18 Thread M

[EMAIL PROTECTED] wrote:

Hi Edwin!

Thanks for the tips but my ISP hasn't given me root. I'm very sad to hear gpg 
from cli won't work under safe mode. Are there any 100% php implementations of 
GPG I could use? (because I guess that is the only way that is left?)

/Emil



If you are using gnupg comand line, there is not way on PHP-safe mode.
The only way that i know to wrap around this problem it's install pecl 
extension package




there is a way. if gpg binary is in safe_mode_exec_dir

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



[PHP] exclamation points appearing from nowhere in the mail() function...

2001-09-18 Thread m&amp;m \(saul\)

hey,

could anyone help me with the mail function? in my script, its sintax is
right... when i use the mail() function it works normaly... but when
somebody receives the email sent by the mail(), some exclamation points
appear from nowhere and the strangest thing is that the excamation points
appear in diferent places everytime...

could anyone tell me if there is some kind of bug in this mail() function???

thanx



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Problems when running Java program

2007-04-04 Thread Fernando M M
Hello,

I have a Java program that gives me a string. When i run this program on the 
shell
everything works fine but when i try to run using shell_exec i get

Error occurred during initialization of VM
Could not reserve enough space for code cache

This script is currently on a VPS server with php4 running as CGI and phpsuexec 
enabled.

What am i doing wrong?

Thanks,

Fernando.

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



[PHP] Error with array and include

2006-12-05 Thread Fernando M. M.

Hi,

I'm having a strange problem when trying to show a array after its value 
was defined on a file that was included. Something like this:




On the file lang/pt_BR/login.php i have this...



But the result of the first script is 'S' (without quotes).

If i change lang/pt_BR/login.php to



I get 'Usuário' (without quotes again).

Why does this happens?

Thanks,

Fernando.

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



Re: [PHP] Error with array and include

2006-12-05 Thread Fernando M. M.

T.Lensselink,

Ok, problem solved. I didn't realized that i was using the same variable.

Thanks for the help!

T.Lensselink escreveu:

How can you use an array as string in the include statement and two lines lower 
as array?
Think it echo's 'S' because it see's $lang as a string and not an array.

On Tue, 05 Dec 2006 13:11:12 -0200, "Fernando M. M." <[EMAIL PROTECTED]> wrote:
  

Hi,

I'm having a strange problem when trying to show a array after its value
was defined on a file that was included. Something like this:



On the file lang/pt_BR/login.php i have this...



But the result of the first script is 'S' (without quotes).

If i change lang/pt_BR/login.php to



I get 'Usuário' (without quotes again).

Why does this happens?

Thanks,

Fernando.

--
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] Retransmiting post variables

2006-12-12 Thread Fernando M. M.


Hello,

I have a script called redir.php that is used only for redirecting
using the following code:

header('Location: ', $_GET['url']);

But
now i need to redirect post varibles too. Example:

If someone access
redir.php?url=my_page.php and post:

&a=1&b=2

I need to
send this post string (as post) to my_page.php.

How can i do this?

Thanks.

-- 

Blog: http://blog.forumdebian.com.br/fernando
Contato: http://www.forumdebian.com.br/fernando/contato.php


[PHP] date() and timezone

2006-12-14 Thread Fernando M. M.


Hello,

I have a lot of php scripts that uses date() for some important
operations. Yesterday those scripts were moved to another server which is on an
different timezone. I haven't predicted this so my scripts aren't working 
anymore. The
servers timezone is GMT -4 and mine is GMT -2. Is there a way to change the 
default
timezone for all scripts within a folder? And what about changing just one?

I
appreciate any help.

Thanks,

Fernando.


-- 

Blog: http://blog.forumdebian.com.br/fernando
Contato:
http://www.forumdebian.com.br/fernando/contato.php


Re: [PHP] date() and timezone

2006-12-14 Thread Fernando M. M.


I´m using php5 here.

But like i said i have lots of scripts inside this
folder, is there a way to set something on .htaccess to change the timezone?




> Fernando M. M. wrote:
>>
>> Hello,
>>
>> I have a lot of php scripts that uses date() for some
important
>> operations. Yesterday those scripts were moved to another server
which is on an
>> different timezone. I haven't predicted this so my scripts
aren't working anymore. The
>> servers timezone is GMT -4 and mine is GMT -2.
Is there a way to change the default
>> timezone for all scripts within a
folder? And what about changing just one?
> 
> it depends on what
version of php.
> 
> php5:
http://php.net/manual/en/function.date-default-timezone-set.php
>  
http://php.net/manual/en/function.date-timezone-set.php
> 
> php4: er
... I believe your stuck with settings the TZ environment var OR doing some
>
gnarly
> hack in userland to account for the difference in timezones. (try this
page and search
> for 'TZ':
>
http://php.net/manual/en/ref.datetime.php)
> 
>>
>> I
>> appreciate any help.
>>
>> Thanks,
>>
>> Fernando.
>>
>>
> 
> 


-- 

Blog: http://blog.forumdebian.com.br/fernando
Contato:
http://www.forumdebian.com.br/fernando/contato.php


Re: [PHP] Re: date() and timezone

2006-12-15 Thread Fernando M. M.


Hello,


>>> But like i said i have lots of scripts inside
this
>>> folder, is there a way to set something on .htaccess to change
the timezone?
>>
> 
> why? ;-)

Because i can't set
the timezone for every single script. Inside this folder and subfolders i guess 
there
are about 10,000 scripts.

>> What you were pointed to before + >
>>  http://us3.php.net/manual/de/ini.php#ini.list
> 
> ah, now
you've gone and made it easy for him :-)
> 

Actually i don't have
access to php.ini file. Are there any other ways to do this?

-- 

Blog: http://blog.forumdebian.com.br/fernando
Contato:
http://www.forumdebian.com.br/fernando/contato.php


[PHP] Curl and cookies

2006-12-15 Thread Fernando M. M.


Hello,

I have just started using curl and i have some question about
cookies.

The website i'm logging in controls everything using cookies (from
login to the actions inside it).

Is there a way to store the cookie values
into a php session variable ($_SESSION['cookie'])?

How do i make curl receive
the cookie and store in this variable?

How do i make curl send it?

Thanks,

Fernando.

-- 

Blog:
http://blog.forumdebian.com.br/fernando
Contato:
http://www.forumdebian.com.br/fernando/contato.php


Re: [PHP] Re: date() and timezone

2006-12-15 Thread Fernando M. M.


> 
> that will teach not to use global include files to init your apps.
> 
> even if you we stuck with editing 10,000 scripts (btw it sounds very
fishy
> to 10,000 scripts with date() calls in them - can anyone say 'code
reuse'?)
> exactly how hard would it be to write something that would go through
all
> those php files and add a single line (" ini_set('date.timezone',
'Europe/Amsterdam');
> ")
> to the top of the script (i.e. just
after the first ' 
> if you RTFM (and I mean
actually READ) then you would know that you
> can set the relevant date related
ini settings in a .htaccess file
> 
> here is the relevant link
again:
> 
>
http://php.net/manual/en/ref.datetime.php#ini.date.timezone
> 
> 

Sorry, i have read it but i was reading the portuguese version and it seens like
it is not completely translated. Just changed to the english version and NOW i 
can read
it :)

Thanks,

Fernando.
-- 

Blog:
http://blog.forumdebian.com.br/fernando
Contato:
http://www.forumdebian.com.br/fernando/contato.php


[PHP] Can anyone help? PHP script/MySQL problem

2002-12-10 Thread Steven M
Hi, i am trying to create a member login/authentication script to
automatically send newly signed up people an email with a confirmation link.
I am following a tutorial:

http://www.phpfreaks.com/tutorials/40/0.php

My form is located at:

http://www.tricia-marwick.co.uk/members/join_form.php

The script in question is as follows:

 0) || ($username_check > 0)){
  echo "Please fix the following errors: ";
  if($email_check > 0){
   echo "Your email address has already been used

by another member in our database. Please submit a different Email

address!";
   unset($email_address);
  }
  if($username_check > 0){
   echo "The username you have selected has already been

used by another member in our database. Please choose a different

Username!";
   unset($username);
  }
  include 'join_form.php'; // Show the form again!
  exit();  // exit the script so that we do not create this

account!
 }

/* Everything has passed both error checks that we have done.
It's time to create the account! */

/* Random Password generator.
http://www.phpfreaks.com/quickcode/Random_Password_Generator/56.php

We'll generate a random password for the
user and encrypt it, email it and then enter it into the db.
*/

function makeRandomPassword() {
  $salt = "abchefghjkmnpqrstuvwxyz0123456789";
  srand((double)microtime()*100);
   $i = 0;
   while ($i <= 7) {
  $num = rand() % 33;
  $tmp = substr($salt, $num, 1);
  $pass = $pass . $tmp;
  $i++;
   }
   return $pass;
}

$random_password = makeRandomPassword();

$db_password = md5($random_password);

// Enter info into the Database.
$info2 = htmlspecialchars($info);
$sql = mysql_query("INSERT INTO users (first_name, last_name,

email_address, username, password, info, signup_date)
  VALUES('$first_name', '$last_name', '$email_address',

'$username', '$db_password', '$info2', now())") or die (mysql_error());

if(!$sql){
 echo 'There has been an error creating your account. Please

contact the webmaster.';
} else {
 $userid = mysql_insert_id();
 // Let's mail the user!
 $subject = "Your Membership at RewardPoints!";
 $message = "Dear $first_name $last_name,
 Thank you for registering at our website,

http://www.rewardpoints.net!

 You are two steps away from logging in and accessing our

exclusive members area.

 To activate your membership, please click here:

http://www.tricia-marwick.co.uk/members/activate.php?id=$userid&code=$d

b_password

 Once you activate your memebership, you will be able to login

with the following information:
 Username: $username
 Password: $random_password

 Thanks!
 Steven Marwick

 This is an automated response, please do not reply!";

 mail($email_address, $subject, $message, "From: Steven

Marwick<[EMAIL PROTECTED]>\nX-Mailer: PHP/" . phpversion());
 echo 'Your membership information has been mailed to your email

address! Please check it and follow the directions!';
}

?>



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




Re: [PHP] Can anyone help? PHP script/MySQL problem

2002-12-10 Thread Steven M
Hi Rich

The prob is that the data isn't stored into the database as it should be and
the user doesn't get an email back with their data.  It seems to get lost
before reaching the database, meaning the rest of it wont work, and i don't
know why.

Thanks

Steven M



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




Re: [PHP] Can anyone help? PHP script/MySQL problem

2002-12-10 Thread Steven M
Rich,

I'm not getting any error messages.  I have just checked my database and the
only data other than that i manually entered is an auto-increment number and
a random password, which i assume were produced when you filed in the form.
There is no first name, last name, email etc which there should have been if
you filled in the form.

If it was working fine you would recieve an email automatically at the
address you specified.

If you have any ideas what's wrong i'd love to hear them.

Steven M
"Rich Gray" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Any error messages? You say it is not stored 'as it should be' does that
> mean it *is* stored but incorrectly, or is the data just not there?
> FWIW I just used your test form and it said I had registered ok I then
> retried with the same info and I got 2 error messages as I would have
> expected which implies the data is hitting the database ok...
> Rich
>
> -Original Message-
> From: Steven M [mailto:[EMAIL PROTECTED]]
> Sent: 10 December 2002 14:47
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Can anyone help? PHP script/MySQL problem
>
>
> Hi Rich
>
> The prob is that the data isn't stored into the database as it should be
and
> the user doesn't get an email back with their data.  It seems to get lost
> before reaching the database, meaning the rest of it wont work, and i
don't
> know why.
>
> Thanks
>
> Steven M
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>



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




[PHP] PHP/MySQL Query

2002-12-15 Thread Steven M
How do i make a form that will allow me to add 2 to the value of a MySQL
field?  I am trying to change it from 75 to 77.  Is this possible?

Thanks



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




Re: [PHP] PHP/MySQL Query

2002-12-15 Thread Steven M
Leif

Many thanks for that, your help is much appreciated.  *smiles*

Steven M



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




[PHP] Resizing a png tranparent image.

2002-12-28 Thread Vincent M.
Hello,

I am trying to resize a png file, my autograph ;-)


Good result thanks to gimp:
http://boxfly.free.fr/test/test1.jpg
Bad result with php:
http://boxfly.free.fr/test/test2.jpg

This is my PHP code to resize the autograph:

$newAuto = imagecreatetruecolor( $widthImgAu, $heightImgAu) ;
imagecolortransparent($newAuto,imagecolorat($newAuto,0,0)) ;
$imgAuto = ImageCreateFromPNG($img_auto);
imagecopyresized($newAuto, $imgAuto, 0, 0, 0, 0, $widthImgAu, 
$heightImgAu, $imageInfoAu[0], $imageInfoAu[1]) ;
ImagePNG($newAuto,"new_auto.png");

So I tried:
imagecopyresampled($newAuto, $imgAuto, 0, 0, 0, 0, $widthImgAu, 
$heightImgAu, $imageInfoAu[0], $imageInfoAu[1]) ;
Instead of imagecopyresized...

To copy the autograph inside the photo I do:
$newImg = ImageCreateFromJPEG($img_des);
ImageAlphaBlending($newImg, true);
ImageCopy($newImg, $newAuto, $posX, $posY, 0, 0, $widthImgAu, $heightImgAu);

But with no sucess

If I do not resize the png autograph and copy it directly inside the 
photo, that's perfect, as a result the problem is the resizing...

What do I have to do to resize a png image without loosing transparency ?

Thanks.


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



[PHP] PHP/MySQL help?

2003-01-12 Thread Steven M
What am i doing wrong with the script below? What i am trying to do is check
whether the "newtest" field has a 0 or a  1 value then redirect the user to
a different page based on the answer.

I am then trying to add 2 to the value in the "points" field of my database
and then  to set the "newtest" field value to 1 so the user is directed to
the second of the two pages if they click the link again

My database is MySQL and the connection details are correct and stored in an
external script.  I have missed out the PHP tags on the code below in case
that interferes with how it appears on the list.  I really would appreciate
any help with this as i am a newbie to MySQL and PHP and am finding it a
really steep learning curve.  Thanks.

Steven M
---
include 'db.php';

$result = mysql_query("SELECT newtest FROM users WHERE 14 = '$0'");
list($number) = mysql_fetch_row($result);
mysql_close();

if($number==0)
{mysql_query("UPDATE users SET points = '$+2' WHERE 14 = '$0'");
mysql_query("UPDATE users SET newtest = '$1' WHERE newtest = '$0'");
header("Location: redirect1.php");
}
elseif($number==1)
{
header("Location: redirect2.php");
}
else
{
header("Location: error.php");
}
---




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




Re: [PHP] PHP/MySQL help?

2003-01-12 Thread Steven M
Hi Johannes

Thanks for the help.  I have taken out the mysql_close() and it looks like
it is submitting ok (ie no error messages) but it is not updating the
database when i check it.  Any ideas?

Thanks.

Steven
"Johannes Schlueter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi Steven,

On Sunday 12 January 2003 23:58, Steven M wrote:
> include 'db.php';
>
> $result = mysql_query("SELECT newtest FROM users WHERE 14 = '$0'");
> list($number) = mysql_fetch_row($result);

Here you are closing your conenction to the MySQL-Server:
> mysql_close();

> if($number==0)

But here you need it again:
> {mysql_query("UPDATE users SET points = '$+2' WHERE 14 = '$0'");
> mysql_query("UPDATE users SET newtest = '$1' WHERE newtest = '$0'");

So remove the mysql_close() if it don't work: Post the error message!

johannes



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




Re: [PHP] PHP/MySQL help?

2003-01-12 Thread Steven M
I thought i read somewhere that you could refer to the field by number.  Was
i wrong? It doesn't seem to make a difference anyway.  It still doesn't
work.  Here's the code with words instead of numbers.  I'd be grateful if
you could let me know if there are any obvious errors.

Best wishes.

Steven M

include 'db.php';

$result = mysql_query("SELECT newtest FROM users WHERE newtest = '$0'");
list($number) = mysql_fetch_row($result);

if($number==0)
{mysql_query("UPDATE users SET points = '$+2' WHERE newtest = '$0'");
mysql_query("UPDATE users SET newtest = '$1' WHERE newtest = '$0'");
header("Location: redirect1.php");
}
elseif($number==1)
{
header("Location: redirect2.php");
}
else
{
header("Location: error.php");
}



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




Re: [PHP] PHP/MySQL help?

2003-01-12 Thread Steven M
Oops...many thanks for that.  Sorry, i am extremely new to this.

Best wishes.

Steven M



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




[PHP] File upload problem

2003-01-21 Thread John M
Hello,

I have the code below. It's a simple file upload. But it doesn't work.
Before the line if(isset( $Submit )) is an echo which can I read. But after
choosing a file and press a submit nothing happens. Why is if(isset(
$Submit )) always false? Maybe my apache or php config is wrong?

I use WinXp Prof, Apache 2.0.43, PHP 4.2.3, safe_mode is on , upload_tmp_dir
is "c:\tmp\" and upload_max_filesize is 2M in PHP config file.

Thanks!




Untitled Document








\n";
if(isset( $Submit ))
{
echo "After submit \n";

if ($_FILES['imagefile']['type'] == "image/gif"){
copy ($_FILES['imagefile']['tmp_name'],
"files/".$_FILES['imagefile']['name'])
or die ("Could not copy");
echo "Name: ".$_FILES['imagefile']['name']."";
   }
 else {
echo "";
echo "Could Not Copy, Wrong Filetype
(".$_FILES['imagefile']['name'].")";
}
}
?>







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




[PHP] Browser language problem

2003-01-22 Thread John M
Hello,

I have the code below, but it doesn't work. I see the message "It is an
array" but nothing else. What can be the problem?
How can I get the actual browser language?

I use WinXp Prof, Apache 2.0.43, PHP 4.2.3, safe_mode is on.

Thanks!





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




[PHP] Re: textarea new line

2003-01-23 Thread Neil M
Adi wrote:

i want to add in textarea a string with new line tag in it. how to do that?

my try:
$string="-line1n\ -line2 n\-line3";
echo "$string";

but i see a single line instead of:
-line1
-line2
-line3

tx in advance for any help



Hello

For a new line in a text area you cant use html 's

You need to use either \n OR \r\n

Thanks

Neil


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




[PHP] Re: Removing the #!/usr... from cgi output?

2003-01-23 Thread Neil M
Colin McDonald wrote:

Did you try it without that line at all?

I'm pretty sure you can setup apache (you are using apache right?) to 
use /usr/.../bin/php for all files with the extension .php

colin

David Brannlund wrote:

Example:

  #!/usr/local/bin/php
  

becomes

  #!/usr/local/bin/php
  foo





Hi there

yes , the shebang ( the  #!/usr/local/bin/php ) is not needed for use 
with dynamic webpages wether they be perl , php or whatever

Shebangs are used only with shell based scripts. Your webserver should 
be configured to know what to do with the file by extension, e.g. .php 
files should be processed by php in apache

This link describes how to configure a webserver to do this

http://www.php.net/manual/en/install.unix.php
( a unix server , but its nearly the same for windows )


Thanks

Neil


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



[PHP] Re: File upload problem

2003-01-23 Thread Neil M
John M wrote:

Hello,

I have the code below. It's a simple file upload. But it doesn't work.
Before the line if(isset( $Submit )) is an echo which can I read. But after
choosing a file and press a submit nothing happens. Why is if(isset(
$Submit )) always false? Maybe my apache or php config is wrong?

I use WinXp Prof, Apache 2.0.43, PHP 4.2.3, safe_mode is on , upload_tmp_dir
is "c:\tmp\" and upload_max_filesize is 2M in PHP config file.



try a double \\ in windows paths



Thanks!




Untitled Document







you will need to put a form action url in above line , like 
action="http://www.domain-name.com/script.php";




\n";
if(isset( $Submit ))
{
echo "After submit \n";

if ($_FILES['imagefile']['type'] == "image/gif"){
copy ($_FILES['imagefile']['tmp_name'],
"files/".$_FILES['imagefile']['name'])
or die ("Could not copy");
echo "Name: ".$_FILES['imagefile']['name']."";
   }
 else {
echo "";
echo "Could Not Copy, Wrong Filetype
(".$_FILES['imagefile']['name'].")";
}
}
?>








Thanks

Neil


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




[PHP] Sessions and phplib.

2003-02-17 Thread Vincent M.
Hello,

I am using the phplib just for the sessions management and unfortunately 
this projects seems dead (no?), no official realise using the php4 
session support.
What's more, i am looking for a sessions library which could check the 
IP adress of users not only the cookie. In case of bad hats steal cookies...
What I use in my current code is:
page_open(array("sess" => "SIOVA_Session", "auth" => 
"SIOVA_Challenge_Auth", "perm" => "SIOVA_Perm"));
$perm->check("user");
page_close() ;
$auth->auth["perm"] == "admin" ;// and others privilege checks...
$sess->delete() ;
$auth->unauth();
$auth->logout();
etc...

What do you think I should use instead of the phplib, do you think I 
should change what I use at this time which works full well :-/
I do want to use a library checking the cookies AND the IP adresses...to 
do something more secure.


Thanks for you advises,
Vincent.


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



[PHP] PHP form help

2003-02-19 Thread Steven M
Hi,

I have created a form that passes details to the next page so the user can
see the details they have submitted before clicking confirm to submit to the
database.  The problem is that the details dont seem to get passed to the
script after they have appeared on the confirmation page.  I know the script
works because i submitted info to is successfully before i changed the form
action to point at the confirmation page.

I think it has something to do with PHP sessions but am not sure how to make
it work.  Thanks for any help.

Steven M





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




Re: [PHP] PHP form help

2003-02-19 Thread Steven M
Hi Johnathan

Thanks I've got it now, hidden fields did the trick. :-)

Steven M
"Jonathan Villa" <[EMAIL PROTECTED]> wrote in message
004301c2d851$24ac2fd0$8600a8c0@inhocvince">news:004301c2d851$24ac2fd0$8600a8c0@inhocvince...
> How is the information being kept?  Sessions?  You'll either want to
> store them in a session or create hidden fields on the confirmation
> page, then when they click on confirm, you'll have access to the fields
> on the new page, (the page where your processing script is)
>
>
> ---> Jonathan
>
>
>
>
> -Original Message-
> From: Steven M [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 19, 2003 2:15 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP form help
>
> Hi,
>
> I have created a form that passes details to the next page so the user
> can
> see the details they have submitted before clicking confirm to submit to
> the
> database.  The problem is that the details dont seem to get passed to
> the
> script after they have appeared on the confirmation page.  I know the
> script
> works because i submitted info to is successfully before i changed the
> form
> action to point at the confirmation page.
>
> I think it has something to do with PHP sessions but am not sure how to
> make
> it work.  Thanks for any help.
>
> Steven M
>
>
>
>
>
> --
> 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 form help

2003-02-19 Thread Steven M
Thanks Ray but i've found the problem and sorted it.  :-)

Steven M



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




[PHP] 2 questions !

2003-03-01 Thread Vincent M.
Hello,

I didn't find in the doc how to:
 - Know the full path of the current directory. Like /var/www/to/the/path
- Know under which user work apache, to know when I create a file whose 
file it is...

Thanks.

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


[PHP] Re: 2 questions !

2003-03-01 Thread Vincent M.
Greg Beaver wrote:
"Vincent M." <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello,

I didn't find in the doc how to:
 - Know the full path of the current directory. Like /var/www/to/the/path


try using dirname(__FILE__) or dirname($_SERVER['PATH_TRANSLATED'])

dirname($_SERVER['PATH_TRANSLATED'])is good for me.

How can I know all these variables, for example, now I need to know the 
upload_max_filesize ! And later, for sure, I will have to know another 
config option of the server...wich can be access by such variable.
How to know all these variable ?

Thanks.

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


[PHP] What ?

2003-03-01 Thread Vincent M.
Hello,

I am the bus stop boy. The business I was talking about is an php 
gallery editor. You can see mine in action here:
  My photos of Montreal:
http://www.siova.net/photos/index.php?type=mtl&img=mtl_&diapo=0&pref_size=512&version=2
  My photos of Toulouse, the city I was born in:
http://www.siova.net/photos/index.php?type=tse&img=tse_&diapo=0&pref_size=512&version=2

Translation for better browsing:
"Voir l'image suivante" -> "See the next image"
"Voir l'image précédante" -> "See the forward image"
"Chargement de l'image en cours...Veuillez patienter" -> "Loading image 
in progress...Please wait"

Have you ever seen such a good gallere browser ?
And look at my future concurent:
http://www.photopost.com/
See photopost in action:
http://www.fordf150.net/photopost
Another future concurent:
http://www.imagefolio.com
That's it at this time.

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


[PHP] Re: Php and JavaScript

2003-03-02 Thread Vincent M.
Valentin wrote:
Hi,
Is any way to write JavaScript code into PHP function or to send PHP's
variables values to the JScript variables?
Thanks,


Of course, you can create dynamicaly javascript via php, ie:
  echo "

  var yourvar = $onephpvar ;
" ;
Is that what you were asking for ?

Vincent.

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


[PHP] Re: Php and JScript

2003-03-02 Thread Vincent M.
Valentin wrote:
Hi,
Is any way to write JavaScript code into PHP function or to send PHP's
variables values to the JScript variables?
Thanks,



Yes, I think there is a way to do so!
;-)
Vincent.

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


[PHP] define variables.

2003-03-05 Thread Vincent M.
Hello,

I do a lot of define like that:
define ("_LANG1", "Server options");
define ("_LANG1", "Manage your system");
etc...
And stuff like that:
  if($num == 1) {
$mgs = _LANG1 ;
  }else if($num == 2) {
$mgs = _LANG2 ;
  }
etc...
But I do want to avoid all these if and else, is there a way to do 
something like that:
$mgs = _LANG.$num ;
?

Thanks.

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


Re: [PHP] define variables.

2003-03-05 Thread Vincent M.
Jason K Larson wrote:
http://www.php.net/manual/en/function.constant.php

$msg = constant('_LANG'.$num);

HTH,
--
Jason k Larson
Strange it does not work if I do:
  $num = "_LANG".$num ;
  $msg = constant($num) ;
  echo $mgs ; //It does not display anything!
But If I do it directly, it works:
  $num = "_LANG".$num ;
  echo constant($num) ; //It display the constant variable.
Anyway it works  :-)

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


[PHP] cookie problem.

2003-03-07 Thread H M
hello.
i'm new to this NG, so i don't know if this is the right mailinglist / 
newsgroup for my problem. if not, please let me know which one to post 
it to. anyway, here goes:

i'm designing a new website with several php scripts. for that purpose 
i've configuerd my server (apache under MacOSX 10.2.4) to process php. 
the scripts get executed as they should be. so far so hoopy. the problem 
is the cookie. i have a login.php which checks user input and depending 
on the results either sets a cookie, displays a message and proceeds to 
the next page or returns to the login page. the problem is, it doesn't 
work. the next page checks the cookie and if it isn't set, it returns to 
the login page. this keeps happening even when it should proceed to the 
order forms.
now the strange thing: before i had to reinstall OSX, it worked nicely.

what can i do about this? any suggestions?

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


[PHP] Global VARS.

2003-03-07 Thread Vincent M.
Hello,

To get ride of magic_quotes I do:
function no_magicquotes() {
  global $HTTP_GET_VARS ;
  global $HTTP_POST_VARS ;
  global $HTTP_COOKIE_VARS ;
  if (get_magic_quotes_gpc()) {
   // Overrides GPC variables
  for (reset($HTTP_GET_VARS); list($k, $v) = each($HTTP_GET_VARS); )
   $$k = stripslashes($v);
   for (reset($HTTP_POST_VARS); list($k, $v) = each($HTTP_POST_VARS); )
 $$k = stripslashes($v);
  for (reset($HTTP_COOKIE_VARS); list($k, $v) = each($HTTP_COOKIE_VARS);)
 $$k = stripslashes($v);
 }
}
And it seems to work, But i have have a file like that:
$VAR_mailadmin = "[EMAIL PROTECTED]" ;
$VAR_urlgallery= "http://www.siova.net/paris2"; ;
$VAR_categories[0]["title"] = "Montréal by Night" ;
$VAR_categories[0]["name"]  = "Mtl by night" ;
$VAR_categories[0]["file"]  = "montreal_by_night" ;
...
And many others variables. And magic_quotes seems to work for global 
vars too. Is there a way to modify no_magicquotes() to make this 
function works with all global vars ? Another for...each...but how ?

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


[PHP] Easy Way.

2003-03-09 Thread Vincent M.
Hello,

Is there an easy way to change an integer to a 5 caracters string.
For example:
$i = 3 ;
$j = 110 ;
After having changed them:
$i = "3" ;
$j = "00110" ;
Is there a php function to do so instead of doing this:
  if( ($i>0)&&($i<10)) {
$i = "".$i ;
  } else if( ($i>9)&&($i<100)) {
$i = "000".$i ;
  } else if( ($i>99)&&($i<1000)) {
$i = "00".$i ;
  } etc...
Thanks :-)

Vincent.

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


Re: [PHP] Easy Way.

2003-03-09 Thread Vincent M.
Jason Sheets wrote:
Hello,

Use str_pad, the manual page is available at http://www.php.net/str_pad,
a short example would be:
$i = 3;
$i = str_pad($i, 5, "0", STR_PAD_LEFT);
This function is described in the PHP manual in the string functions
section, the manual is an excellent place to go first when questions
such as this arise.
Yes I know, but it's not so easy to find to right function I need there 
are so many... ;-)

Thanks.

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


[PHP] HTTP_POST_VARS empty!

2003-03-12 Thread Vincent M.
Hello,

I don't understand this code empty my HTTP_POST_VARS variable:
if ((get_magic_quotes_gpc() == 1)) {
  switch ($REQUEST_METHOD) {
  case "POST":
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
  $$key = stripslashes($val);
}
break;
  case "GET":
while (list ($key, $val) = each ($HTTP_GET_VARS)) {
  $$key = stripslashes($val);
}
break;
  }
}
This script is usefull to simulate get_magic_quotes_gpc to 0 but if I do 
 it it empty my HTTP_POST_VARS and this code does not work:
while(list ($key, $val) = each($HTTP_POST_VARS)) {
  echo "$key => $val";
}
echo "Here we are...!!!..." ;

It displays, "Here we are...!!!..." but nothing at all for $key and for $val

How should I do to simulate get_magic_quotes_gpc to 0 without emptying 
HTTP_POST_VARS ?

Thanks,
Vincent.
PS: If I delete the code ...(get_magic_quotes_gpc() == 1)...it works...

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


[PHP] Re: HTTP_POST_VARS empty!

2003-03-12 Thread Vincent M.
Vincent M. wrote:
Hello,

I don't understand this code empty my HTTP_POST_VARS variable:
if ((get_magic_quotes_gpc() == 1)) {
  switch ($REQUEST_METHOD) {
  case "POST":
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
  $$key = stripslashes($val);
}
break;
  case "GET":
while (list ($key, $val) = each ($HTTP_GET_VARS)) {
  $$key = stripslashes($val);
}
break;
  }
}
This script is usefull to simulate get_magic_quotes_gpc to 0 but if I do 
 it it empty my HTTP_POST_VARS and this code does not work:
while(list ($key, $val) = each($HTTP_POST_VARS)) {
  echo "$key => $val";
}
echo "Here we are...!!!..." ;

It displays, "Here we are...!!!..." but nothing at all for $key and for 
$val

How should I do to simulate get_magic_quotes_gpc to 0 without emptying 
HTTP_POST_VARS ?

Thanks,
Vincent.
PS: If I delete the code ...(get_magic_quotes_gpc() == 1)...it works...

ok,
It seems to empty the HTTP_POST_VAR variable when we parse it with
while(list ($key, $val) = each($HTTP_POST_VARS)) {
...
}
So I can't do this while 2 times :-( and I need to do it several times!
Does anyone know how to parse $HTTP_POST_VARS whithout emptying this 
variable ?

Thanks.

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


[PHP] Re: HTTP_POST_VARS empty!

2003-03-12 Thread Vincent M.
Vincent M. wrote:
Vincent M. wrote:

Hello,

I don't understand this code empty my HTTP_POST_VARS variable:
if ((get_magic_quotes_gpc() == 1)) {
  switch ($REQUEST_METHOD) {
  case "POST":
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
  $$key = stripslashes($val);
}
break;
  case "GET":
while (list ($key, $val) = each ($HTTP_GET_VARS)) {
  $$key = stripslashes($val);
}
break;
  }
}
This script is usefull to simulate get_magic_quotes_gpc to 0 but if I 
do  it it empty my HTTP_POST_VARS and this code does not work:
while(list ($key, $val) = each($HTTP_POST_VARS)) {
  echo "$key => $val";
}
echo "Here we are...!!!..." ;

It displays, "Here we are...!!!..." but nothing at all for $key and 
for $val

How should I do to simulate get_magic_quotes_gpc to 0 without emptying 
HTTP_POST_VARS ?

Thanks,
Vincent.
PS: If I delete the code ...(get_magic_quotes_gpc() == 1)...it works...

ok,
It seems to empty the HTTP_POST_VAR variable when we parse it with
while(list ($key, $val) = each($HTTP_POST_VARS)) {
...
}
So I can't do this while 2 times :-( and I need to do it several times!
Does anyone know how to parse $HTTP_POST_VARS whithout emptying this 
variable ?

Thanks.

ok, reset($HTTP_POST_VARS) is my friend ;-)

++

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


[PHP] Sensibly accounting for timezone differences?

2003-03-17 Thread M Wells
Hi All,

I'm an Australian PHP developer and host most of my web sites on US
servers. One in particular is primarily accessed by Australian visitors
and I want to be able to reflect Australian Eastern Standard Times when
writing / reporting records, rather than the server time, which is set
to US Eastern Standard Time.

I'm wondering if anyone can tell me if there is a sensible way to do
this easily?

Many thanks in advance!

Regards and best wishes,

Murray Wells,
Urban Legend Web Design (ABN 18 635 979 727)




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



[PHP] Searching for a file.

2003-03-17 Thread Vincent M.
Hello,

I am looking for a way to search a file knowing the beginig of his name. 
For exemple, I know that the file I am looking for is:
montreal_13_120.jpg
But I just know:
montreal_13
And I can't know _120.jpg

So at this time I did this:
$dirthumbs = $dir."/thumbs" ;
$direc_src_obj2 = dir($dirthumbs) ;
while($entry=$direc_src_obj2->read()) {
  if( substr($entry, 0, 15) == "$begining"){
$return[$i]["thumb"] = "$entry" ;
break ;
  }
}
It works but it's not enough fast :-(
For resume, is there a way to do something like that:
ls montreal_13*
without using the passthru function, I am looking for a native php 
function doing ls $mychar*

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


[PHP] Zip Way of life.

2003-03-19 Thread Vincent M.
Hello,

I'd like to uncompress to the Hard disk a zip file send by the browser.

At this time I do this:

function uncompresszip($zipfile) {
  copy($zipfile, dirname($_SERVER['PATH_TRANSLATED'])."/zip/zipfile.zip") ;
}
But I do not understand how to uncompress the zip file, I tried for exemple:
$retour = 
readgzfile(dirname($_SERVER['PATH_TRANSLATED'])."/zip/zipfile.zip");

But as mentionned in the php doc it outputs the content of the zip file 
in the browser :-(

How to uncompress a zip file in a directory ? I just want all the files 
which are in the zip file...

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


Re: [PHP] Zip Way of life.

2003-03-19 Thread Vincent M.
Marek Kilimajer wrote:
readgzfile is for *.gz files.
Either use zip file functions (rarely supported) or PclZip 
(http://www.phpconcept.net/pclzip/index.en.php)

No, it works with .zip files too, I just don't know how to manage it :-(



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


Re: [PHP] Zip Way of life.

2003-03-19 Thread Vincent M.
David T-G wrote:
Vincent, et al --

...and then Vincent M. said...
% 
% Marek Kilimajer wrote:
% >readgzfile is for *.gz files.
...
% No, it works with .zip files too, I just don't know how to manage it :-(

You mentioned wanting the "files" (note the plural) in the zip file.
AFAIK gunzip can unzip an archive containing a single file, but if you
have more than one in there then you need to use an actual unzip tool
(like, say, unzip :-)
While a class or a built-in command might be nice, if you just want to
get them out then a simple system call might be the easiest way to go.
HTH & HAND

:-D
Yes but gunzip does not work when there are more than one file in the 
zip file and unzip is not installed by on Unix servers. :-(

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


Re: [PHP] Zip Way of life.

2003-03-19 Thread Vincent M.
Daevid Vincent wrote:
You could use the exec() or shell_exec() and just do it via command line
method...
Yes but gunzip does not work when there are more than one file in the 
zip file and unzip is not installed by default on Unix servers. :-(





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


[PHP] Test the server.

2003-03-21 Thread Vincent M.
Hello,

Is there anyway to check these two things:
 - If the server is an Unix server.
 - If a command is available on the server.
For exemple, I need to test if the shell command unzip is avalaible to do:
exec("unzip ...something...") ;
So I can test if exec is available doing:
if(function_exists(exec)) {
  ...
}
But how to test if a shell command is available on the server and if the 
server is an Unix-like server ?

Thanks.

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


  1   2   3   4   5   6   7   8   9   10   >