[PHP] Cutting off first 4 characters using array input names??
Hi Group, I have a problem where when I use array html input names like value[client_name] PHP cuts off the first 4 characters? example code: input type=text name=value[client_name] value=12345678 / input type=text name=value[student_name] value=12345678 / On the next page there should be a variable called $value with those values inside it. This is how it comes out when I do a print_r straight after on the page its getting posted to. [value] = Array ( [client_name] = 5678 [student_name] = 5678 ) This used to work and return the entire string on our old server (PHP 4.2.2) but we just moved to a new dedicated server (PHP 4.2.3) and now it screwed. Any thoughts? Regards Jarrad Kabral -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What is this??
It means you are most likely performing an insert and have more fields specified than values given. If you give us your SQL we can help you out. Regards Jarrad Kabral -Original Message- From: Miguel BrĂ¡s [mailto:molino26;netcabo.pt] Sent: Monday, 28 October 2002 1:40 PM To: [EMAIL PROTECTED] Subject: [PHP] What is this?? Hi guys, I was doing a script to insert data on a table, and the following message appeared me when testing the form for data insertion: Column count doesn't match value count at row 1 I lsaw the PHP manual and some other resources that I have, but couldn't find anything about it... Any hint from someone?? Cheers Miguel -- 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] Quick way to test series of integers
One way you could do it is to put a hidden input before each checkbox with the same name as the checkbox and set the value to 0. This works because PHP will process all input fields in order overwriting previous ones if it comes accross one with the same name.. eg.. input type=hidden name=one value=0 / input type=checkbox name=one value=1 / input type=hidden name=two value=0 / input type=checkbox name=two value=1 / and so on Regards Jarrad Kabral -Original Message- From: Paul Kaiser [mailto:paukai;illinimedia.com] Sent: Friday, 25 October 2002 7:35 AM To: [EMAIL PROTECTED] Subject: [PHP] Quick way to test series of integers Hey there, I have around 50 checkboxes on an HTML form. Their value is 1. So, when a user check the box, then no problem -- the value returned by the form is 1 and I can enter that into my SQL database. HOWEVER... If the user does not check the box, I'm in trouble, because the value does not default to 0, but rather nil I'm guessing... mysql query doesn't like my trying to pass NOTHING. I COULD go through each of the 50 returned variables and, if they are not 1, assign 0 to them. But I'm wondering if there is a better way to go about this?? Thanks, Paul -- 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] CC Processing Merchants
Most of our local banks here in Australia offer merchant facilities. Judging by your email address your from the UK but I cant see any reason why it should be different. Why dont you find out who your boss his/her banking with and contact them regarding a merchant service...? Regards Jarrad Kabral -Original Message- From: Andrew Brampton [mailto:[EMAIL PROTECTED]] Sent: Thursday, 10 October 2002 9:49 AM To: [EMAIL PROTECTED] Subject: [PHP] CC Processing Merchants Sorry for this slightly off topic question, but I beleive many of you will have delt with this kind of thing before. My client is asking for a Online Merchant that will allow him to validate and charge credit cards. He orginally suggested Pay Pals but after I read their docs I found that the Customers would have to sign up for a Pay Pals account, which my client dislikes. So can anyone recommend a good (maybe cheap) Merchant that can validate and charge credit cards online? My client is searching for some reviews online, but he asked if I could maybe get a list from progammers which have done it before. Thanks Andrew -- 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] Inheritance Question
Hi all, Was just wondering which is the better way to call an inherited method from a child class? Example: class foo { function jk() { echo In here!; } } class bar extends foo { function do_something() { //Either this one... $this-jk(); //Or this one...?? foo::jk(); } } Which is the best way? Is one a way a less memory intensive way than the other? Thanks in advance Jarrad Kabral -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP 4.2.2 vs PHP 4.0.6
Alex You can change back to the old way of parsing vars by simply changing the register_globals setting to on in your PHP config. Though this is certainly not recommended (mainly for security concerns). Good PHP coding practice suggests that you use superglobals when you wish to access session, cookie, post, get or environment variables. This URL will explain everything http://www.zend.com/zend/art/art-sweat4.php Regards Jarrad Kabral -Original Message- From: Alex Shi [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 2 October 2002 9:29 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP 4.2.2 vs PHP 4.0.6 Hi, I didn't realized that PHP had been going so fast that it was creating problems for compatiblility. Here is my situation: PHP on my development server is 4.0.6 while on the application server it is PHP 4.2.2. I bet you all know that there's a huge basic differences between the two but I don't know them! In PHP 4.2.2, variables passed by either GET or POST method can not be accessed straitforwardly by their name, you have to fetch them from $HTTP_POST_VARS or $HTTP_GET_VARS. To my understanding, directly using submitted variables by their name is one of the basic great PHP features, and I always use vars in this way. However, you can imagine that, recently due to the PHP upgrading I got bunch of problems when deploying. What I want to know are: 1. why PHP changed the way to access submitted vars; 2. any good suggestion to avoid this problem, such as that is it possible to configure 4.2.2 to compatible downward. Thanks! Alex Shi BTW: my development server is RH Linux 7.1 so cannot upgrade PHP to 4.2.2. -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- 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] PHP5
I was wondering the same thing... There was a URL to an interview with Zeev Suraski posted on here once where he was talking about the new featuresbut it was in german :( Jarrad -Original Message- From: Brad Bonkoski [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 2 October 2002 9:44 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP5 Hello... Don't know if this has been discussed but I saw a book on PHP5 listed on Amazon, saying that PHP5 would be released in the fall of 2002? Was wondering if there has been any information posted about this? -Brad -- 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] Wanting to better understand
and just when I thought this day couldnt get any more confusing:| -Original Message- From: Chuck PUP Payne [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 2 October 2002 12:50 PM To: PHP General Subject: [PHP] Wanting to better understand Hey, I am trying to better understand something, I learned a couple weeks ago that if I do this... If ($field == value1) { $field = change to new value; Now I have use this to change -00-00 to nbsp;. And the following. If ($days 30) { $days strongfont color='ff' . $days . /font/strong; } Want I want to do was add a second line this below to change the another value to change to change to another color... If ($days 45) { $days strongfont color='ff00ff' . $days . /font/strong; } But, the second value is over riding the first vaule so I can't see the differents. I sorry that this might be confusing but I am trying to ask the way I can. I am not sure what you call this, expression I think. Any way is there a way that I can use this expression to get two or more colors. Thanks Chuck Payne Magi Design and Support -- 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] Re: Web Site
If your in Aus (like me) then I recommend eWay, I've used them for several sites and never had a problem. www.eway.com.au They even have some sample PHP code you can use to integrate with there system... Regards Jarrad Kabral -Original Message- From: Sami Mahamed [mailto:[EMAIL PROTECTED]] Sent: Thursday, 22 August 2002 2:16 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: Web Site I think DSL is better than cable if you can't get a T3 line. If you want a site hosted at your home, i strongly suggest Apache(www.apache.org). Great sever tool :) Or PHP-Triad(www.phpgeek.com not sure if thats the site or not, sorry). Sorry i have no PayPal account so i can't answer that one ;) -Sami Peter Goggin [EMAIL PROTECTED] wrote in message 00a101c2497c$f8e51410$030a@petergnt1">news:00a101c2497c$f8e51410$030a@petergnt1... I am setting up a web site which will be hosted on my own equipmet at home, located in Melbourne, Australia I would like some general advice on two questions. 1. What sort of permanent interconnect should I look at (Cable is not available in my area). Is DSL suitable? Are there any good providers in the area? 2. I need to set up credit card payments. Has anyone any experience with PayPal? Are there any other providers I should consider. I don't know if this is the correct list for the questions, but if not perhaps someone could point me to where I can get some advice. Regards Peter Goggin -- 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] Re: Help and advice sought - search/replace
http://www.php.net/manual/en/function.fgetcsv.php that will help you :) -Original Message- From: David Robley [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 3 July 2002 11:49 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Help and advice sought - search/replace In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Just looking for a pointer or functions I can use to do this... I have a spreadsheet with a couple thousand entries that I'll be using for populating a MySQL database. The spreadsheet has names listed in last, first - the database I'll be populating has separate fields for first and last names. I exported the names column from the spreadsheet in tab-delimited format and I figured I could come up with a quick PHP script that would open the text file, find each instance of , , take all that's before that delimiter and move it after all that's after that delimiter, inserting a tab in between. So last, first would become first[tab]last. So far, I've gotten: ?php $filename = NAMES.txt; //name the file... $fp = fopen($filename,r+); //open it... echo Reading $filename...; $contents = fread($filename, filesize($filename)); //read it... $names = explode(\n, $contents); foreach($names as $name); echo $namebr; fclose($filename); ? Obviously, I've written in some stuff just so I can see what I'm doing, the echo in the foreach for example. But I'm stuck on what to use to actually separate and rewrite each $name. I'm assuming I'll have to create a while() or for() loop and use a regular expression for this? I'm not sure where to look. Any help would be great - just so I won't have to go in and manually separate first and last names. Thanks! Jason Soza Off the top of my head (pseudocode): Read the file into an array with file() foreach element explode on tab select name field explode on comma extract last, first fields and write to... done Cheers -- David Robley Temporary Kiwi! Quod subigo farinam -- 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] Automatic color coded HTML
Hi All, Is a command in PHP to format source code as color coded HTML? Regards Jarrad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Automatic color coded HTML
yeah that would be niceis it configurable at all? -Original Message- From: John Holmes [mailto:[EMAIL PROTECTED]] Sent: Thursday, 6 June 2002 12:19 PM To: 'Martin Towell'; 'Jarrad Kabral'; 'Php-General (E-mail)' Subject: RE: [PHP] Automatic color coded HTML Actually that only highlights PHP code, not HTML, if I remember right. It would be nice if this did highlighting for HTML, too, but I think it just comes out all gray. ---John Holmes... -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 05, 2002 10:00 PM To: 'Jarrad Kabral'; Php-General (E-mail) Subject: RE: [PHP] Automatic color coded HTML highlight_file() or something like that -Original Message- From: Jarrad Kabral [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 11:55 AM To: Php-General (E-mail) Subject: [PHP] Automatic color coded HTML Hi All, Is a command in PHP to format source code as color coded HTML? Regards Jarrad -- 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] User Authentication
I wouldnt rely on cookies or standard sessions (which use cookies) as a means of security. You can use sessions, but make sure you have the ini_alter(session.use_cookies, 0); so that no cookies are used for the session id. This means you'll have to pass the session id in the querystring or post of each page. Regards Jarrad Kabral -Original Message- From: John Holmes [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 5 June 2002 11:48 AM To: [EMAIL PROTECTED]; 'php-general' Subject: RE: [PHP] User Authentication Sessions use cookies as it is...so what do you really want to do...what do you want to protect? ---John Holmes... -Original Message- From: Jule Slootbeek [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 04, 2002 9:49 PM To: php-general Subject: [PHP] User Authentication Hey guys, What is the best way for user authentication (now i'm talking about the most secure and easiest way). Now i've been using sessions, and i was wondering if cookies were better and easier... any thoughts? thanks, Jule -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net -- 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] DOMXML......aaaahhhhhhhh!!!!!!!!!!!!!!!!!!!!!!!!!!!
Im tearing my hair out over how buggy DOMXML is! Im trying to get my Hosting provider to update to PHP 4.2 cause I hear alot of memory leaks for DOMXML are dealt with in this versioncan anyone who has 4.2 confirm or deny this?? Thanking you all in advance Jarrad Kabral -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is the browser still open? if not then I want to kill the script
Hi all I have a script that does a lot of harddrive access and runs for a while, at the moment if the user closes his/her browser half way through, the script continues and the harddrive keeps going crazy.is there a way like in ASP to check that the browser is still open and connected?? Regards Jarrad Kabral -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What's wrong????
It sounds like you only downloaded the small windows installer go here http://www.php.net/downloads.php and get the 4.8mb ZIP package. This has a bunch of commonly used modules come with it and comes with instructions on setting up modules Regards Jarrad -Original Message- From: Arpan De [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 30 April 2002 11:36 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] What's wrong I removed the semi-colon. restarted my server (IIS 5.0) now when I try to execute the PHP code, a dialog box with 'Warning' as the title pops up saying Unable to load dynamic library './php_mssql.dll'. The specified module could not be found. Even when I executed phpinfo(), the same dialog box opened up. I searched my hard disk to find php_mssql.dll, but Windows search facility could not locate it. Now where from can I get this dll? What do I do next? Thanks, Regards, Arpan John Holmes [EMAIL PROTECTED] wrote in message 001c01c1effe$a2bd9670$b402a8c0@mango">news:001c01c1effe$a2bd9670$b402a8c0@mango... No...remove the semi-colon to uncomment it. Restart your web server. Create a page that has just the following line in it: ?phpinfo();? Save it to a file with a .php extension and call it up through your web server. Examining that page will tell you what modules are loaded. ---John Holmes... -Original Message- From: Arpan De [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 6:09 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] What's wrong Hi John, Thanks for your prompt reply. I am using PHP 4.2.0 version. I checked the PHP.ini file where it is given the following: ;Windows Extensions ;Note that MySQL and ODBC support is now built in, so no dll is needed for it. ; ;extension=php_bz2.dll ... ... ;extension=php_mssql.dll which, I guess, is already uncommented. What do I do now to execute some transaction with SQL Server 7.0? Also what do I search for in phpinfo()? Regards, Arpan John Holmes [EMAIL PROTECTED] wrote in message 001901c1effa$ec9c8e30$b402a8c0@mango">news:001901c1effa$ec9c8e30$b402a8c0@mango... You don't have MSSQL support in your PHP installation. Uncomment the line in PHP.ini that loads the MSSQL .dll Use a phpinfo() file to see what modules are loaded. You're making this hard on yourself...PHP is easy to learn. ---John Holmes... -Original Message- From: Arpan De [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 5:42 PM To: [EMAIL PROTECTED] Subject: [PHP] What's wrong What is wrong with the following code? ?php $connection=mssql_connect(SQLServerName,sa,) or die(Couldn't make connection); $db=mssql_select_db(DBName,$connection); $sql=SELECT FName,LName,UserID FROM tblName ORDER BY FName; $sqlResult=mssql_query($sql,$connection); while($row=mssql_fetch_array($sqlResult)){ $firstname=$row[FName]; $lastname=$row[LName]; $userid=$row[UserID]; echo(tr); echo(td$firstname/td); echo(td$lastname/td); echo(td$userid/td); echo(/tr); } mssql_free_result($sqlResult); mssql_close($connection); ? When the above code is executed, I am getting the following error: Fatal error: Call to undefined function mssql_connect() which points to the 2nd line in the code. Even the die() function doesn't get executed. I just copied pasted the code from a tutorial I found on the web but am still getting this error !!! Is learning PHP so frustrating? I have never encountered such frustration while learning any other software languages. It's making me too dependent on this newsgroup !!! Sometimes it does happen that in other languages, if you are getting an error, one can overcome that particular error by employing some trial error methods but whatever whenever I have tried to do the same in PHP, I could never overcome the error. Thanks, Arpan -- 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
FW: [PHP] remove last character in a string
its my understanding that you wish to strip the last character of the string not return it. Putting -1 in the length parameter will just return the last character, it wont get rid of it $string = This is the string,; $str_length = strlen($string); if (substr($string,0,-1) == ,) { //Strip $formatted_str = substr($string,0,str_length-1); } else { //Dont strip // } That should work but I didnt test it ;) Regards Jarrad Kabral -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 23 April 2002 1:57 PM To: Evan Nemerson; [EMAIL PROTECTED] Subject: Re: [PHP] remove last character in a string Because I'm kinda stupid. :) tyler - Original Message - From: Evan Nemerson [EMAIL PROTECTED] To: Tyler Longren [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, April 22, 2002 10:53 PM Subject: Re: [PHP] remove last character in a string Why get strlen involved??? $string = substr($string, 0, -1); -- He is richest who is content with the least, for content is the wealth of nature. Socrates -- 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