RE: [PHP] Parse POST-Data myself
On Fri, 2001-11-16 at 10:19, Matthew Luchak wrote: > > If you know the setup of the form beforehand it is relatively easy to do > something like : > > $string="$myfield1[0] $myfield2[0] $myfield1[1] $myfield2[1] etc..." > > However I remember one of my stupid mistakes awhile ago was mistakenly > giving two form fields the same name. My result was that the second > field overwrote the first. How do you get an array? By putting brackets after the variable name [] in a form element // etc this will emerge as $text[0]..[2]: being each value in the form > > > > > Matthew Luchak > Webmaster > Kaydara Inc. > [EMAIL PROTECTED] > > > -Original Message- > From: Stefan [mailto:[EMAIL PROTECTED]] > Sent: Friday, November 16, 2001 10:03 AM > To: PHP > Subject: [PHP] Parse POST-Data myself > > > Hi > > I have following problem: > I get a form with some fields having the same name. > PHP solves this problem by appending [] to the form-field-names which > causes the creation of arrays. > My problem now is, that I have to pass those variables further to > another script (not PHP) in exactly that order I receive them from the > form. > But when I have a form (schematically) like this: > -input type=text name=myfield1 > -input type=text name=myfield2 > -input type=text name=myfield1 > -input type=text name=myfield2 > -input type=text name=myfield1 > -input type=text name=myfield2 > > Then I get in PHP all myfield1 in 1 variable (the array myfield1) and > all myfield2 in 1 other variable -> order is irreversibly destroyed. > Give the fields numbers is not a solution (for complexity reasons). > > So my ultima ratio is to parse the post-data myself - but how can I do > this? > I have not found any indices for a variable containing post-data :-( > > If someone has another approach to a solution: I will have both ears > open for it :) > > Thanks in advance > Stefan Rusterholz, [EMAIL PROTECTED] > -- > interaktion gmbh > Stefan Rusterholz > Zürichbergstrasse 17 > 8032 Zürich > -- > T. +41 1 253 19 55 > F. +41 1 253 19 56 > W3 www.interaktion.ch > -- > > -- > 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 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] What's wrong with this date ?
Well it should be '$date', Also.. If the column type is date and you are entering it for a form, check to make sure you are typing it in ok and you trim() the variable if It still doest work... do a before the mysql_query() and see exactly what its inserting... -Original Message- From: trongduc [mailto:[EMAIL PROTECTED]] Sent: Saturday, November 17, 2001 8:17 PM To: [EMAIL PROTECTED] Subject: [PHP] What's wrong with this date ? hi there, I try to save a record (in the "date" type in MySQL) from the by : $query = "INSERT INTO $table VALUES ($post_id, 0, '$topic', '$uname', '$body', $date, '$newdate', 0) "; But it couldn't work (I used $date or '$date' on above, but they got the same results) ! It showed me the wrong value, as : 1970-0-0 (always this, although I try to input different values in the text box with the date format is -MM-DD) I don't understand the way MySQL saves my date field in his data (is it -MM-DD ?) Can anyone help me in this case ? Thanks much... ps : I used the $date field in "varchar(20) type" instead. BWT, what's different beween the Varchar(length) type with the Char(length) type ? -- 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 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] HTTP_SESSION_VARS != Work
Hello, Slight Problem: -- This piece of code: session_start(); unset($testvar); session_register("testvar"); $HTTP_SESSION_VARS["testvar"] = "testval"; print "Global: $testvar | Track_var: " . $HTTP_SESSION_VARS["testvar"] . "."; $testvar = "testglobalassign"; print "Global: $testvar | Track_var: " . $HTTP_SESSION_VARS["testvar"] . "."; Produces this output: Global: | Track_var: Global: testglobalassign | Track_var: Now, The other HTTP_*_VARS works just fine. I dont know where to go to fix this. The Php.ini file says: register_globals: on and I compiled it with --enable-track-vars (even though it should be on by default) PHP version is 4.0.6 with apache 1.3.22 Anyone seen this problem or know how to fix? Thanks, Andrew
Re: [PHP] PHP newbie alert
On Tue, 2001-12-04 at 05:25, shaun murphy wrote: > Hello! > > Being one not to refuse a challenge, I have been asked to administer and > update a PHP based website. I was wondering what a good editor is for such a > task. I have been having a look at Dreamweaver as I use that quite a lot but > are there any extensions I should be using? > > > > -- > 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] > > I myself use VIM. Http://www.vim.org ( Yes, There IS a windows version) Pros: Very, Very Stable. Excellent Syntax higlighting Many, Many Features Cons: If you have never touched a 'vi' based UNIX editor, you probably cant use this. Dont let this deter you.. But it has a VERY steep learning curve -Andrew -- 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] Simple(?) Question
Hello, Is there a way to "post" to a script without any user interventions... e.g The user posts to a script, and the script posts back to the original one. Thanks!
Re: [PHP] parse error when requiring
Maybe you could give a little more info on what the parse error actually says? On Thu, 2001-12-06 at 06:51, Oosten, Sjoerd van wrote: > I have a question about require... > > I have a session_start() on top of every page and an if-else construction. > session_start() > if ($SessieEIA->Login == 1) > { > ?> > > > > > > On the bottom of every page > else { > require "error.php"; > } > ?> > > This works fine, but now i made the files sessionstart.php and bottom.php > > sessionstart.php > -- > session_start() > if ($SessieEIA->Login == 1) > { > ?> > > > bottom.php > -- > else { > require "error.php"; > } > ?> > > And i require these files on top resp. bottom of the page and i get two > parse errors. > > Can somebody tell me why? > > Thanks in advance! > > > > > Sjoerd van Oosten > Digitaal vormgever [EMAIL PROTECTED] > Datamex E-sites B.V. > http://www.esites.nl > Minervum 7368 Telefoon: (076) 5 730 730 > 4817 ZH BREDA Telefax: (076) 5 877 757 > ___ > > > -- > 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 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] How to compute time to load page...
Or this: at the beginning of your script, get the time using microtime then at the bottom, you could get the time again, subtract the difference and voila, thats how long the execution time of your script is. -ajf - Original Message - From: "Jack Dempsey" <[EMAIL PROTECTED]> To: "Torkil Johnsen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, December 08, 2001 7:59 PM Subject: RE: [PHP] How to compute time to load page... > the search time is different than the page load timegoogle for example > can find thousands of records in a tenth of a second, yet it takes longer to > get that html result back to your browseryou could estimate page > download time by calculating the filesize and using the connection > speedcertainly not 100% accurate, but it will give you a way of > estimating. > > jack > > -Original Message- > From: Torkil Johnsen [mailto:[EMAIL PROTECTED]] > Sent: Saturday, December 08, 2001 7:14 PM > To: [EMAIL PROTECTED] > Subject: [PHP] How to compute time to load page... > > > Hi All... (again) > > I was just wondering if anyone out there has made a function that will > compute how long time (seconds, milliseconds) it will take to load a page? > > I see some search engines have a function that displays how long time the > search took, and I'm looking for the same thing, to compare different > designs and improve loading time for my "viewers". > > Anyone? > - Torkil Johnsen > > > -- > 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 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 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: introduction
Glad to hear it :-) - Original Message - From: "Oliver Keller" <[EMAIL PROTECTED]> Newsgroups: php.general To: <[EMAIL PROTECTED]> Sent: Sunday, December 09, 2001 12:16 PM Subject: introduction > hi folks, > > > > being new to php, I just subscribed to this list - so I find someone to answer my dumb questions :-). > > i´m working thru some tutorials on mysql and php, just making the first steps. it´s a great experience so far ! > > > > > cu > > > oliver > > > > -- 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]