Re: [PHP-DB] Email Validation
On Tuesday 12 February 2002 06:19, CrossWalkCentral wrote: > I am working on a form that I have in php and am looking for some advise > on form validation or specifically email address validation so i can > insure that some one has put in a properly formatted email address Well. something like if (!eregi("^[A-Za-z0-9\_-]+@[A-Za-z0-9\_-]+.[A-Za-z0-9\_-]+.*", $email)) { echo "$email doesn't seem to be a valid e-mail address!"; } would do the job. Of course, that doesn't stop people from entering a false email address. You could do a DNS-lookup to see if the domain-part of the address really exists, too. Cheers, Markus -- Markus Lervik Linux-administrator with a kungfoo grip Vaasa City Library - Regional Library [EMAIL PROTECTED] +358-6-325 3589 / +358-40-832 6709 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] multiple forms, one submit button
You could include a hidden variable in each form with a value unique to each form - i.e. in the php script: if ($form_id == 1) { -- Process form 1 -- } elseif ($form_id == 2) { -- Process form 3 -- } elseif ($form_id == 3) { -- Process form 3 -- } else { -- $form_id is not set so show the forms -- } olinux -Original Message- From: Marius Ursache [mailto:[EMAIL PROTECTED]] Sent: Monday, February 11, 2002 11:24 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] multiple forms, one submit button hi is it posibile to have in a php script multiple forms and only one submit button? if yes, how you "recover" the submited data? ex: bla bbla bgf gjhdf tnx -- Marius Ursache (3563 || 3494) \|/ \|/ "@'/ ,. \`@" /_| \__/ |_\ \__U_/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] multiple forms, one submit button
hi is it posibile to have in a php script multiple forms and only one submit button? if yes, how you "recover" the submited data? ex: bla bbla bgf gjhdf tnx -- Marius Ursache (3563 || 3494) \|/ \|/ "@'/ ,. \`@" /_| \__/ |_\ \__U_/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] protecting
correct! On Tue, 12 Feb 2002, Beau Lebens wrote: > you might find the library at http://www.dentedreality.com.au/jsvalidation/ > useful, but you should also perform similar checks server-side using PHP > since if you are that worried about malicious use of your site, people can > easily circumvent javascript validation > > // -Original Message- > // From: Mihail Bota [mailto:[EMAIL PROTECTED]] > // Sent: Tuesday, 12 February 2002 12:19 PM > // To: CrossWalkCentral > // Cc: [EMAIL PROTECTED] > // Subject: Re: [PHP-DB] protecting > // > // > // put some javascript validation form. if the value of the form cntains > // .jpg, etc. don't allow the user to go further. > // > // On Mon, 11 Feb 2002, CrossWalkCentral wrote: > // > // > How can I help protect people form modifying a form that > // submits data to php file that stores the data in a database > // > > // > for example I have a text box that ask for a first name > // and I am getting a lot of garbage back like if they modified > // my form and submitted a image instead. > // > > // > I know that their is some sort of parse out their that I > // can put in the php file that will help validate this > // > > // > // > // -- > // 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] protecting
you might find the library at http://www.dentedreality.com.au/jsvalidation/ useful, but you should also perform similar checks server-side using PHP since if you are that worried about malicious use of your site, people can easily circumvent javascript validation // -Original Message- // From: Mihail Bota [mailto:[EMAIL PROTECTED]] // Sent: Tuesday, 12 February 2002 12:19 PM // To: CrossWalkCentral // Cc: [EMAIL PROTECTED] // Subject: Re: [PHP-DB] protecting // // // put some javascript validation form. if the value of the form cntains // .jpg, etc. don't allow the user to go further. // // On Mon, 11 Feb 2002, CrossWalkCentral wrote: // // > How can I help protect people form modifying a form that // submits data to php file that stores the data in a database // > // > for example I have a text box that ask for a first name // and I am getting a lot of garbage back like if they modified // my form and submitted a image instead. // > // > I know that their is some sort of parse out their that I // can put in the php file that will help validate this // > // // // -- // 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] protecting
put some javascript validation form. if the value of the form cntains .jpg, etc. don't allow the user to go further. On Mon, 11 Feb 2002, CrossWalkCentral wrote: > How can I help protect people form modifying a form that submits data to php file >that stores the data in a database > > for example I have a text box that ask for a first name and I am getting a lot of >garbage back like if they modified my form and submitted a image instead. > > I know that their is some sort of parse out their that I can put in the php file >that will help validate this > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] protecting
How can I help protect people form modifying a form that submits data to php file that stores the data in a database for example I have a text box that ask for a first name and I am getting a lot of garbage back like if they modified my form and submitted a image instead. I know that their is some sort of parse out their that I can put in the php file that will help validate this
RE: [PHP-DB] Email Validation
have a look at the online annotated php manual under the regular expression functions, there are *stacks* of examples of using regexps to validate email patterns beau // -Original Message- // From: CrossWalkCentral [mailto:[EMAIL PROTECTED]] // Sent: Tuesday, 12 February 2002 12:20 PM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] Email Validation // // // I am working on a form that I have in php and am looking for // some advise on form validation or specifically email address // validation so i can insure that some one has put in a // properly formatted email address // -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Email Validation
I am working on a form that I have in php and am looking for some advise on form validation or specifically email address validation so i can insure that some one has put in a properly formatted email address
RE: [PHP-DB] If Statement that makes me cry
Calm down dudes, I just did a quick search and found this on hotscripts http://www.hotscripts.com/Detailed/13628.html It converts MS Word docs on the fly in linux and turns them into html or pdf or text or whatever. You'll need wv http://wvware.sourceforge.net Don't know how well it works but I say start there. -Original Message- From: Todd Williamsen [mailto:[EMAIL PROTECTED]] Sent: February 11, 2002 1:05 PM To: 'DL Neil' Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] If Statement that makes me cry DL, I don't know what crawled up your ass and died or pissed in your cheerios this morning. I was asking for any DIRECTION to how to percieve this. Now, I did not crap on Open Source. Now, why would I do that if I am using it? Yes I am an MCSE, and I assume you have a problem with it. That is YOUR problem not mine. You always seem to try to pit a Microsoft vs. Open Source war. Why is that, jealousy? Little Man's disease? Geez, whats with you types? I mean, You think Open Source is the ultimate solution and Bill Gates it the evil empire. Grow up and don't respond to my inquiries. I don't like childish remarks from an incompetent fool By the way, Open Source junkies like yourself should Welcome Microsoft people with open arms. Isn't that what you all are trying to do, is get people off of MS based systems and jump on the Open Source bandwagon? Screw you too!! -Original Message- From: DL Neil [mailto:[EMAIL PROTECTED]] Sent: Monday, February 11, 2002 11:52 AM To: Todd Williamsen Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] If Statement that makes me cry Todd, > My ultimate goal is to be able to search within a MS Word Document, but it > seems that is a moot point unless I take the whole application and migrate > it to ASP and COM+ which I know nothing about. =as mentioned ages back in this thread: use the best tool for the job. =new addition: don't blame the tools if you get it wrong. > Plus, the client's requirements are vague to say the least. They have the > atitude, "Build something along these lines and we will see what you come up > with and we will go from there." That isn't what I had in mind. But I know > the ability to search within a Word document is a key factor. That is a > drawback of Open Source, you cannot access the Microsoft World which 80% of > the computer users use as Office Applications and is considered a standard. > > I know, the Open Source community doesn't like that reality, but its true. > When somebody submits a resume to apply for a job, what format does a > recuiter or employer look for? MS Word. =am I confusing you with someone else/another Todd - aren't you an MCP of some description? =the reason "the Open Source community" doesn't like the "reality", is because of precisely the issue you have run into! Word is a proprietary format (no matter what ASCII-format red herrings you've been casting about). For ANYONE to hack into Word docs to find the format parameters and thereby reverse engineer, is contrary to Microsoft's restrictive, proprietary approach to world domination. =so the fact that you have not paid attention to/found (thus far) an open source solution is most likely because of legal strictures. =even if this were not the case, how many people have you 'found' who have come back saying 'yes I do that every day and here's how I do it...'? None - otherwise you wouldn't be regaling us with this tale of woe. Accordingly the demand is not that great, and what might be a "key factor" to you, seems somewhat lesser in the grand scheme of things. =Word is a Microsoft product. Have you been moaning on their lists (always assuming anyone from Microsoft actually responds/is helpful on such lists), asking where the Word-PHP interface is? Why attack only one side of the 'problem'? Perhaps like many others you have a perception that Microsoft couldn't care less about what you are trying to do? Why then make "the Open Source community" your whipping boys (and girls)? =among the principles of open source is the idea that when YOU come up with a 'new' idea, YOU build an add-on solution - and having the source code to (for example, PHP) you 'could' do this. Again, the fact that you (presumably) don't want to do that, is more an indictment of you and your situation than of 'open source'. BTW I (personal note) could not build such a solution, which means that I won't claim any 'right' to complain about such a 'short-coming'. =(I cannot confirm this/comment on the degree of success/exactitude) Various Open Systems 'Office' package products/projects claim the ability to read or convert 'standard' MS-Word docs - so something must be possible! Have you looked at open systems Word-alternatives? =To your problem: 1 has the Word index creation facility been improved lately? Will it sufficiently identify a document's 'keywords' (or do you still have to basically do it by hand first)? 2 the tool to extend Word's native facilities is called VB
Re: [PHP-DB] mySQL dB copy
If your not really a text MySQL guy I would highly recomend PHPMyAdmin. Its a set of PHP scripts you can upload into its own directory and run immediately. It will allow you to download (through the web interface) the entire database, and then move it to the new site (using the same tool.) I've used quite a few My-SQL helpers and this on is by FAR the best. http://phpwizard.net/projects/phpMyAdmin/index.html I'm sure the gurus (::pays hommage::) could give you a plethora of ways to do this, but if your just switching servers and one of the machines has PHP your good to go with this. -Jonathan PS: I use this utility to run daily backups. - Original Message - From: "mike" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 11, 2002 7:50 PM Subject: [PHP-DB] mySQL dB copy > Hello all, > > I am a relatively new php/mysql developer, I would like to take an entire > mysql and copy it or strip it from the server where it resides. Anyone know > how to do this? Recently a previous developer had made a cgi shopping cart > that I would like to take the product table from and make php shopping cart > product table, but I need that data in a state where I can manipulate it. > Copy it, change column names and so on. The table is roughly 1000 products > large. Any help would be greatly appreciated. > > if you can email at mailto:[EMAIL PROTECTED] > > Thanks > Mike > > > > -- > 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
[PHP-DB] mySQL dB copy
Hello all, I am a relatively new php/mysql developer, I would like to take an entire mysql and copy it or strip it from the server where it resides. Anyone know how to do this? Recently a previous developer had made a cgi shopping cart that I would like to take the product table from and make php shopping cart product table, but I need that data in a state where I can manipulate it. Copy it, change column names and so on. The table is roughly 1000 products large. Any help would be greatly appreciated. if you can email at mailto:[EMAIL PROTECTED] Thanks Mike -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Replacing character.
Hi again, thanks for those who sent me info on my earlier problem. Another bit of help needed here. I have table that contains alot of fields. Now one of the fields in the databse contains information that I need to be changed when output on a page. Example: In the table the field purchase has the following information in 1 of the entries: This is a book for sale Now I need this field and this field only on out put to remove all the spaces and replace them with + signs. So it would look like: This+is+a+book+for+sale Now I dont want any other spaces apart from the ones in this field to be replaced. i have looked as some regular expressions, but would like to know if this is possible, and the way to go about it. Thanks once again, this list is very valuable. Thanks all Barry -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: [PHP] help - to get client IP
This is what I use, I think I got it off the online documentation. I use it to track users and it checks for proxys. if ($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"] != "") {$IP = $HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"]; $proxy = $HTTP_SERVER_VARS["REMOTE_ADDR"]; $host = @gethostbyaddr($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"]);} else {$IP = $HTTP_SERVER_VARS["REMOTE_ADDR"]; $host = @gethostbyaddr($HTTP_SERVER_VARS["REMOTE_ADDR"]);} -Jonathan - Original Message - From: "Jeroen Timmers" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: "[PHP-DB]" <[EMAIL PROTECTED]> Sent: Monday, February 11, 2002 7:43 AM Subject: [PHP-DB] Re: [PHP] help - to get client IP > Someone please help me of how I could get the client IP using PHP, when i > use $remote_addr it gives me the server IP, Kindly help how I could get the > IP of clients who are connected to my server or website. > > $ip = gethostbyname($REMOTE_HOST); > > the you got the IP of the remote user. > > Jeroen Timmers > > > > > -- > 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
[PHP-DB] Re: [PHP] help - to get client IP
Someone please help me of how I could get the client IP using PHP, when i use $remote_addr it gives me the server IP, Kindly help how I could get the IP of clients who are connected to my server or website. $ip = gethostbyname($REMOTE_HOST); the you got the IP of the remote user. Jeroen Timmers -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] hosts
There was a discussion on the list a few weeks ago about reliable web hosts offering PHP and MySQL support. I did not need the info then but it has become relevant now. I'd appreciate if people could re-post recommendations, if someone has a compiled list, even better. Thanks, -Lisi -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] How is NULL stored?
> When I use phpMyAdmin to view data, where values are NULL it displays the > word 'NULL'. Does this mean that the word 'NULL' is actually stored in the > table, or is it defined by some other character? Is this any different from > an empty value? > > I am using it to check to see whether a value has been entered into a field, > and if so what is the value. Will MySql return an empty string or do I need > to trap for 'NULL' as well? > NULL is empty if you make this statement with php you can test it if (empty($var)) echo "NULL"; else echo $var; Jeroen -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] How is NULL stored?
Hi When I use phpMyAdmin to view data, where values are NULL it displays the word 'NULL'. Does this mean that the word 'NULL' is actually stored in the table, or is it defined by some other character? Is this any different from an empty value? I am using it to check to see whether a value has been entered into a field, and if so what is the value. Will MySql return an empty string or do I need to trap for 'NULL' as well? Ta Peter --- Excellence in internet and open source software --- Sunmaia www.sunmaia.net [EMAIL PROTECTED] tel. 0121-242-1473 --- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Forms carrying values.
Just try <[EMAIL PROTECTED]> schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi list, hope someone can help me here. > > I have content management system I have designed. I am still learning php so help here would be appreciated. > > The user logs into the system, and we carry there user name over the pages using a link to each page with the value of their name carried over as follows: ../index.php?name= > > This works fine for the whole site, except when a user makes changes to a entry. Once they submit adding a new entry or modifying an existing one, the value of : ../index.php?name=My Name ends up being ./index.php?name=My > > It deletes the end of the name of the url, so that when the user clicks the link it does not really know who they are. > > I have used a hidden field to carry the value of the name over the pages, but it does not work on forms. > > I hope this makes some sort of sense. > > If anyone knows of a workaround. > > Thanks > > Barry -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Using a Left() result in PHP
G'day all, The answer was nice and simple - assign an alias to the select statement - thanks all for the quick responses. Cheers, kim -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP + SQL Books
On Tuesday 05 February 2002 02:45, William Fong wrote: > I'm looking for some recommendations on PHP + SQL 'cook books'. I've had > some for other apps, like PERL, and have found them very useful for > learning techniques. I already have a number of PHP and SQL books, but > they usually don't help each other. > > Any recommendations would be great. MySQL/PHP Database Applications Jay Greenspan, Brad Bulger M&T Books ISBN 0-7645-3537-4 -- Markus Lervik Linux-administrator with a kungfoo grip Vaasa City Library - Regional Library [EMAIL PROTECTED] +358-6-325 3589 / +358-40-832 6709 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Using a Left() result in PHP
Hi Kim, > I want to get the first 64 characters from a database row result and display > only those 64 characters using PHP. The snipped code is here - I've deleted > all the error trapping and comments: > > $result = @mysql_query("select ID, Writer, left(text,64) from Reports where > writer like '%kim%';"); > > while ($row = mysql_fetch_array($result)) { > $ID=$row["ID"]; > $Writer=$row["Writer"]; > $text= $row["Text"]; > > echo ("" . $ID . " " . $Writer . " " . $Text . ""); > > This returns a blank result for Text. If I remove the left() from the SQL it > works but displays the entire report - hundreds of words. How can I display > only those first 64 characters - am I missing something obvious? The 'fieldname' that is passed from MySQL to PHP depends upon the terminology of the SELECT clause (not the schema of the table). So the column's name is text (BTW not a good choice) but the query knows the resultant value as "left(text,64)" - issue the query from the command line or in an admin pkg, and check the column headings, if you want to see what I mean! Use an AS to give the computed-column a 'good name' and you'll be away:- $result = @mysql_query("select ID, Writer, left(text,64) as Intro from Reports where writer like '%kim%';"); ... > $text= $row["Intro"]; Regards, =dn -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Forms carrying values.
Hi list, hope someone can help me here. I have content management system I have designed. I am still learning php so help here would be appreciated. The user logs into the system, and we carry there user name over the pages using a link to each page with the value of their name carried over as follows: ../index.php?name= This works fine for the whole site, except when a user makes changes to a entry. Once they submit adding a new entry or modifying an existing one, the value of : ../index.php?name=My Name ends up being ./index.php?name=My It deletes the end of the name of the url, so that when the user clicks the link it does not really know who they are. I have used a hidden field to carry the value of the name over the pages, but it does not work on forms. I hope this makes some sort of sense. If anyone knows of a workaround. Thanks Barry -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Using a Left() result in PHP
Hi there I'm just scraping the surface of MySQL and PHP and there's something I can't work out. I want to get the first 64 characters from a database row result and display only those 64 characters using PHP. The snipped code is here - I've deleted all the error trapping and comments: $result = @mysql_query("select ID, Writer, left(text,64) from Reports where writer like '%kim%';"); while ($row = mysql_fetch_array($result)) { $ID=$row["ID"]; $Writer=$row["Writer"]; $text= $row["Text"]; echo ("" . $ID . " " . $Writer . " " . $Text . ""); This returns a blank result for Text. If I remove the left() from the SQL it works but displays the entire report - hundreds of words. How can I display only those first 64 characters - am I missing something obvious? Many thanks, kim -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] php_sybase_ct.dll
I am trying to load the sybase modules. Under both IIS 5.0 and Apache1.3 I get the following error: 'can't load...could not find 'libct.dll' This isn't an .ini issue as the file isn't anywhere to be found. Do I have to download this dll from somewhere? php seems to be working fine otherwise - the mysql config works, everything else seems fine. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php