php-general Digest 3 Mar 2004 12:30:59 -0000 Issue 2624
Topics (messages 179320 through 179336):
Re: resubmitting $POST data to another script
179320 by: Chris Shiflett
179321 by: Marek Kilimajer
179322 by: Chris Shiflett
179323 by: Leif Gregory
179324 by: Chris W. Parker
179333 by: Erwin Kerk
Re: IE6 with latest hotfixes breaks forms ...
179325 by: Marc G. Fournier
179328 by: Chris Shiflett
Re: PHP application design with WAE UML.
179326 by: Lukasz Karapuda
merge array
179327 by: Max
179330 by: Lucian Cozma
179331 by: Lucian Cozma
PHP5 COM get/set property trouble
179329 by: Daniel Daley
Re: numeric characters
179332 by: Dominique ANOKRE
179335 by: Jakes
writing file on server from database?
179334 by: raisinlove
SQLite Support is library call?
179336 by: DAvid Jackson
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
--- Marek Kilimajer <[EMAIL PROTECTED]> wrote:
> Let's not make it complicated:
>
> confirmation.php:
>
> <input type="hidden" name="post" value="<?php echo
> htmlspecialchars(serialize($_POST)); ?>">
>
> email.php:
>
> $_POST = unserialize(stripslashes($_POST['post']));
I think the other person's suggestion (hidden fields) was made so that the
original poster doesn't lose all other POST data (since he mentioned a
second POST request).
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming mid-2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/
--- End Message ---
--- Begin Message ---
Chris Shiflett wrote:
--- Marek Kilimajer <[EMAIL PROTECTED]> wrote:
Let's not make it complicated:
confirmation.php:
<input type="hidden" name="post" value="<?php echo
htmlspecialchars(serialize($_POST)); ?>">
email.php:
$_POST = unserialize(stripslashes($_POST['post']));
I think the other person's suggestion (hidden fields) was made so that the
original poster doesn't lose all other POST data (since he mentioned a
second POST request).
This method does not lose any post data as the whole $_POST array is
serialized. Then it is unserialized back to $_POST array at the second page.
--- End Message ---
--- Begin Message ---
--- Marek Kilimajer <[EMAIL PROTECTED]> wrote:
> This method does not lose any post data as the whole $_POST array is
> serialized. Then it is unserialized back to $_POST array at the second
> page.
It loses all new data:
<input type="hidden" name="post"
value="<?php echo htmlspecialchars(serialize($_POST)); ?>" />
<input type="text" name="this_will_be_lost" />
Because of this:
$_POST = unserialize(stripslashes($_POST['post']));
The method is fine, but it's no simpler than the other person's suggestion
when this specific scenario is considered. More logic is necessary to
prevent the loss of data.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming mid-2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/
--- End Message ---
--- Begin Message ---
Hello Charlie,
Tuesday, March 2, 2004, 1:54:43 PM, you wrote:
CFI> I'm creating a form with 170 fields, and I'd like to create an
CFI> intermediary page so the user can review their info before
CFI> submitting it again to the emailing script.
Just a thought. I'm guessing you are dumping this stuff to a database
for the final result. Why don't you create an intermediate table to
hold those fields (keeping track of the record ID in a hidden input
field), then re-read that data back on the validation page, then when
they submit it there, the changes are added to the real table.
My only thinking on this is to keep it simple rather than carrying
over a ton of hidden fields. It may not be the most efficient method,
but it'd work.
Cheers,
Leif Gregory
--
TB Lists Moderator (and fellow registered end-user)
PCWize Editor / ICQ 216395 / PGP Key ID 0x7CD4926F
Web Site <http://www.PCWize.com>
--- End Message ---
--- Begin Message ---
Chris Shiflett <mailto:[EMAIL PROTECTED]>
on Tuesday, March 02, 2004 3:56 PM said:
> It loses all new data:
[snip]
> The method is fine, but it's no simpler than the other person's
> suggestion when this specific scenario is considered. More logic is
> necessary to prevent the loss of data.
it was my understanding that the second page does not introduce any new
data. it was merely a confirmation page where the previous pages data
would be displayed.
chris.
--- End Message ---
--- Begin Message ---
Chris Shiflett wrote:
It loses all new data:
<input type="hidden" name="post"
value="<?php echo htmlspecialchars(serialize($_POST)); ?>" />
<input type="text" name="this_will_be_lost" />
Because of this:
$_POST = unserialize(stripslashes($_POST['post']));
I think array_merge will fix this:
$_POST = array_merge($_POST,unserialize(stripslashes($_POST['post'])));
Erwin Kerk
Web Developer
--- End Message ---
--- Begin Message ---
On Tue, 2 Mar 2004, Chris Bowlby wrote:
> Hi Chris,
>
> He was referring to me actually :> I will be able to look it over today
> and see if I can re-create the issue..
What he said :) Sorry, I usually refer to him as ChrisB when there could
be confusion, forgot the B this time :(
>
> At 03:15 AM 3/2/04, Chris Shiflett wrote:
> >--- "Marc G. Fournier" <[EMAIL PROTECTED]> wrote:
> > > Chris, you said you could recreate it ... can you check Beau's solution
> > > here to see if it solves the problem we are seeing?
> >
> >I'm confused. You're the one having this problem, right? Why don't *you*
> >try his solution and tell us if it solves your problem. :-)
> >
> >I don't have a Windows box, so no, I never said I could recreate it. If I
> >could, I'd try to solve the problem instead of asking for HTTP dumps. :-)
> >
> >Chris
> >
> >=====
> >Chris Shiflett - http://shiflett.org/
> >
> >PHP Security - O'Reilly
> > Coming mid-2004
> >HTTP Developer's Handbook - Sams
> > http://httphandbook.org/
> >PHP Community Site
> > http://phpcommunity.org/
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED] Yahoo!: yscrappy ICQ: 7615664
--- End Message ---
--- Begin Message ---
--- "Marc G. Fournier" <[EMAIL PROTECTED]> wrote:
> What he said :) Sorry, I usually refer to him as ChrisB when there
> could be confusion, forgot the B this time :(
No problem. My apologies for the confusion. :-)
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming mid-2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/
--- End Message ---
--- Begin Message ---
A very good tool for UML modeling is Microsoft Visio Professional 2002.
I have found a very useful book on the subject of UML modeling for Web
Applications:
Building Web Applications with UML Second Edition
By Jim Conallen
Publisher : Addison Wesley
Pub Date : October 04, 2002
ISBN : 0-201-73038-3
--
Lukasz Karapuda
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
--- End Message ---
--- Begin Message ---
Hello all,
I have two arrays as follows:
$x = array(3,4,6,8);
$y = array(10,20,40,10);
I need these arrays could be merged with '0' in between.
Result expected :
$x = array(1,2,3,4,5,6,7,8);
$y = array(0,0,10,20,0,40,0,10);
Can anybody help me ?
Thanks in advance.
Max
--- End Message ---
--- Begin Message ---
That should do it:
"Max" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello all,
I have two arrays as follows:
$x = array(3,4,6,8);
$y = array(10,20,40,10);
I need these arrays could be merged with '0' in between.
Result expected :
$x = array(1,2,3,4,5,6,7,8);
$y = array(0,0,10,20,0,40,0,10);
Can anybody help me ?
Thanks in advance.
Max
--- End Message ---
--- Begin Message ---
That should do it:
<?php
$x = array(3,4,6,8);
$y = array(10,20,40,10);
$tmp = $x;
rsort($tmp);
$n = $tmp[0];
$newArr = array();
$newArr = array_fill(0, $n-1, 0);
for($i=0;$i<count($x);$i++) {
$newArr[$x[$i]-1] = $y[$i];
}
print_r($newArr);
?>
"Max" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello all,
I have two arrays as follows:
$x = array(3,4,6,8);
$y = array(10,20,40,10);
I need these arrays could be merged with '0' in between.
Result expected :
$x = array(1,2,3,4,5,6,7,8);
$y = array(0,0,10,20,0,40,0,10);
Can anybody help me ?
Thanks in advance.
Max
--- End Message ---
--- Begin Message ---
Hi, I'm having difficulty trying to use the com extension in php5.
Here's the asp equivalent of what I'm trying to do.
Set comobj = Server.CreateObject("MyComlib.ComLib")
comobj.FieldValue = "somedata"
myval = comobj.Property("Record")
comobj.Property("Record") = "otherdata"
My php code looks like this:
$comobj = &new COM('MyComlib.ComLib'); // Works
$comobj->FieldValue = "somedata"; // Works
$myval = $comobj->Property("Record"); // Kind of
Works.....throws an exception if the value doesn't exist
$comobj->Property("Record") = "otherdata"; // Doesn't Work
I'm able to initialize the object and assign the FieldValue property
some data. The last line however doesn't work and instead gives me:
PHP Fatal error: Can't use method return value in write context
It makes sense to me why that wouldn't work in php, but for the life of
me I can't figure out what would make it work. I've tried with both the
latest beta and the latest snaps release of php5 with the same results.
I can't find any bug reports or mention of this happening to anyone, is
this something that maybe just can't be done in php?
Thanks,
--Dan--
--- End Message ---
--- Begin Message ---
ok thanks, i have written a script with javascript and i think it's running
good !
Thanks
----- Original Message -----
From: "Daniel Clark" <[EMAIL PROTECTED]>
To: "Php List" <[EMAIL PROTECTED]>
Sent: Tuesday, March 02, 2004 7:15 PM
Subject: Re: [PHP] numeric characters
> Or you can us client side JavaScripting.
>
> > Hello Dominique,
> >
> > Tuesday, March 2, 2004, 6:31:00 PM, you wrote:
> >
> > DA> Is there a way with php to force the user to put only numeric
> > character in a text field ?
> >
> > No, because that's a client-side thing. You can however use the PHP
> > function is_numeric() to check the data once it has been entered to
> > ensure they are numbers and error out if not.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Another thing that you can do is cast the variable to integer
$int = (int) $_POST['data'];
"Dominique Anokre" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Is there a way with php to force the user to put only numeric character in a
text field ?
thanks
--- End Message ---
--- Begin Message ---
Hi, I'm currently working on a basic website creation script where I
want an index file created automaticaly within each new folder created.
My attempts at using copy() were foiled by safe-mode restrictions on my
account but after some research, I discovered this could be circumvented
with the use of move_uploaded_file() instead.
Now I'd like to figure out how I could use this to copy an existing
"index.php" file on the server to the newly created directories.
But can I use move_uploaded_file() if the file is already on the server?
If it needs to be an uploaded file, would uploading it once allow me to
copy it anytime afterwards?
I figured an even better solution could be to store the index file as a
blob in my MySQL db and have the script write that file to the newly
created dirs. Is this feasible (especialy with the safe-mode restrictions) ?
Any tips or examples would be much appreciated.
Thanks!
-s
--- End Message ---
--- Begin Message ---
Howdy --
SQLite supported by a direct call the sqlite library?
As apposed to calling the executable?
Could I use ini_set(include_path=) to tall PHP where the SQLite lib is
located?
TIA,
David
--- End Message ---