Re: [PHP-DB] PHP/Mysql search
Miguel Guirao wrote: CREATIVITY is what you are looking for. What do you mean by CREATIVITY? -J -Original Message- From: Eustace [mailto:[EMAIL PROTECTED] Sent: Lunes, 22 de Mayo de 2006 07:59 a.m. To: php-db@lists.php.net Subject: [PHP-DB] PHP/Mysql search Hello, Please be patient and assist meI am building a web application where a search function is required. I have a number of drop down lists from which a user has to select what they are searching for..they may choose to do a multi-fields search or search only one. Are there any resources you can point me to which implements something like this? Eustace Este mensaje es exclusivamente para el uso de la persona o entidad a quien esta dirigido; contiene informacion estrictamente confidencial y legalmente protegida, cuya divulgacion es sancionada por la ley. Si el lector de este mensaje no es a quien esta dirigido, ni se trata del empleado o agente responsable de esta informacion, se le notifica por medio del presente, que su reproduccion y distribucion, esta estrictamente prohibida. Si Usted recibio este comunicado por error, favor de notificarlo inmediatamente al remitente y destruir el mensaje. Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Radiomovil Dipsa, S.A. de C.V. o alguna de sus empresas controladas, controladoras, afiliadas y subsidiarias. Este mensaje intencionalmente no contiene acentos. This message is for the sole use of the person or entity to whom it is being sent. Therefore, it contains strictly confidential and legally protected material whose disclosure is subject to penalty by law. If the person reading this message is not the one to whom it is being sent and/or is not an employee or the responsible agent for this information, this person is herein notified that any unauthorized dissemination, distribution or copying of the materials included in this facsimile is strictly prohibited. If you received this document by mistake please notify immediately to the subscriber and destroy the message. Any opinions contained in this e-mail are those of the author of the message and do not necessarily coincide with those of Radiomovil Dipsa, S.A. de C.V. or any of its control, controlled, affiliates and subsidiaries companies. No part of this message or attachments may be used or reproduced in any manner whatsoever. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Adding url to google
Manoj Singh wrote: Hi all, I am developing the site using php and mysql. I have to add the url at google site through php code. If any one have idea about it, please help me. PHP is server-side technology. Google will never see it. The matter of placing your site in a search engine is a whole industry called search engine optimization or SEO. You can submit your site (manually) to Google here: http://www.google.com/addurl/?continue=/addurl If you want to submit all the pages on your site to google, you should consider: Google site maps - https://www.google.com/webmasters/sitemaps/login?utm_campaign=sitemaps-us-sbmtcntutm_source=EM Google Base - http://base.google.com/base Froogle - For ecommerce sites. It looks like submissions to Froogle are made thru Google Base. http://www.google.com/sellonfroogle/ Hope that helps, --J -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] preg_replace help!
Nathan Heaps wrote: I am trying to parse a forum post using php, but it parses it everytime it sees the letter, not the thing in quotes. What letter? What thing in quotes? -J -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Example of mail()
Renzo Clavijo wrote: I know it's very simple but the question is: How can I erase the values held in $_REQUEST such that when I press F5 or I click Reload there are no messages sent again? ?php if(isset($_REQUEST['send_mail'])){ mail($_REQUEST['address_mail'],$_REQUEST['subject'] $_REQUEST['message']); } benmoreassynt wrote: I would try something like this: if(isset($_REQUEST['send_mail'])) { mail($_REQUEST['address_mail'],$_REQUEST['subject'] $_REQUEST['message']); unset($_REQUEST); } That should wipe all the variables in $_REQUEST before the user clicks reload. It will not work on a global variable if you use it inside a function. There are other ways to do the same thing, but I think that should do it. No. That won't work. The variables will be sent to the server all over again when the user reloads after sending the original email. I guess the simplest solution is to do a redirect to a confirmation page after sending the mail. That way a reload will not be reloading the post but the confirmation page. This won't prevent malicious spam. For that you will need to issue a token and track submissions by token (and/or IP address). (Also, please note: --Your form tag lacks an 'action' property. --You are not doing any validation of your input fields. --By allowing the user to input the TO address, you are essentially offering all the word an open relay for transmitting spam. This makes you evil. May you soon be cut off by your ISP. Or repent and find salvation :) ) -J -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] capture a webpage to later process it
John Hicks wrote: J. Alejandro Ceballos Z. -JOAL- wrote: I want to read the results of an URL address, to later process it and insert part of them as internal code. If I use include or require, they inserts ALL the resulting code, but I want to do something like: blah, blah, blah ?php $result_webpage = somephpfunc('http://other.sit/externalpage.html'); if (eregi(result:([:alnum:]+).*([:alnum:]+\.jpg),$result_webpage,$array_match)) { echo h2External status:.$array_match[1].brimage: img src=\..$array_match[2].\/h2; } ? blah, blah, blah If you have fopen wrappers enabled (see http://us2.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen) then you can simply use file_get_contents() to read the web page into a string. You can then manipulate it with regexes like so: $Url = 'http://www.php.net'; $ThePageContents = file_get_contents($Url); $TheNewPageContents = preg_replace('/PHP/', 'Ruby :)', $ThePageContents); echo $TheNewPageContents; --J Here's a more useful use of the same idea: ?php if (isset($Url)) { $ThePageContents = file_get_contents($Url); $TheNewPageContents = preg_replace( '/(head[^]*)/', \1base href='$Url/' /, $ThePageContents); echo $TheNewPageContents; } else { echo Enter a URL as a query string in this URL, e.g.: br /a href=\${_SERVER['PHP_SELF']}?Url=http://www.yahoo.com\; http://${_SERVER['SERVER_NAME']}${_SERVER['PHP_SELF']}?Url=http://www.yahoo.com/a; } ? This allows you to run your own rather sloppy proxy. Just plug the url you want into the query string for your page (or, better still, make a form to post it): https://mydomain.com/mypage.php?Url=http://DomainIWantToView.com/PageIWantToView.html The regex adds a base tag to the remote web page to make the images and links work. But of course, that means the gets of all the images, css, js, etc. will all show up with your workstation IP on the remote server's log (and on your boss's log of your browsing), so you haven't really accomplished much :( But it's kind of fun, huh? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] capture a webpage to later process it
J. Alejandro Ceballos Z. -JOAL- wrote: I want to read the results of an URL address, to later process it and insert part of them as internal code. If I use include or require, they inserts ALL the resulting code, but I want to do something like: blah, blah, blah ?php $result_webpage = somephpfunc('http://other.sit/externalpage.html'); if (eregi(result:([:alnum:]+).*([:alnum:]+\.jpg),$result_webpage,$array_match)) { echo h2External status:.$array_match[1].brimage: img src=\..$array_match[2].\/h2; } ? blah, blah, blah If you have fopen wrappers enabled (see http://us2.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen) then you can simply use file_get_contents() to read the web page into a string. You can then manipulate it with regexes like so: $Url = 'http://www.php.net'; $ThePageContents = file_get_contents($Url); $TheNewPageContents = preg_replace('/PHP/', 'Ruby :)', $ThePageContents); echo $TheNewPageContents; --J -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Single quotes in INSERT statements?
Martin Alterisio wrote: 1) Check that the string is not being truncated because of the column length 2) If you're seeing this data being truncated in the html output of your site, check if it isn't being caused by outputing the data without properly encoding special html characters. 3) . dunno Do a select directly from the mysql console (bypassing php) to verify that the data is really truncated in the db and not in the output process (per Martin's suggestion. --John 2006/4/25, Skip Evans [EMAIL PROTECTED]: Hello all, I'm brand spanking new to the list and have a quick question. I was under the impression that addslashes() would handle single quote marks in INSERT statements, but when I execute the following: $sql=UPDATE images SET orderno=$orderno, url='.addslashes($url).', banner=$banner,caption='.addslashes($caption).' WHERE imageID=$imageID; ...and $caption contains something like: Don't look ...the data is chopped off at the single quote mark. How, if not addslashes(), does one handle this? Thanks! -- Skip Evans Big Sky Penguin, LLC 61 W Broadway Butte, Montana 59701 406-782-2240 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] is this a problem ?
amol patil wrote: hallo, i have changed file signup1.php with login1.php, in action fied of form form name=form1 method=POST action=-- and saved . but when i run this file and click on submit button, it still shows old sighnup1.php. and data is also not entering in database. while it data was entering in databse before this. but not now with this change. no error shown. only shows previous page and no data entry Amol: Please slow down and do some basic debugging as Cpt. Holmes suggests. You need to be able to trace your form submittal every step of the way. You can do this by carefully observing your browser, page source (as it is received by your browser), your browser's Javascript console, your server logs (both access and error logs). You should insert debug statments in your script as necessary so you can tell exactly what is happening. You have not responded to my previous reply, namely: --Are you getting any messages in your webserver error log when you click on 'submit'? (And let me add: Are you even getting a second hit on your webserver access log when you submit your form? You may not be leaving the browser when you click on submit.) --Try including an 'else' in your 'if' statement (along with a debug message) so you can see if the 'submit' is detected by your script when the form is submitted. -John -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] check out this , if block is not executing ............
amol patil wrote: hallo , entered information still not shown in table of database is below code is right ? form name and type values are 'submit' . then what is wrong with this code, ?php if(isset($_POST['submit'])) { $dbh=mysql_connect (localhost, root) or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db (dollar1_allinfo); mysql_query(INSERT INTO totalinfo (Username,Password) VALUES ('$loginusername','$loginpassword'))or die (mysql_error()); } ? Are you getting any error messages when you click on 'submit'? (Check your php log.) Include an 'else' in your if statement (along with a debug message) so you can see if the 'submit' is detected. -John -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] How to troubleshoot MySQL Error 1040: Too many processes
I need a little direction for troubleshooting a problem I'm having with PHP and MySQL. Twice recently my little homebrew PHP/MySQL content management system has essentially crashed when MySQL starts returning a 1040 error: Too many connections. Restarting MySQL fixes things ... for a little while at least. Currently I am trying to manage the situation by monitoring the process count and restarting mysqld whenever the count gets high, but I need to get a better handle on what is going on. I'm running Apache 1.3.27, PHP 4.1.2, and MySQL 3.23.41. Most of my connections are made with PHP's mysql_pconnect. My understanding is that each Apache/PHP process will reuse a connection made with mysql_pconnect. If so -- and assuming one db connection per http response -- I would expect there to be a correspondance between the number of Apache processes and mysqld processes. This isn't the case. One day after restarting MySQL and httpd, Apache has 21 processes running and mysqld has 62 processes. Is this an indication of a problem or am I barking up the wrong tree? Any other suggestions for troubleshooting? Thanks in advance, --John -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php