Re: [PHP] changing endianness
On Thursday, December 12, 2002, at 03:10 PM, Marek Kilimajer wrote: Does anyone know a way to change endianness of a binary string? Hi Marek: You might look at pack() and unpack(). http://www.php.net/manual/en/function.pack.php Perhaps one of the options for unpack? HTH David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dropping the resource fork
Hey loop: On Sunday, December 22, 2002, at 03:35 PM, James Brennan wrote: It's a new day and I'm still trying to figure my flat-text database update problem out. I am uploading from mac to unix . I Assume you are uploading from Mac OS 9 or earlier, 'cause OS X is UNIX :) (Although OS X is able handle Windows, Mac OS 9 and UNIX line endings). Does a .txt file have a resource fork? File name extensions in Mac OS 9 have little meaning so I assume you mean a file with a file type of 'TEXT'. Text Files created with MS Word, for example, in fact do have a resource fork, but if uploaded in "raw" form, the resource fork is left behind and what is sent is just the text, or the contents of the data fork. Keep in mind that a file with a file extension of .txt could be any kind of file. Is the resource fork from the mac file automatically scraped by unix, or do I have to do that? The resource fork is not sent unless the file is BINHEXed i.e converted to a binary file with the resource fork and data fork munged together. The receiving end has to be able to decode this type of file, which is _not_ text. When your file is uploaded via HTML form, if it is text, perhaps in PHP you could look for \r or \n and make sure that the UNIX line ending is there - not sure which MacOS 9 uses. HTH somewhat. David Would it be efficient to strip the resource fork with PHP? Has anyone written anything to deal with this? If not, any resources to help me figure out how to do it would be appreciated. Thanks, loop - snip snip - I'm using a HTML form to submit flat text files to a MySQL database. When I upload the text file by FTP the script that loads it's contents into the database works as expected. When I upload using the HTML form it seems to ignore the new line in the text file. As a result it only creates one row in the table with some overflow in the last cell. Does anyone know how to deal with this? _ The new MSN 8: smart spam protection and 3 months FREE*. http://join.msn.com/?page=features/ junkmail&xAPID=42&PS=47575&PI=7324&DI=7474&SU= http://www.hotmail.msn.com/cgi-bin/ getmsg&HL=1216hotmailtaglines_smartspamprotection_3mf -- 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] Sorry, really stupid question...
Hi Phil: It probably does what you are asking it to do. Have you checked the value of $nickname to see if you are setting it to "bob" or appending "bob" to it? i.e first time $nickname = "phil" second time $nickname = "philbob" HTH David On Saturday, December 28, 2002, at 02:24 PM, Phil Powell wrote: Honestly, what does this do: $fileID = fopen("nicknames.txt", "a") or die("Could not open " . $path . "/nicknames.txt"); chmod("nicknames.txt", 0755); fputs($fileID, $nickname . "\n"); fflush($fileID); fclose($fileID); What does it EXACTLY do? What I'm trying to do is very very simple: I have the nickname of "phil" and I add it to nicknames.txt as "phil" + "\n". The next person adds his name as "bob" + "\n". However, this happens: phil philbob Is it due to the way I'm adding to the file? Can someone show me how to append to a file properly without carrying over persistent existing data like what you see above, instead having it like this: phil bob Thanx, I'm lost here. Phil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Gridwidget - javascript
Hi: I believe that if you reference the form element like: document.forms['mycell[]'].value you will get what you want. HTH David On Friday, January 17, 2003, at 08:33 PM, Nico Jansen - NiRo IT Consultants B.V. wrote: Hi all, I'm trying to write a grid widget in php. When the user changes the value of a cell the totals must be recalculated at the client side. I can write a javascript when I use simple variables like A1, B1. onChange="njrecalculate()"> onChange="njrecalculate()"> This javascript will do the trick: function njrecalculate() { document.forms[0].mytot.value = Math.round(document.forms[0].A1.value) + Math.round(document.forms[0].B1.value) ; } But now I want to create a dynamice grid by using the array variable e.g. mycell[]: echo " onChange='njrecalculate()' value=$mycel[0]>"; echo " onChange='njrecalculate()' value=$mycel[1]>"; echo " onChange='njrecalculate()' value=$mytot>"; ?> Does anybody know how to access these mycell form fields on the client side using javascript. Nico Jansen -- 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] File upload problem
On Saturday, February 1, 2003, at 10:58 AM, Tomator wrote: I tried but I can't upload any file. My form and code are as following: Try looking at: http://www.php.net/manual/en/features.file-upload.php There is a working example there. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] question
Karl: Your question appears to be completely off-topic but perhaps this might help you. http://www.gotquestions.com/xs/seeDocument.asp?topicID=14&documentID=696 On Saturday, February 1, 2003, at 03:56 PM, Karl James wrote: IncrediMail - Email has finally evolved - Click Here
Re: [PHP] File upload problem
Hi John: Well actually I believe that you don't have to set MAX_FILE_SIZE...(I don't) but you might want make sure that you are not trying to send a file larger than the post_max_size directives in php.ini and ensure that file_uploads is set to allow http uploads. On Sunday, February 9, 2003, at 04:56 PM, Gurhan Ozen wrote: Hi, You need to specifye the MAX_FILE_SIZE value as a hidden argument to the form.. See: http://www.php.net/manual/en/features.file-upload.php Gurhan On Mon, 2003-06-30 at 15:05, 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. Thanks! Untitled Document echo "Before submit \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 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] Text>Image
On Saturday, March 8, 2003, at 08:49 AM, Christopher Smith wrote: Greetings, I've recently searched newsgroup archives on how to convert text into an image. Another good place to get start-up information, assuming that GD is available on your setup, is the manual: http://www.php.net/manual/en/ref.image.php However, I cannot seem to find a clear example on how to create the image dimensions based on the size of a textfile What do you mean "based on the size of a text file"? Number of bytes? Lines? and then once I create the initial image how to paint the text on the image based on how it appears in the textfile. Again, it is unclear to me what you mean by "based on how it appears in the textfile"? Is your text file broken into lines, and you want to create your image with the same line breaks? If so, there are a couple of examples in the comments for the imagettfbbox() and imagettftext() functions. I know the last comment contains an example that can do multiple lines (Brian at PrintsMadeEasy dot com) There's a link to the code and a working demo. When I modified the code to anti-alias the text it looked rather good. YMMV Any help with this would be helpful. Thank-you for your time! HTH. David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Splitting a string
Then split the variable where there is a "S". The problem showed up when there is another "S" in the field. I only want to split the first "S" at the beginning of the field. Isn't there an additional value to add to the split $line = 'S12345'; if ($line[0] == 'S') { /* do stuff */ } $str = "S12345"; $str1 = ltrim($str,"S"); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] creating files in OS X
Hi: I'm new to PHP. I'm running Apache/PHP/MySQL on Mac OS X 10.1.5 (PHP 4.1.2) and everything is working well except that I cannot create a file through PHP. If I create a file I can subsequently read/write from PHP, but only after I change its file permissions to read/write for everyone. When I run the code: if (!file_exists($filename)) { if (touch ($filename)) { print "$filename created"; } else { die( "Sorry Could Not create $filename"); } } I get the following: Warning: unable to create file test.text because Permission denied in /Library/WebServer/Documents/dev/testcreate.php on line 10 It's obviously a permissions problem but do not know what exactly to change nor where/how to change it. Thanks for any help. David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] creating files in OS X
Hi Paul: Thanks, that worked. Cheers, David On Sunday, August 11, 2002, at 07:11 PM, Paul Colcutt wrote: > Hi, > > you need to set the permissions for the directory youre creating the > file in. > Try typing (or copy and paste): > > chmod 777 /Library/WebServer/Documents/dev > into Terminal... should do the trick. > > Two neat apps you can use for setting permissions and ownership via a > GUI: > 'Super GetInfo' by BareBones Software http://www.barebones.com/ and > 'BatChmod' Freeware by Renaud Boisjoly > http://www.macchampion.com/arbysoft > >> Hi: >> >> I'm new to PHP. >> I'm running Apache/PHP/MySQL on Mac OS X 10.1.5 (PHP 4.1.2) and >> everything is working well except that I cannot create a file through >> PHP. If I create a file I can subsequently read/write from PHP, but >> only after I change its file permissions to read/write for everyone. >> >> When I run the code: >> >> if (!file_exists($filename)) { >> >> if (touch ($filename)) { >> print "$filename created"; >> } else { >> die( "Sorry Could Not create $filename"); >> } >> } >> >> I get the following: >> >> Warning: unable to create file test.text because Permission denied in >> /Library/WebServer/Documents/dev/testcreate.php on line 10 >> >> It's obviously a permissions problem but do not know what exactly to >> change nor where/how to change it. >> >> Thanks for any help. >> >> David >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php > > > -- === > Paul Colcutt > http://www.paulcolcutt.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] installing php with register globals off and on?
Hi: I have a test site where I am trying out a few things in PHP. I started off with register_globals on. Then I read in the docs that it is best to turn turn register_globals off. I did so and now I am having a marvelous time recoding some session stuff :( I could not find much info on why "register_globals on" is a bad thing. Seems to me that code is much cleaner with them on. What's the down side? Cheers, David On Monday, August 19, 2002, at 05:05 PM, Rasmus Lerdorf wrote: > Sure, turn register_globals on only for the oasis directory. In your > httpd.conf add: > > > php_value register_globals on > > > -Rasmus > > On Mon, 19 Aug 2002, Andy wrote: > >> Hi there, >> >> I am running php 4.2.2 with register globals set to off. Now I am >> planing to >> install oasis (a add tracking sw). Their current version requires a php >> build with register globals set to on!? >> >> Is there a way out of this dilema running only one server? >> >> Thanx for any advice, >> >> Andy >> >> >> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] installing php with register globals off and on?
Hi Rasmus: Now turning register_globals back on and exploring "E_ALL". Thanks :) David On Monday, August 19, 2002, at 07:36 PM, Rasmus Lerdorf wrote: > If you forget to initialize your internal script variables, then people > could potentially inject bogus values for these variables and change how > your script operates. eg. > >if($password=='david') $ok=1; > >if($ok) let_them_in(); > > In the above, assume $password is a user-supplied value and $ok is an > internal script variable. Now, since $ok was never initialized to 0 > then > the user could supply ok=1 and get into let_them_in() regardless of the > value of $password. > > Now, if you make your code E_ALL clean and make sure you initialize your > internal variables, you are correct, having register_globals on is > cleaner > and easier to deal with. > > -Rasmus > > On Mon, 19 Aug 2002, David Rice wrote: > >> Hi: >> >> I have a test site where I am trying out a few things in PHP. I started >> off with register_globals on. Then I read in the docs that it is best >> to turn turn register_globals off. I did so and now I am having a >> marvelous time recoding some session stuff :( >> I could not find much info on why "register_globals on" is a bad thing. >> Seems to me that code is much cleaner with them on. What's the down >> side? >> >> Cheers, >> David >> >> On Monday, August 19, 2002, at 05:05 PM, Rasmus Lerdorf wrote: >> >>> Sure, turn register_globals on only for the oasis directory. In your >>> httpd.conf add: >>> >>> >>> php_value register_globals on >>> >>> >>> -Rasmus >>> >>> On Mon, 19 Aug 2002, Andy wrote: >>> >>>> Hi there, >>>> >>>> I am running php 4.2.2 with register globals set to off. Now I am >>>> planing to >>>> install oasis (a add tracking sw). Their current version requires a >>>> php >>>> build with register globals set to on!? >>>> >>>> Is there a way out of this dilema running only one server? >>>> >>>> Thanx for any advice, >>>> >>>> Andy >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> PHP General Mailing List (http://www.php.net/) >>>> To unsubscribe, visit: http://www.php.net/unsub.php >>>> >>> >>> >>> -- >>> PHP General Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] empty php.ini
Hi Timo: From Marc's site: "Where is the php.ini file?" There is none included in the package. If you need one, just create it as /usr/local/lib/php.ini, including the intermediate lib directory if that doesn't exist already: sudo mkdir -p /usr/local/lib sudo touch /usr/local/lib/php.ini HTH Cheers, David On Monday, September 2, 2002, at 12:15 PM, timo stamm wrote: > Hi, > > > I am new to PHP. I am running the module version 4.2.2 from Marc > Lyanage (entropy.ch) on OS X 10.1 and noticed that my > /usr/local/lib/php.ini is empty!? > > Is there a way > > > -- 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] Help, Convincing upgrade of PHP
You may also want to look at: http://www.entropy.ch/software/macosx/php/ A build for Mac OS X based on PHP 4.4.2 with simple download and install instructions. HTH David On Wednesday, September 4, 2002, at 11:46 PM, Michael Geary wrote: > Perhaps the best thing to do would be to wait for PHP 4.3, which will > offer out-of-the-box OS X support. I have compiled the latest dev > releases with no problems or workarounds on OS X. > > However, I do have step-by-step instructions for compiling PHP 4.2.x on > OS X, but depending on the libraries you need to link in, you may or > may not have success. For example, I have never been able to get > --with-imap to work on anything less than 4.3 (dev). > > If you can't wait the few days that it will supposedly take for 4.3 to > be released, and you'd like a copy of my notes, let me know and I'll > send them to you. > > -michael > > > On Wednesday, September 4, 2002, at 09:14 PM, JJ Harrison wrote: > >> I will be generating a dynamic website for a Class in america. (Don't >> worry >> about details) >> >> The schools technican is the type that doesn't really know what they >> are >> talking about. >> >> They are running PHP 4.0.6 which is too old for me - Language >> differances. >> >> They say that upgrading to PHP 4.2.3 will put unnessercary load on our >> server. >> >> I have told about the security problem found (Which applys to 4.2.x >> only, >> but he doesn't know that). Can anyone think of other excuses. >> >> I told about safe mode for security. >> >> He said that when they buy a new server they will get the new version >> of >> PHP. TO me this suggests that he doesn't know how to compile PHP for >> Mac OS >> X server. Does anyone know of some good instructions? >> >> >> -- >> JJ Harrison >> [EMAIL PROTECTED] >> www.tececo.com >> >> -- >> Please reply on the list/newsgroup unless the reply it OT. >> >> >> >> -- PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > > -- PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] precision using pow()
Hi: I am attempting to calculate a mortgage payment using the following code. which produces: 630.40515566726 What I am looking for is 632.65 (rounded to 2 places). (I am not looking for a rounding mechanism, just a more accurate result) The manual states that the pow function attempts to return an Integer. Is this the source of the inaccurate result? The manual also says to look at exp but appears to be missing some sort of usage example. I have no idea how that works. I tried a few things with no success. I also came across a mention of bcpow() but am unable to use this in the build that I am using. So is it some boneheaded coding error on my part or am I asking for too much of pow()? Thanks David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] random array sort
But if array_rand() truly pulls out random keys, how do you guarantee that you are not randomly pulling out the same key as you iterate through the array? Perhaps you could set the number of keys to return, to the size of the array, and somehow, magically, all the keys would be included in the returned array of keys. i.e. array_rand ( array , array_size) I have no idea what this would produce... -David On Tuesday, September 10, 2002, at 10:33 AM, Mike At Spy wrote: > > You could use array_rand() to take stuff out of the array at random and > then > stuff it all back into another array. > > -Mike > > > >> -Original Message- >> From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]] >> Sent: Tuesday, September 10, 2002 10:22 AM >> To: [EMAIL PROTECTED] >> Subject: [PHP] random array sort >> >> >> Could someone show me a quick and simple way to randomly sort array >> elements? I can't seem to pinpoint the correct parameters in the docs. >> >> Thanks! >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Verify phone format?
http://www.webreference.com/programming/php/regexps/5.html Here's a short article that shows how to write a function to validate an ausie phone number (2nd example). Should be easy to modify to suit. perhaps using something like ereg("[0-9]{3}-[0-9]{3}-[0-9]{4}$", $phoneNum); Another at http://www.zend.com/codex.php?id=44&single=1 HTH -David On Tuesday, September 10, 2002, at 11:30 AM, Jeff Lewis wrote: > validate an entered phone -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: JAVASCRIPT INCLUDES
Georgie: So just for clarity, this "PHP" script ("http://localhost/top_stuff.php?affiliate=1";) was actually a file containing javascript? and no PHP? And out of curiosity, if that is so, why append the file name with ".php" -David On Sunday, September 22, 2002, at 07:20 PM, Georgie Casey wrote: > Solved the problem. > In case anyones wondering, > I had the PHP script starting with a and ending with > when > I already had that done in the HTML page. > > Simple > "Georgie Casey" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >> In HTML, you can do this: >> > src="http://localhost/top_stuff.php?affiliate=1";> >> >> But the script isn't executed before being used by the browser, it's >> returned with PHP tags and all, which obviously gives JS errors. Is >> there >> any setting you can change in Apache that let's you do this. >> >> > > > > -- > 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] Submit hitting enter problem
Hi Rija: No It's not "mandatory" to put quotes around attributes, but it would be wise to use this style="recommended" method of representing attributes, if for no reason="other" than to get used to a habit="good". coding="happiness" David On Monday, November 11, 2002, at 12:36 AM, rija wrote: Sure ! But just simple question? Is it necessary to put quotes around these attributes values? Because I think quotes increase the site size, and using IE4, IE5, IE6, NS4, OPERA, quotes don't change anything. Of course if I have somethings with space, for value's attribute, It is important to put quote because sometimes users enter space. - Original Message - From: "Jason Wong" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, November 11, 2002 3:33 PM Subject: Re: [PHP] Submit hitting enter problem What happens when ENTER is pressed depends on what browser you're using. Different browsers exhibit different behaviours, eg the old versions of Netscape (v4 and before) does not submit on ENTER. Also, put quotes around your attribute values eg: -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* The more I know men the more I like my horse. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] internet marketing
Here's a site that has a lot of interesting stuff. http://www.selfpromotion.com/ On Tuesday, November 12, 2002, at 09:51 AM, Edward Peloke wrote: My php site is almost done so now I need to begin the task of getting it noticed online. Can anyone suggest some good books or sites where I can learn all the basics and tricks for marketing my site? Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multiple selections
On Tuesday, November 12, 2002, at 07:34 PM, Ernest E Vogelsinger wrote: Sure it is - just name the listbox control "myvar[]" (note the angle brackets). PHP will recognize this being an array, and you'll end up with $myvar = array('select1','select2'); Is this the only way to do this? I just had to do some work with JavaScript and forms and the "myvar[]" name clobbered JavaScript's access to form elements by name. I had to do some ugly form.elements[x] looping to get at the "myvar[]" control. This kind on external language hostility is not that cool, especially toward such a common language as JavaScript. My apologies to PHP if the language provides a workaround :) David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multiple selections
Thanks Mike and Ernest for the info on how to handle the "var[]" Multiple Select name more sensibly in JavaScript. Not even a workaround. By definition, in JavaScript x.y is identical to x['y'], so where for a simple field you might write: document.formname.myvar.value for a field named "myvar[]" you can write: document.formname['myvar[]'].value Cheers- David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php Form Issue
Hi Keith: Unfortunately, the information has to be sent to php. As soon as I add the [] brackets to an input name, the javascript no longer functions. I'll look up a javascript mailing list next, but I figured there must be some other way to get php to recieve the data and convert it to an array. If your checkboxes all have the same name i.e. group, then for php to see them, you have to name them group[]. Then you can use something like this to get them out of the array: if (count($group) > 0){ for($i=0; $i < count($group); $i++) { $sql = "INSERT INTO groupImage VALUES "; $sql .= "(0, '$imageID', '$group[$i]')"; mysql_query($sql) or die(mysql_error()); //echo "linked \"$imageName\" to groupID=".$group[$i]." in gi table"; } } you might have to change the js. If you are accessing form elements in js then you can use something like: forms.elements['group[]'] to access the js checkbox array by name. Does anyone have an idea how I can make the php script gather all the multiple &browser=lynx&browser=mosaic&browser=explorer instead of only the last entry? AFAIK varName[] is the only way to go if you want the checkboxes in an array. I suppose you could just give a unique name to each checkbox. I believe that PHP will have a value for those checkboxes that are checked. Then you could loop through your set of checkbox vars and see which have a value. HTH David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is this not possible?
Hi Jeff: Brent Ashley has written some cool stuff to make asynchronous remote calls to server without client page refresh using javascript/iframe etc. There is a PHP version. Go to: http://www.ashleyit.com/rs/main.htm And click on the link: Javascript Remote Scripting (JSRS). It works for most browsers. HTH David On Monday, November 18, 2002, at 04:39 PM, Jeff Bluemel wrote: I'm been ignored on this question for 4-5 days now. even if it is not possible could somebody please verify this? is it possible to pass a variable from javascript directly to php WITHOUT using either a link, or a form submit to pass the variables? I've gotten a work around to call an image that's actually a php file, but run my script, and then return an image file. is this the only way? -- 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