Re: [PHP] Display Query Result As Editable Form
input type=text name=name value=?=$value? [EMAIL PROTECTED] wrote: Hi all, I am creating a user form whereby I will do an INSERT , SELECT , UPDATE and of course DELETE for the form. Right now I am trying to create a form whereby when user choose to update their info, they wil be directed to a form where the fields region are EDITABLE , before that, the fields should contain their old info...so can i know how should i go about creating this kinda Editable fields using php scripting ???Fields should contain old info retrieved from the DB.Anyone have any idea?? Realli need some help here. Thanks in advance =) Irin. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Fwd: failure notice]
Does someone know why do I receive such messages each time I post to the list ?!? Original Message Subject:failure notice Date: 10 Dec 2003 09:42:41 - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Hi. This is the qmail-send program at pb1.pair.com. I'm afraid I wasn't able to deliver your message to the following addresses. This is a permanent error; I've given up. Sorry it didn't work out. [EMAIL PROTECTED]: This message is looping: it already has my Delivered-To line. (#5.4.6) --- Below this line is a copy of the message. Return-Path: [EMAIL PROTECTED] Received: (qmail 55196 invoked from network); 10 Dec 2003 09:42:41 - Received: from unknown (HELO c2bapps17.btconnect.com) (193.113.154.33) by pb1.pair.com with SMTP; 10 Dec 2003 09:42:41 - Received: from gateway.btopenworld.com (actually host 185.136.40.217.in-addr.arpa) by dswu194 with SMTP-CUST (XT-PP) with ESMTP; Wed, 10 Dec 2003 09:42:27 + Received: from gateway (127.0.0.1) by gateway.btopenworld.com (Worldmail 1.3.167) for [EMAIL PROTECTED]; 10 Dec 2003 09:51:26 + Delivery-Date: Wed, 10 Dec 2003 09:37:46 + Received: from pb1.pair.com (actually host 4.131.92.216.in-addr.arpa) by dswu231 with SMTP (XT-PP); Wed, 10 Dec 2003 09:37:44 + Received: (qmail 44080 invoked by uid 1010); 10 Dec 2003 09:36:43 - Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:[EMAIL PROTECTED] Delivered-To: mailing list [EMAIL PROTECTED] Received: (qmail 44067 invoked by uid 1010); 10 Dec 2003 09:36:43 - Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] Message-ID: [EMAIL PROTECTED] Date: Wed, 10 Dec 2003 10:37:10 +0100 From: Sophie Mattoug [EMAIL PROTECTED] User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031107 Debian/1.5-3 X-Accept-Language: fr-fr MIME-Version: 1.0 To: [EMAIL PROTECTED] References: [EMAIL PROTECTED] In-Reply-To: [EMAIL PROTECTED] Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP] Display Query Result As Editable Form input type=text name=name value=?=$value? [EMAIL PROTECTED] wrote: Hi all, I am creating a user form whereby I will do an INSERT , SELECT , UPDATE and of course DELETE for the form. Right now I am trying to create a form whereby when user choose to update their info, they wil be directed to a form where the fields region are EDITABLE , before that, the fields should contain their old info...so can i know how should i go about creating this kinda Editable fields using php scripting ???Fields should contain old info retrieved from the DB.Anyone have any idea?? Realli need some help here. Thanks in advance =) Irin. -- 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] [Fwd: [ERR] [PHP] [Fwd: failure notice]]
Even worse ! Admin of the list, please take some action ! Original Message Subject:[ERR] [PHP] [Fwd: failure notice] Date: Wed, 10 Dec 2003 18:45:17 +0900 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Transmit Report: To: [EMAIL PROTECTED], 402 Local User Inbox Full ([EMAIL PROTECTED]) ---BeginMessage--- Does someone know why do I receive such messages each time I post to the list ?!? Original Message Subject:failure notice Date: 10 Dec 2003 09:42:41 - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Hi. This is the qmail-send program at pb1.pair.com. I'm afraid I wasn't able to deliver your message to the following addresses. This is a permanent error; I've given up. Sorry it didn't work out. [EMAIL PROTECTED]: This message is looping: it already has my Delivered-To line. (#5.4.6) --- Below this line is a copy of the message. Return-Path: [EMAIL PROTECTED] Received: (qmail 55196 invoked from network); 10 Dec 2003 09:42:41 - Received: from unknown (HELO c2bapps17.btconnect.com) (193.113.154.33) by pb1.pair.com with SMTP; 10 Dec 2003 09:42:41 - Received: from gateway.btopenworld.com (actually host 185.136.40.217.in-addr.arpa) by dswu194 with SMTP-CUST (XT-PP) with ESMTP; Wed, 10 Dec 2003 09:42:27 + Received: from gateway (127.0.0.1) by gateway.btopenworld.com (Worldmail 1.3.167) for [EMAIL PROTECTED]; 10 Dec 2003 09:51:26 + Delivery-Date: Wed, 10 Dec 2003 09:37:46 + Received: from pb1.pair.com (actually host 4.131.92.216.in-addr.arpa) by dswu231 with SMTP (XT-PP); Wed, 10 Dec 2003 09:37:44 + Received: (qmail 44080 invoked by uid 1010); 10 Dec 2003 09:36:43 - Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:[EMAIL PROTECTED] Delivered-To: mailing list [EMAIL PROTECTED] Received: (qmail 44067 invoked by uid 1010); 10 Dec 2003 09:36:43 - Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] Message-ID: [EMAIL PROTECTED] Date: Wed, 10 Dec 2003 10:37:10 +0100 From: Sophie Mattoug [EMAIL PROTECTED] User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031107 Debian/1.5-3 X-Accept-Language: fr-fr MIME-Version: 1.0 To: [EMAIL PROTECTED] References: [EMAIL PROTECTED] In-Reply-To: [EMAIL PROTECTED] Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP] Display Query Result As Editable Form input type=text name=name value=?=$value? [EMAIL PROTECTED] wrote: Hi all, I am creating a user form whereby I will do an INSERT , SELECT , UPDATE and of course DELETE for the form. Right now I am trying to create a form whereby when user choose to update their info, they wil be directed to a form where the fields region are EDITABLE , before that, the fields should contain their old info...so can i know how should i go about creating this kinda Editable fields using php scripting ???Fields should contain old info retrieved from the DB.Anyone have any idea?? Realli need some help here. Thanks in advance =) Irin. -- 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 ---End Message--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Constraint Violation when INSERT
Hi all, I got the error Constraint Violation when I did an INSERT . Gone thru the code umpteen times but to no avail..Wondering where my error was??...Below is a snip of the block of code: ? $dsn = mysql://root:[EMAIL PROTECTED]/tablename; $db = DB::connect ($dsn); if (DB::isError ($db)) die ($db-getMessage()); //create variables ready to go into DB $tutor_name = $db-quote($_POST[tutor_name]); $tutor_contact = $db-quote($_POST[tutor_contact]); $tutor_email = $db-quote($_POST[tutor_email]); $tutor_profile = $db-quote($_POST[tutor_profile]); $sql = INSERT INTO tutor (tutor_name, tutor_contact, tutor_email, tutor_profile)VALUES ($tutor_name,$tutor_contact,$tutor_email,$tutor_profile); $result = $db-query($sql); if( DB::isError($result) ) {die ($result-getMessage()); } ? -- - Everything was fine and the INSERT works, user input was insert into the database successful using the same block of code but the next thing i know I got this error anyone know watz the proz here??? Hope to get some help soon. Thanks in advance=) Irin. It looks like you have a constraint in your table, ie some of the values must correspond to another receord of another table for example... Could you post a MySQL description of your table ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simple php search
Paul Duggan wrote: if I create a text box: body form action=nextpage.html method=GET name=myform input type=Text name=surname align=TOP size=25br input type=Submit value=Submit align=MIDDLE /form how do I go about extracting a surname from a mysql database? will it be something along the lines? select firstname,surname from employees where surname = textbox.surname; SELECT firstname, surname FROM employees WHERE surname = '{$_GET['surname']}' new to this so im trying to get my head around it, basically i just want to search a mysql database by someones surname. cheers! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Execute a linux binary that generates a registration code...
See www.php.net/passthru Karam Chand wrote: Hello I have got an app wherein you need to pass a name as the first parameter and it will output that is cout a registraion code for my app based on the name. I would like to give a web based interface wherein a user can give his name on the form and I will be able to generate the code from PHP. I tried the commands - exec(), shell_exec() but none seems to getting the output. in the shell i execute it as - ./appname karam the output is something like a223asas2323 ? How can i get the output. any ideas.. thanks in advance.. Karam __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] BLOB - PHP Peformance DB vs. Web server Opinions
Ahbaid Gaffoor wrote: Thanks to all who helped with my earlier questions on pulling BLOB data out of Oracle using PHP. I am however finding that performance is slow when downloading huge files from the database. A typical 2Meg GIF file being downloaded from Oracle via. PHP is taking about thirty seconds. Everything (database, web server, development box) are all on a 100 Megabit Switched ethernet setup. 1) Are there any pitfalls or guidelines when working with BLOBs and web apps? 2) Is there any advice for or against storing images as blobs in a database? Or is it better to store them on the web server file system? So far I am finding the web server file system to be faster, but I tend to think that it is less manageable from a relational data perspective. thoughts? thanks Ahbaid Hi For me it's obvious that storing any data (an image a fortiori) in a file is always (please, other list-members, tell if I'm wrong) faster than extracting from a database. Hope this helps, -- Cordialement, --- Sophie Mattoug Développement web dynamique [EMAIL PROTECTED] --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How does one run PHP scripts in 'silent mode' ???
Jay Blanchard wrote: [snip] I am running php as an apache module, which is why I used 'START' in exec(START http://blablalga;. Not sure if this is the correct way of doing it but I cannot use -q with start. [/snip] What is it that you are trying to accomplish? Then perhaps I can better help. Even if php is an Apache module there still should be a path to the PHP executable (type 'which php') and you will not need the http://foo Sorry but no : when php is an apache-module, there's no executable (only a .so library) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CHMOD...
Jay Blanchard wrote: [snip] Is there anyway to use CHMOD: chmod (/somedir/somefile, 0755); but have it set all files, folders etc to the CHMOD setting I want? I have a folder, and within that, I wanna quickly, jsut set it all to CHMOD 777. all sub DIR's and files etc... can it be done simply? E.G. : chmod (/somedir/%, 0755); [/snip] Danger, Danger!! [tm] Yes you can, but 'tis not a swell idea. You can exec the chmod command exec(chmod 0777 /directory/*); Better : exec(chmod -R 0777 /directory); You still cannot set all sub directory and files within those permissions. Best to loop through and set each as needed, don't forget to cahnge them back. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] International Addresses and Telephones
I can tell you for France : zip code : 5 digits (may begin by '0') state : not relevant phone number : 10 digits or +33 and 9 digits Rankin, Randy wrote: I have a form which captures US addresses ( address, city, state ) and telephone numbers ( 10 digit ) and am writing this data to a MySQL table. I need to expand this to capture non-US info, so I was hoping for some guidance on forms and table structures. I have googled this to death and still haven't come up with anything. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] wrapping PHP around Chinese characters
Would it be possible you have a problem with line-feeds while uploading from win ti linux ? -- Cordialement, --- Sophie Mattoug Développement web dynamique [EMAIL PROTECTED] --- See Kok Boon wrote: Hellox experts.. I am making a quiz for a Chinese website. the PHP I going to use is to be wrapped together with the chinese character outputs all in a single file. For an example... In quiz.php If(YOUR_ANSWER_IS_CORRECT) { print in chinese: you scored full marks //output } else { print in chinese: please try again //ouput } the outputs are Chinese characters. The problem I have now is that either I can't output Chinese, or the code doesn't work. - I am developing this quiz on windows XP then uploading to Linux server. - The code editor I use dun support any other formats than ANSI. - MS WORD generates whole lot of rubbish for html documents and dun handle PHPs - Dreamweaver doesn't give me a clue on how to do it... - so far notepad is the best. I can save the file as .php .html or .txt in ANSI or UNICODE formats. In notepad, I can input Chinese characters together with the PHP code wrapped around. If I save in ANSI, the result online is that the code works, but the output doesn't. if I save in Unicode, which notepad advices me to, then the code cannot work and all the output regardless of the IF branches, are output-ted. What else can I do? The strange thing is that when in Unicode format, the PHP code doesn't show, only the outputs are displayed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Community Site - Volunteers Needed
The French php community has its site already : http://www.communautephp.com. Myabe it can give you some ideas... Chris Shiflett wrote: PHP has one of the largest developer communities in the world, yet we have no community gathering place like those you can find for other languages (Perl has http://use.perl.org/, for example). Want to help change this? Read on. Don't care? Click delete. :-) I am coordinating the development of a Web site that is built by and for the PHP community. Its features will include such things as: 1. Personal blogs for all registered users 2. Frequent community news and user comments (Slashdot style) 3. Weekly summaries of key mailing lists (such as php-general) 4. Weekly summaries of other news from related communities 5. News from various user groups (such as NYPHP) 6. Links, FAQs, articles, tutorials, and other helpful documentation More importantly, the features will be driven by the needs of the community and not any one person. This list is just an example of the most common features found on other community sites. Will this site seek to eliminate other PHP sites that offer one or more of these features already? Absolutely not. My hope is to help bring the community together, both the people in the community as well as all related Web sites. I have spoken with O'Reilly, and they have agreed to support us in this endeavor with servers, bandwith, administration, and anything else we need. All we have to do is provide the people to develop and maintain the site and its content. You don't have to be an expert to help out. I need people to fill the following roles (multiple people can fill the same role and a single person can fill multiple roles): 1. Site management and global vision 2. Coding standards creation and software architecture 3. Security audits and general guidance 4. Weekly summary of php-general 5. Weekly summary of php-internals 6. Weekly summary of general community news 7. News item selection and posting (users can submit suggested news) 8. Database design 9. Software development (PHP, Perl, etc.) 10. PHP user group representatives (updated news from your group) 11. Content writers (FAQs, articles, tutorials, etc.) 12. Graphic designers, user interface specialists, etc. 13. Translators There are likely many other roles to be filled. If you think you can help out a lot, please consider the first role, site management and global vision. If you want to help but don't feel like you fit into any specific role, don't worry about it (any help is very much appreciated). There will be mailing lists, CVS, and other tools available to assist in the creation of this site. More information about these things will be given to those who are interested in being involved. Please send me an email at [EMAIL PROTECTED] if you are willing to help. Mention where you are interested in helping and any information about yourself that you think is important. This information is not intended to determine whether anyone is worthy or any silliness like that, but it is rather to help organize the contributors so that everyone is doing something they enjoy. Thanks for your attention. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Finding array in MySQL (I'm not asking the right question)
You can do something like $str = '.implode(', ', $arr).'; $query = SELECT * FROM table WHERE id IN ($str); Hope this helps, -- Cordialement, --- Sophie Mattoug Développement web dynamique [EMAIL PROTECTED] --- Dave G wrote: PHP Gurus, What I'm trying to do must be both common and simple, but I'm not asking the question right because I can't find the answers in Google or the online PHP manual using the search words like array, find, PHP, MySQL, etc... I have an array, and I want to select the fields in a table that match the contents of the array. The array consists of a set of user IDs. I want to find their emails from the table in a MySQL database which stores all their contact information. Sounds simple, right? Well, SELECT email FROM table WHERE id = . $array . ); isn't cutting it. I'm a total beginner, but I can understand why this doesn't work without being able to fix it. The data inside the array needs to be extracted into the set of ids it contains so that MySQL can read it. So I could run a while() loop and query the database for each id in the array, but that's obviously totally inefficient. There must be a command which handles this kind of thing. It's not explode(), it's not in_array()... I know what I'm after, but I just can't come up with the search term or phrasing which will allow a search engine to help me find it. Can someone please point me in the right direction? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Finding array in MySQL (I'm not asking the right question)
Dave G wrote: Is this method faster than just using IN and implode()? Thanks to all who replied. I believe I have found what I'm looking for in using the implode() command. My assumption is that it was faster and more efficient to try and do as much processing on the PHP side and make as few queries to the database as possible. Is that a correct assumption, or am I wrong there? Totally wrong ! It's always better to have maximum work done by MySQL Hope this helps, -- Cordialement, --- Sophie Mattoug Développement web dynamique [EMAIL PROTECTED] --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] regular expression, image, name, alt, title, preg_match_all
Adam i Agnieszka Gasiorowski FNORD wrote: I'm trying to develop a regex for matching with preg_match_all, I want to match such things like image name, image alt text, image title in construct like this: html... div class=class style=style img src=img=name alt=alt title=title / span class=class style=style text /span /div html... The rexex as for now is: define( 'REGEX_IMAGE_NAMES_AND_TITLES_AND_ALTS_FROM_CONTENT', '{ (?:\s*img\s+src\s*=\s*(?:|\')?\s*(?:img)?\s*=\s*) # img (?\b\S+\b) # name (?:title\s*=\s*(?:|\')) # title (?\b\S*\b) (?:|\')*\s* (?:alt\s*=\s*(?:|\'))# alt (?\b\S*\b) (?:|\')*\s* (?:\|\'||/|\s) # img / }Uix' ); , but it does not match. How can I fix it? It's not so easy to match an entire IMG tag, because first of all the attributes are not always in the same order. If I were you, this is what I would do : ereg(img ([^]+), $your_text, $img_array); $i = 0; foreach ($img_array as $img) { while (ereg(^(.+)=\(.+)\, , $img, $regs)) $images[$i][$regs[1]] = $regs[2]; $i++; } Hope this helps, -- Cordialement, --- Sophie Mattoug Dveloppement web dynamique [EMAIL PROTECTED] --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] include-problem
Victor Spng Arthursson wrote: Hi! I'm having a problem with including files. What I want to achieve is to execute a PHP-script on another server, and then to include the result (which will be XML-output) in another PHP-script (currently on my local computer). On the server I have the file http://server.com/test/echo.php with the content --- ?php echo 'xyz'; ? --- Locally I've a file with the following content: --- ?php echo !!!; include (http://server.com/test/echo.php;); echo ???; ? --- I was expecting the output from my locally testfile to be something like: --- !!!??? --- but rather it is --- !!!xyz??? --- I've also tried with a $fp = readfile(http) with the same result, which is output of the echo-statement in the remote file which I am expecting to be evaluated remotely. How can I do to include the PHP-script and have it to be ran before it is included? Sincerely Victor This is a perfectly normal behaviour ! See www.php.net/include to understand what this function does. (comparing to www.php.net/require) Hope this helps, -- Cordialement, --- Sophie Mattoug Dveloppement web dynamique [EMAIL PROTECTED] --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] regular expression, image, name, alt, title, preg_match_all
Sophie Mattoug wrote: Adam i Agnieszka Gasiorowski FNORD wrote: I'm trying to develop a regex for matching with preg_match_all, I want to match such things like image name, image alt text, image title in construct like this: html... div class=class style=style img src=img=name alt=alt title=title / span class=class style=style text /span /div html... The rexex as for now is: define( 'REGEX_IMAGE_NAMES_AND_TITLES_AND_ALTS_FROM_CONTENT', '{ (?:\s*img\s+src\s*=\s*(?:|\')?\s*(?:img)?\s*=\s*) # img (?\b\S+\b) # name (?:title\s*=\s*(?:|\')) # title (?\b\S*\b) (?:|\')*\s* (?:alt\s*=\s*(?:|\'))# alt (?\b\S*\b) (?:|\')*\s* (?:\|\'||/|\s) # img / }Uix' ); , but it does not match. How can I fix it? It's not so easy to match an entire IMG tag, because first of all the attributes are not always in the same order. If I were you, this is what I would do : ereg(img ([^]+), $your_text, $img_array); $i = 0; foreach ($img_array as $img) { while (ereg(^(.+)=\(.+)\, , $img, $regs)) $images[$i][$regs[1]] = $regs[2]; $i++; } Hope this helps, Sorry I made a mistake. Better do this: ereg(img ([^]+), $your_text, $img_array); $i = 0; foreach ($img_array as $img) { while (ereg(^(.+)=\(.+)\(.+)$, , $img, $regs)) { $images[$i][$regs[1]] = $regs[2]; $img = $regs[3]; } $i++; } -- Cordialement, --- Sophie Mattoug Dveloppement web dynamique [EMAIL PROTECTED] --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Capturing $_POST variables
foreach ($_POST as $k = $v) { //everything you want to do } Shaun wrote: Hi, is it possible to capture $_POST variables sent from a previous page so i can send them on to the next page? Thanks for your help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Capturing $_POST variables
Shaun wrote: Thanks you for your replies, is there a reason why i couldn't use the following? $_POST = $_POST; You want to assign to the $_POST array of the third page the value of the $_POST of the seconde one ? You cannot do the way you wrote because it's not on the same page ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to retrieve data from a web page
See these pages www.php.net/fopen and www.php.net/file good luck! Nitin wrote: hi all, I've a situation, where i want to supply some data to my script, which is dynamic and is available on a web page. How can i fetch that particular data from a page, if there's a way... Thanx in advance. Nitin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP script that fills forms ?
Anonymous wrote: I was just wondering if it's possible to get a PHP script to fill a form for you? You see, I'm trying to make PHP fetch a password protected website for me and there's a form with username and password that protects it. Can anyone help me? Perhaps give me another sollution? echo 'input type=text name=name value=' . $value . '; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP script that fills forms ?
form-filling is client-side, php is server-side = i don't see any solution for your problem... Anonymous wrote: Well, you see. I didn't mean it that way. I meant PHP to fetch a website. The website is password protected and you need to fill a form to access it. So I would like PHP to fill that form for me. Would that be possible? Are there any other solutions? Sophie Mattoug [EMAIL PROTECTED] skrev i melding news:[EMAIL PROTECTED] Anonymous wrote: I was just wondering if it's possible to get a PHP script to fill a form for you? You see, I'm trying to make PHP fetch a password protected website for me and there's a form with username and password that protects it. Can anyone help me? Perhaps give me another sollution? echo 'input type=text name=name value=' . $value . '; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Could some one check my code
PAUL FERRIE wrote: i am getting this error returned but i dont know why :( error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/pferrie/public_html/vinrev/adm/insert2.php on line 6 php file ?php include(connection.php); if(!empty($rating)){ $query=SELECT * FROM $tablename WHERE rating = '$rating'; if(mysql_query($query)) { $myrow = mysql_fetch_array($query);// This line returns an error! you sould write : if ($result = mysql_query($query)) { $myrow = mysql_fetch_array($result); Hope this helps -- Cordialement, --- Sophie Mattoug Développement web dynamique [EMAIL PROTECTED] --- $id = $myrow ['id']; echoError! There is another row in the database with a rating value of $rating\n You must first edit the row with a rating of $rating ! Row id = $idbrbr; echoa href='edit2.php?tablename=$tablenameid=$id'Edit record/abr; } }else { if(!empty($_FILES['userfile']['tmp_name'])) { $name = strtolower(eregi_replace('#| |\?|!', '', $_FILES['userfile']['name'])); $destination = 'img/'.$name; if(move_uploaded_file($_FILES['userfile']['tmp_name'], $destination)) { $picture=$destination; $query = INSERT INTO $tablename (artist, title, picture, review, label, format, price, rating)VALUES ('$artist', '$title', '$picture', '$review', '$label', '$format', '$price', '$rating'); if(!mysql_query($query)) { fail(Error updating DB1); } Header(Location: main.php?success=New row has been inserted into the database); } } if(empty($userfile)) { $query2 = INSERT INTO $tablename (artist, title, picture, review, label, format, price, rating)VALUES ('$artist', '$title', '$picture', '$review', '$label', '$format', '$price', '$rating'); if(!mysql_query($query2)) { fail(Error updating DB2); } Header(Location: main.php?success=New row has been inserted into the database); } } ? I am trying to check for a duplicate entry for rating and if one is found grab the row ID and then use it to load the edit page for the row. Anyone Cheers Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add Reply-To to this list(s)
Wouldn't it be possible to stop this troll ? Or go on, but in private between people who are interested by this matter... Thanks Jay Blanchard wrote: [snip] If you would stop using M$ Outlook and switch to a better mail client that supports mailing lists, your problem would be solved.[/snip] As has been said several times, not all can do this. True. But maybe instead of *switching* they can just use *another* mail client for mailing lists? ;) [/snip] Depends. Some corps would allow the installation of additional mail clients, some would not. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect() : undefined function
If you do phpinfo(), do you see in the section names *Configure Command* this directive: --with-mysql=something ? If not, you must re-compile PHP lwith MySQL support Binay wrote: Hi all! Its really strange/weird problem for me. it says::: Fatal error: Call to undefined function: mysql_connect() in /home/abcde/dfdfdfd/incfiles/db.inc on line 24 till afternoon site was running fine with all mysql connection . but suddenly its showing that error i don know why this is coming very surprised and tensed too PHP 4.0.6 please help me out ... Thanks in advance .. Binay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stripping out all illegal characters for a folder name
Joseph Szobody wrote: Folks, I'm taking some user input, and creating a folder on the server. I'm already replacing with _, and stripping out a few known illegal characters (', , /, \, etc). I need to be sure that I'm stripping out every character that cannot be used for a folder name. What's the best way to do this? Do I have to manually come up with a comprehensive list of illegal characters, and then str_replace() them one by one? I think you should use the reverse solution : have a list of authorized characters and strip out all others ones. There's gotta be a better way to do this... Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add Reply-To to this list(s)
And mly opinion is it's _really_ _very_ useful (I just sent my message to someone instead of the list! Gr Annoying!) Sophie Mattoug wrote: It's the way we do on [EMAIL PROTECTED], and everything is fine ! David T-G wrote: Thomas -- ...and then Thomas Svenson said... % % Hi, Hi! % % It would be nice if the moderator of this, and the other PHP-lists could fix % so the listserver automatically add a Reply-To header to all the mails. No it wouldn't. It would be a Bad Thing. This was just beaten to death [again] recently, as I recall, unless maybe that was munging the Subject: line instead. % % When I hit Reply my message would then automatically reply to the list and % not the author. Less hassle for me when replying and less risk of forgetting % it. Much better for you to Do It Right, perhaps including changing to a real mail program. See the archives for the full discussion. % % /T % % -- % PHP General Mailing List (http://www.php.net/) % To unsubscribe, visit: http://www.php.net/unsub.php HTH HAND now back to our regular PHP questions... :-D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strpos() act funny when searching for ]]....
Just a stupid idea : are you sure you have '' in your text and not 'gt;' ? Scott Fletcher wrote: I thought about that also, so I took your suggestion and tried it. Still doens't work... I tried those... \]]; \]\]; Scott F. Jay Blanchard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [snip] strpos() is acting a little bit funny. When I do this... --snip-- $a = strpos($data,]]); --snip-- Problem is there are ]] characters in the $data string and it just doesn't see it. Anyone know why and what is the workaround to it? [/snip] Does it need to be escaped? *shootin' from da' hip* $a = strpos($data,\]]); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Avoiding duplicate orders?
The way I do is, on the result page, to create a variable (for example $done) and I put to into the session. So if this variable already exists, I don't re-execute the form treatment code. Hope this helps -- Cordialement, --- Sophie Mattoug Développement web dynamique [EMAIL PROTECTED] --- J J wrote: What is the simplest way to avoid duplicate order entry on a form? Some people aren't patient enough to wait for the SSL/credit card processing and will click the submit button two, three, or more times causing duplicate orders. Is there a quick way to disable the submit button at least in javascript? Better yet, something quick and easy that could be done server-side without a lot of programming like cookies, database flags, etc? I've thought of a few things (like hidden variables with an order ID or cookies/flags) but this really should be a quick fix since it's not a big problem on the site. Thanks in advance for any tips or techniques! __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] stepping through alphabet
Maybe you can try this for ($letter = 'A'; $letter++; $letter = 'Z') echo a href=\?action=alphabetletter=$letter\$letter/a\n; Hope this helps Steve Buehler wrote: I am using PHP 4.3.4 and am trying to come up with a function that will step through the alphabet so that I get a menu/links that can be clicked on like below: a href=?action=alphabetletter=AA/a a href=?action=alphabetletter=BB/a a href=?action=alphabetletter=CC/a etc... I am sure that this has been done and is probably pretty easy. Any help here would be appreciated. I know that I could just create a link for each letter, but I would like to learn to do this so that I can make code shorter. Putting each letter into an array and steping through the array will work, but can it be done by telling a loop to start at A and end at Z? Thanks Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTTP Authentication thru PHP
I think I can remember semi-colon is not allowed in apache logins or passwords... Chandu Nannapaneni wrote: hello all , I'm able to get successfully http authenticated from my php scripts Ex : $header = POST /myscript.php HTTP/1.0\r\nAuthorization: Basic ; $header .= base64_encode($username:$password).\r\n; $header .= Content-type: application/x-www-form-urlencoded\r\n; $fp = fsockopen($IP, $PORT, $errno, $errstr); if ($fp) { fputs($fp, $header . $request); while (!feof($fp)) { $response .= fgets($fp, 128); } } But the above is not working when the $username contains a trailing semicolon or when the $password is starting with a semicolon, Ex: what if the $username =chandu: Is there any solution for this ? /Chandu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTTP Authentication thru PHP
Jay Blanchard wrote: Or colons. It is a Bad Practice[tm] to use any special characters in user names and/or passwords. It is not universally allowed from OS to OS I disagree with this : special characters are useful to have better passwords (more difficult to crack), but as apache stores the souples login:password_crypt, of course : is the only really forbidden character. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Counting elements in an array
$i = 0; foreach ($fruit as $k) if ('prange' == $k) $i++; (The result is $i, of course) Jeff McKeon wrote: How would I count the number of elements in an array that had a certain value? In other words, if I have $fruit = array(orange,orange,apple,bananna,orange,apple,pear); How could I get the number of elements from $fruit where the value is orange? Thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php