[PHP-DB] creating a processing page
Hi all, How do you make a 'processing page' like the one's on some php forum search pages? Would it be something like as follows: htmlheadProcessingtitle/title script language=javascript !--// function gotopage( page ) { window.location( page ); } //-- /script /headbody Processing, please wait... ?php $deatails = do_whatever_takes_time(); $page_that_can_retreive_stored_details = somehow_store( $details ); echo 'script language=javascript!--// gotopage( $page_that_can_retreive_stored_details ); //--/script/body/html'; ? Or is there some other much simpler way to acheive this??? Cheers Ry [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] displaying duplicate records...
I have a database which allows people to upload info and foto's. There's a unique ID field, but some people tend to upload their info more than once (its a contest site). What I'm able to do is to see how may duplicates there are using the following statement: $query=SELECT COUNT(*) as cnt, voornaam,achternaam,leeftijd,ID,email FROM modellen GROUP BY email HAVING cnt 1; But this only gives me numbers. Does anyone know how to display every record that has multiple duplicate ? Or is there an elegant way to stop people from entering their info more than once? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: displaying duplicate records...
Hi, there's an elegant way to stop people from uploading the infos more than one time. And it's easy to do. You just have to figure out which fields are not allowed to have the same values and put those fields into an unique key. ALTER TABLE projekt ADD UNIQUE(voornaam, achternaam, email) would just allow one entry with the same names and email. The query you're searching may be like this: $query=SELECT COUNT(email) as cnt, voornaam,achternaam,leeftijd,ID,email FROM modellen GROUP BY email HAVING cnt 1; HTH, Bastian Marco Alting schrieb: I have a database which allows people to upload info and foto's. There's a unique ID field, but some people tend to upload their info more than once (its a contest site). What I'm able to do is to see how may duplicates there are using the following statement: $query=SELECT COUNT(*) as cnt, voornaam,achternaam,leeftijd,ID,email FROM modellen GROUP BY email HAVING cnt 1; But this only gives me numbers. Does anyone know how to display every record that has multiple duplicate ? Or is there an elegant way to stop people from entering their info more than once? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] displaying duplicate records...
I do not understand your first question. Your query in effect shows duplicates. To prevent future duplicates, you can do it in two ways: 1. with MySQL: create a unique index on what should be unique, most likely the email (it looks like your business logic implies one entry per email) in fact you would not have this problem if you had defined email as PRIMARY KEY But you will have to remove the duplicates first - an unpleasant job. AFAIK, there is no easy way to do it with MySQL (or SQL in general). You have to do it procedurally by calling the entire table row by row. 2. Procedurally: validate user data before entry in the DB HTH Ignatius - Original Message - From: Marco Alting [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 04, 2002 11:47 AM Subject: [PHP-DB] displaying duplicate records... I have a database which allows people to upload info and foto's. There's a unique ID field, but some people tend to upload their info more than once (its a contest site). What I'm able to do is to see how may duplicates there are using the following statement: $query=SELECT COUNT(*) as cnt, voornaam,achternaam,leeftijd,ID,email FROM modellen GROUP BY email HAVING cnt 1; But this only gives me numbers. Does anyone know how to display every record that has multiple duplicate ? Or is there an elegant way to stop people from entering their info more than once? -- 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: displaying duplicate records...
Ok I see, and how would you catch the error people get, when they send it again ? Bastian Vogt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, there's an elegant way to stop people from uploading the infos more than one time. And it's easy to do. You just have to figure out which fields are not allowed to have the same values and put those fields into an unique key. ALTER TABLE projekt ADD UNIQUE(voornaam, achternaam, email) would just allow one entry with the same names and email. The query you're searching may be like this: $query=SELECT COUNT(email) as cnt, voornaam,achternaam,leeftijd,ID,email FROM modellen GROUP BY email HAVING cnt 1; HTH, Bastian Marco Alting schrieb: I have a database which allows people to upload info and foto's. There's a unique ID field, but some people tend to upload their info more than once (its a contest site). What I'm able to do is to see how may duplicates there are using the following statement: $query=SELECT COUNT(*) as cnt, voornaam,achternaam,leeftijd,ID,email FROM modellen GROUP BY email HAVING cnt 1; But this only gives me numbers. Does anyone know how to display every record that has multiple duplicate ? Or is there an elegant way to stop people from entering their info more than once? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: displaying duplicate records...
Marco Alting schrieb: Ok I see, and how would you catch the error people get, when they send it again ? Well, there will be no error-message... if you use mysql (do you?) ;-) If you want a message you will have to select all rows from your table where the values the user wants to insert are already inserted. If you find some - error, if not - put them in. Ignatius is right: I forgot to mention that there mustn't be any duplicates in the fields you want to add to the unique key. HTH, Bastian Bastian Vogt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, there's an elegant way to stop people from uploading the infos more than one time. And it's easy to do. You just have to figure out which fields are not allowed to have the same values and put those fields into an unique key. ALTER TABLE projekt ADD UNIQUE(voornaam, achternaam, email) would just allow one entry with the same names and email. The query you're searching may be like this: $query=SELECT COUNT(email) as cnt, voornaam,achternaam,leeftijd,ID,email FROM modellen GROUP BY email HAVING cnt 1; HTH, Bastian Marco Alting schrieb: I have a database which allows people to upload info and foto's. There's a unique ID field, but some people tend to upload their info more than once (its a contest site). What I'm able to do is to see how may duplicates there are using the following statement: $query=SELECT COUNT(*) as cnt, voornaam,achternaam,leeftijd,ID,email FROM modellen GROUP BY email HAVING cnt 1; But this only gives me numbers. Does anyone know how to display every record that has multiple duplicate ? Or is there an elegant way to stop people from entering their info more than once? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] displaying duplicate records...
What I ment was that when using the GROUP by, you will see one of the duplicates, and if you output the 'cnt' value you would see how many times it has a duplicate. But I want to see all duplicate records in a table, so I can add a delete button to the row. If I have the email address as a PRIMARY i would very much like to know how I would handle the input by the user when it is send to the database. I assume it will generate an error upon submission. How do I go about letting the user know they have entered an already existing address? Ignatius Reilly [EMAIL PROTECTED] wrote in message 030801c29b8b$8bd88ee0$015a@server">news:030801c29b8b$8bd88ee0$015a@server... I do not understand your first question. Your query in effect shows duplicates. To prevent future duplicates, you can do it in two ways: 1. with MySQL: create a unique index on what should be unique, most likely the email (it looks like your business logic implies one entry per email) in fact you would not have this problem if you had defined email as PRIMARY KEY But you will have to remove the duplicates first - an unpleasant job. AFAIK, there is no easy way to do it with MySQL (or SQL in general). You have to do it procedurally by calling the entire table row by row. 2. Procedurally: validate user data before entry in the DB HTH Ignatius - Original Message - From: Marco Alting [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 04, 2002 11:47 AM Subject: [PHP-DB] displaying duplicate records... I have a database which allows people to upload info and foto's. There's a unique ID field, but some people tend to upload their info more than once (its a contest site). What I'm able to do is to see how may duplicates there are using the following statement: $query=SELECT COUNT(*) as cnt, voornaam,achternaam,leeftijd,ID,email FROM modellen GROUP BY email HAVING cnt 1; But this only gives me numbers. Does anyone know how to display every record that has multiple duplicate ? Or is there an elegant way to stop people from entering their info more than once? -- 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] displaying duplicate records...
Well, seeing n rows or only one does not make you any happier, because you can not issue a DELETE statement that will delete only (n-1) entries. If your table is small enough, you may try to delete duplicates manually with a graphical interface such as Access or DBTools. But test first, as it may very well delete all n rows (in fact it SHOULD if it implements SQL properly...) Your PHP script should test first whether the proposed entry exists, with a query like: SELECT * FROM my_table WHERE unique_field = '{$_POST['unique_field']}' (As a rule, you must validate thoroughly ALL entries before inserting into your DB.) you can test over if ( mysql_num_rows( $result) ) if there is already an entry. In such case, redirect to your script with an appropriate error message. If you are reluctant to validate data, you can send the INSERT query and interpret an error as an attempt to create a duplicate (provided you had first created the appropriate UNIQUE index). Very dirty and not recommended. HTH Ignatius - Original Message - From: Marco Alting [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 04, 2002 12:57 PM Subject: Re: [PHP-DB] displaying duplicate records... What I ment was that when using the GROUP by, you will see one of the duplicates, and if you output the 'cnt' value you would see how many times it has a duplicate. But I want to see all duplicate records in a table, so I can add a delete button to the row. If I have the email address as a PRIMARY i would very much like to know how I would handle the input by the user when it is send to the database. I assume it will generate an error upon submission. How do I go about letting the user know they have entered an already existing address? Ignatius Reilly [EMAIL PROTECTED] wrote in message 030801c29b8b$8bd88ee0$015a@server">news:030801c29b8b$8bd88ee0$015a@server... I do not understand your first question. Your query in effect shows duplicates. To prevent future duplicates, you can do it in two ways: 1. with MySQL: create a unique index on what should be unique, most likely the email (it looks like your business logic implies one entry per email) in fact you would not have this problem if you had defined email as PRIMARY KEY But you will have to remove the duplicates first - an unpleasant job. AFAIK, there is no easy way to do it with MySQL (or SQL in general). You have to do it procedurally by calling the entire table row by row. 2. Procedurally: validate user data before entry in the DB HTH Ignatius - Original Message - From: Marco Alting [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 04, 2002 11:47 AM Subject: [PHP-DB] displaying duplicate records... I have a database which allows people to upload info and foto's. There's a unique ID field, but some people tend to upload their info more than once (its a contest site). What I'm able to do is to see how may duplicates there are using the following statement: $query=SELECT COUNT(*) as cnt, voornaam,achternaam,leeftijd,ID,email FROM modellen GROUP BY email HAVING cnt 1; But this only gives me numbers. Does anyone know how to display every record that has multiple duplicate ? Or is there an elegant way to stop people from entering their info more than once? -- 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 Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] query
Hi to all, I'm working in a system where users can post projects. Other users will verify those projects. What I'm trying to do is once a user verify a project he/she cannot view it anymore, but I want to keep it available for the other users that haven't verified it. I have two tables project and user_verified. On project table I keep all the projects that users post. On user_verified I keep users who already verified for a project. These are the fields for user_vefified table project_id, username, verified Everytime a user verifies a project I insert a new record to the user_verified table. This the query, but it doesn't work. It selects the same record from the two tables. e.g. if the records exist twice on the user_verified table and one on the project table, it will display three records when I run the the following query: $sql = SELECT project.project_id, project.project_name, project.project_desc FROM project, user_verified WHERE project.username user_verified.username AND project.username '$PHP_AUTH_USER' AND project.category='$category'); any help is greatly apprecciate it Thanks in advance Nato -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Index on email or ID?
the id is definitely better. although creating an index on the email and potentially the password would help. I had a table that was indexed off of a random unique string and when i got to about 5+ rows updates were taking about 4 seconds. you can authenticate with the email and password, but then i would run all updates based on the ID, and if you need to be sure of authentication, store them in session variables and use them when you need them. if you want to keep it the way you have it, i'd just add indexes on those fields. i'm sure there are better ways but, . hth jeff Jim [EMAIL PROTECTED] To: [EMAIL PROTECTED] om cc: Subject: [PHP-DB] Index on email or ID? 12/04/2002 09:23 AM Hi, My website requires subscribed users to login with their email and password, the email is guaranteed to be unique, so this is one key, the other is the AUTO_INCREMENT ID assigned at registration time. In the cookie that I drop at logon time is the email/password combination (security isn't really a major issue)so I can then use the email as the unique key into the user table. Of course, I could also drop the AUTO_INCREMENT ID at logon time aswell, so instead of having: WHERE email = '[EMAIL PROTECTED]' AND password = 'userpass' I would use: WHERE id = 19 AND email = '[EMAIL PROTECTED]' AND password = 'userpass' Question is, is the index performance on a INT column much greater than that of a VARCHAR column? My guess would be yes. Also, if your thinking about saying well if ya got the ID, why bother with email and password, well I don't want to make it THAT easy to logon as another user. Just want to gather some opinions. Thanks, Jim. -- 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] query
Ideally, you would have 3 tables like so... Projects(with one record per project) - projectID |ProjectName| etc... 1 my project 2 another project Users(with one record per user) --- userID| userName| etc... 123 Joe Blow 124 Mary Jane ProjectsVerified projectID| userID 1 123 1 124 2 124 In this example, Joe has verified my project only. Mary Jane has verified my project and another project. Whether you use my database or yours, you will need to use SQL's JOIN syntax to properly extract the information you are looking for. Read up on SQL and JOIN types, (LEFT, INNER, OUTER etc.). They are tricky at first but well worth it once you figure out what is going on. Or just repost, and someone will help you out with it. J -Original Message- From: Natividad Castro [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 04, 2002 9:35 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] query Hi to all, I'm working in a system where users can post projects. Other users will verify those projects. What I'm trying to do is once a user verify a project he/she cannot view it anymore, but I want to keep it available for the other users that haven't verified it. I have two tables project and user_verified. On project table I keep all the projects that users post. On user_verified I keep users who already verified for a project. These are the fields for user_vefified table project_id, username, verified Everytime a user verifies a project I insert a new record to the user_verified table. This the query, but it doesn't work. It selects the same record from the two tables. e.g. if the records exist twice on the user_verified table and one on the project table, it will display three records when I run the the following query: $sql = SELECT project.project_id, project.project_name, project.project_desc FROM project, user_verified WHERE project.username user_verified.username AND project.username '$PHP_AUTH_USER' AND project.category='$category'); any help is greatly apprecciate it Thanks in advance Nato -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Index on email or ID?
Always, always, always use a value that has no other significance other than being a unique ID. Email addresses change and so do passwords, so those are poor choices for linking data. They are fine and good choices for login, but that's about the only thing they should be used for. I've seen systems where the social security number was used as the unique ID. Sure it won't change, but it's also private information. Then there is the problem of human error on data entry. On Wednesday, December 4, 2002, at 09:23 AM, Jim wrote: My website requires subscribed users to login with their email and password, the email is guaranteed to be unique, so this is one key, the other is the AUTO_INCREMENT ID assigned at registration time. -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: PHP/MySQL not available remotely...
Okay, it was suggested that I may not have my register_globals flagged to on but I do. I still can't seem to make any remote connect to the server. Again, there are no errors, it just flat don't work. Chase Chase [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I seem to have a bit of an issue with my PHP/MySQL settings... A basic PHP bit like ?php echo $REMOTE_ADDR; ? works great on my webserver. However, with any form of DB access the page just hangs... I don't get an error, but I don't get results either. I also have phpMyAdmin-2.3.3 running. I can access that from the server directly, but if I try to get to it via any other machine I get NO results. I am running IIS 5 with PHP4 and MySQL v3.23.53-max. Suggestions? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: PHP/MySQL not available remotely...
do you have the persmissions set either for [EMAIL PROTECTED](which would only work from remotehost.com) or username@'%' (which would work for that username from any host) hth jeff Chase chase@ck2000. To: [EMAIL PROTECTED] biz cc: Subject: [PHP-DB] Re: PHP/MySQL not available remotely... 12/04/2002 10:58 AM Okay, it was suggested that I may not have my register_globals flagged to on but I do. I still can't seem to make any remote connect to the server. Again, there are no errors, it just flat don't work. Chase Chase [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I seem to have a bit of an issue with my PHP/MySQL settings... A basic PHP bit like ?php echo $REMOTE_ADDR; ? works great on my webserver. However, with any form of DB access the page just hangs... I don't get an error, but I don't get results either. I also have phpMyAdmin-2.3.3 running. I can access that from the server directly, but if I try to get to it via any other machine I get NO results. I am running IIS 5 with PHP4 and MySQL v3.23.53-max. Suggestions? -- 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] Re: PHP/MySQL not available remotely...
Are you able to connect to the MySQL server from the command line using a non-php client? --Dave On Wed, 2002-12-04 at 09:04, [EMAIL PROTECTED] wrote: do you have the persmissions set either for [EMAIL PROTECTED](which would only work from remotehost.com) or username@'%' (which would work for that username from any host) hth jeff Chase chase@ck2000. To: [EMAIL PROTECTED] biz cc: Subject: [PHP-DB] Re: PHP/MySQL not available remotely... 12/04/2002 10:58 AM Okay, it was suggested that I may not have my register_globals flagged to on but I do. I still can't seem to make any remote connect to the server. Again, there are no errors, it just flat don't work. Chase Chase [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I seem to have a bit of an issue with my PHP/MySQL settings... A basic PHP bit like ?php echo $REMOTE_ADDR; ? works great on my webserver. However, with any form of DB access the page just hangs... I don't get an error, but I don't get results either. I also have phpMyAdmin-2.3.3 running. I can access that from the server directly, but if I try to get to it via any other machine I get NO results. I am running IIS 5 with PHP4 and MySQL v3.23.53-max. Suggestions? -- 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 Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: PHP/MySQL not available remotely...
On Thursday 05 December 2002 00:44, Chase wrote: Yes I am. I was just asked to create a simple web page that would display the visitors IP address using: ?php echo $REMOTE_ADDR; ? So you're saying that the above works ... and when I call this up over the intranet or internet it works just fine. However, I was also asked to create a page that would just display the PHP Info screen and that will only show up on the server.. I can't get that page to show remotely. ... but ?php phpinfo(); ? doesn't work?? Based on this, I think my error is in my setups for either PHP4 or IIS... If phpinfo() doesn't work then I think you've got far bigger problems than setups to worry about ;-) -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I knew one thing: as soon as anyone said you didn't need a gun, you'd better take one along that worked. -- Raymond Chandler */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: PHP/MySQL not available remotely...
The phpinfo() call works great on the server itself, but I cannot get the information to display to anyone that connects to the server. Jason Wong [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Thursday 05 December 2002 00:44, Chase wrote: Yes I am. I was just asked to create a simple web page that would display the visitors IP address using: ?php echo $REMOTE_ADDR; ? So you're saying that the above works ... and when I call this up over the intranet or internet it works just fine. However, I was also asked to create a page that would just display the PHP Info screen and that will only show up on the server.. I can't get that page to show remotely. ... but ?php phpinfo(); ? doesn't work?? Based on this, I think my error is in my setups for either PHP4 or IIS... If phpinfo() doesn't work then I think you've got far bigger problems than setups to worry about ;-) -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I knew one thing: as soon as anyone said you didn't need a gun, you'd better take one along that worked. -- Raymond Chandler */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] anchors
Ok, I know this isn't really a db specific question so forgive me. In my php/mysql page, I have a button that loops back to the same page only when it opens the page again, I want it to go to a certain spot on the page with certain parameters. For Example auction.php#map takes me to the map section of the page but if I loop to that section with parameters auction.php#map?clientid=1 nothing happens. How do I distinguish between the end of the anchor and the start of the parameters? Thanks, Eddie -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] anchors
Try auction.php?clientid=1#map On Wed, 4 Dec 2002, Edward Peloke wrote: Ok, I know this isn't really a db specific question so forgive me. In my php/mysql page, I have a button that loops back to the same page only when it opens the page again, I want it to go to a certain spot on the page with certain parameters. For Example auction.php#map takes me to the map section of the page but if I loop to that section with parameters auction.php#map?clientid=1 nothing happens. How do I distinguish between the end of the anchor and the start of the parameters? Thanks, Eddie -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Peter Beckman Internet Guy [EMAIL PROTECTED] http://www.purplecow.com/ --- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] anchors
thanks Peter! Thanks I appreciate it! -Original Message- From: Peter Beckman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 04, 2002 2:21 PM To: Edward Peloke Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] anchors Try auction.php?clientid=1#map On Wed, 4 Dec 2002, Edward Peloke wrote: Ok, I know this isn't really a db specific question so forgive me. In my php/mysql page, I have a button that loops back to the same page only when it opens the page again, I want it to go to a certain spot on the page with certain parameters. For Example auction.php#map takes me to the map section of the page but if I loop to that section with parameters auction.php#map?clientid=1 nothing happens. How do I distinguish between the end of the anchor and the start of the parameters? Thanks, Eddie -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Peter Beckman Internet Guy [EMAIL PROTECTED] http://www.purplecow.com/ --- -- 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] Special URL Verification String...
I am trying to implement an approval system that sends an e-mail to a user for approval linking them back to a special URL that matches database entries for a verification string. The verification string sent via the e-mail does not match that in the database and I am looking for help in figuring out why. Here is what generates the verification string: $verify_string = $sbcuid; for ($i = 0 ; $i 14; $i++) { $verify_string .= chr(mt_rand(32,126)); } Here is what this results in inside the database table: sn4265e~zD|W(XTMxO+ Here is what is sent in the e-mail: sn4265e%7EzD%7CW%28XTMxO%22%2B I know that I am doing something wrong here, but what. Thanks in advance. Scott Nipp Phone: (214) 858-1289 E-mail: [EMAIL PROTECTED] Web: http:\\ldsa.sbcld.sbc.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Special URL Verification String...
The %7 and similar are used in URL encoding to represent illegal characters such as spaces and others - these are translated when the user clicks to open the URL, giving the string you get back. I think Peter --- Excellence in internet and open source software --- Sunmaia Birmingham UK www.sunmaia.net tel. 0121-242-1473 International +44-121-242-1473 --- -Original Message- From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]] Sent: 04 December 2002 22:07 To: '[EMAIL PROTECTED]' Subject: [PHP-DB] Special URL Verification String... I am trying to implement an approval system that sends an e-mail to a user for approval linking them back to a special URL that matches database entries for a verification string. The verification string sent via the e-mail does not match that in the database and I am looking for help in figuring out why. Here is what generates the verification string: $verify_string = $sbcuid; for ($i = 0 ; $i 14; $i++) { $verify_string .= chr(mt_rand(32,126)); } Here is what this results in inside the database table: sn4265e~zD|W(XTMxO+ Here is what is sent in the e-mail: sn4265e%7EzD%7CW%28XTMxO%22%2B I know that I am doing something wrong here, but what. Thanks in advance. Scott Nipp Phone: (214) 858-1289 E-mail: [EMAIL PROTECTED] Web: http:\\ldsa.sbcld.sbc.com -- 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] Special URL Verification String... PS
Hi PS I would use $verify_string = md5(uniqid(rand())); to generate a random identifier of the sort you are looking for Peter --- Excellence in internet and open source software --- Sunmaia Birmingham UK www.sunmaia.net tel. 0121-242-1473 International +44-121-242-1473 --- -Original Message- From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]] Sent: 04 December 2002 22:07 To: '[EMAIL PROTECTED]' Subject: [PHP-DB] Special URL Verification String... I am trying to implement an approval system that sends an e-mail to a user for approval linking them back to a special URL that matches database entries for a verification string. The verification string sent via the e-mail does not match that in the database and I am looking for help in figuring out why. Here is what generates the verification string: $verify_string = $sbcuid; for ($i = 0 ; $i 14; $i++) { $verify_string .= chr(mt_rand(32,126)); } Here is what this results in inside the database table: sn4265e~zD|W(XTMxO+ Here is what is sent in the e-mail: sn4265e%7EzD%7CW%28XTMxO%22%2B I know that I am doing something wrong here, but what. Thanks in advance. Scott Nipp Phone: (214) 858-1289 E-mail: [EMAIL PROTECTED] Web: http:\\ldsa.sbcld.sbc.com -- 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] Index on email or ID?
Always, always, always use a value that has no other significance other than being a unique ID. Email addresses change and so do passwords, so those are poor choices for linking data. They are fine and good choices for login, but that's about the only thing they should be used for. I understand what your saying, but if I just use the ID, then it makes it extremely easy to login as another user, simply change the ID in your cookie. Atleast if I have email/password aswell it takes someone with access to the network and a sniffer to get the values. If a user changes his email and/or password, then the cookie gets updated, simple. I can't see that its that much of an issue. If we were talking about a credit card number or something else critical then I'd agree. Jim. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] SAP DB - you guys should check it out
hey, there's a full featured, open-source db, made available from SAP. since sap has software running on this database base that powers the ERP systems of the world's largest companies, it has a lot of powerful, advanced, reliable features. you can get free cd's of the database from there web site at www.sapdb.org pretty cool, has live replication, realtime memory optimization, triggers, transactions, sub selects, and is fully to scalable. poor oracle. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Looking for a programmer
isn't it funny how all projects are simple till you do them! well, that is, unless they really are simple. i guess i never take those. Aaron Lagadyn [EMAIL PROTECTED] wrote in message 003c01c298b6$7a235180$[EMAIL PROTECTED]">news:003c01c298b6$7a235180$[EMAIL PROTECTED]... Hi: I'm looking for an experienced PHP programmer to do two fairly simply integration projects. The first project is integrating Paypal with a directory add listing page as in this example: http://www.travelbcca.com/directory/links.php?action=addlink. The second project is adding a pre-written virtual tour/still photo tour page-set to the OpenRealty stock php site; eg: http://jonroig.com/freecode/openrealty/ I'm willing to pay top rate to the person who is qualified to complete the work in a timely and professional manner. Thanks, Aaron Aaron Lagadyn Evergreen Internet Computer Science 25-711 Malone Road Ladysmith, BC V9G 1S4 Ph: 250 245-7486 Fx: 250 245-7171 Toll-free 877 556-4233 Email: [EMAIL PROTECTED] Company Websites: www.evergreencomputerscience.com for professional quality Website hosting and site maintenance. 100 MB only $17.95/mo. Also, professional-grade search engine submission service, and target email marketing programs. www.supervirtualtours.com for 360 interactive photos for the Internet. Full motion photos for marketing real estate or accommodations online. Remember to back-up your data for safety's sake. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] I got this idea...
Hi! I am knew around here, and a newcomer to PHP, but I know enough. I have = this idea, and I have gone through all the ways that I know off to work = it, but they dont work. I am a paintball player and I get fustrated = because there are too many web sites out there that sell paintball = marker, and gear and things. I would like to take them all, let a client = search for a spacific thing, and have the search results come up with = the url to that product, and list them by price. Now, the not-so-easy = way would be to make a DB and put all the prices in and just list the by = price. Except that would be a very hard, time consuming work. And, I = would have to update the db often. I am sure there is an esyer way, but = I dont know what it is. Thanks for your help! Michael Delorme www.hybridfusion.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: query
echo the actual sql statement from runtime and post it. Natividad Castro [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi to all, I'm working in a system where users can post projects. Other users will verify those projects. What I'm trying to do is once a user verify a project he/she cannot view it anymore, but I want to keep it available for the other users that haven't verified it. I have two tables project and user_verified. On project table I keep all the projects that users post. On user_verified I keep users who already verified for a project. These are the fields for user_vefified table project_id, username, verified Everytime a user verifies a project I insert a new record to the user_verified table. This the query, but it doesn't work. It selects the same record from the two tables. e.g. if the records exist twice on the user_verified table and one on the project table, it will display three records when I run the the following query: $sql = SELECT project.project_id, project.project_name, project.project_desc FROM project, user_verified WHERE project.username user_verified.username AND project.username '$PHP_AUTH_USER' AND project.category='$category'); any help is greatly apprecciate it Thanks in advance Nato -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: PHP/MySQL not available remotely...
-Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 04, 2002 11:48 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Re: PHP/MySQL not available remotely... On Thursday 05 December 2002 00:44, Chase wrote: Yes I am. I was just asked to create a simple web page that would display the visitors IP address using: ?php echo $REMOTE_ADDR; ? So you're saying that the above works ... and when I call this up over the intranet or internet it works just fine. However, I was also asked to create a page that would just display the PHP Info screen and that will only show up on the server.. I can't get that page to show remotely. ... but ?php phpinfo(); ? doesn't work?? Oh my GOD.. this is a really big problem... why don't you try using APACHE web server... in my experience... IIS alwas delivered so many errors with PHP. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] calling function on submit instead of going to a new script
Hi, I'm using some form fields on a page to pick up existing data from a MySQL database, make any changes, and update the database when i hit submit. I've picked up the data ok, now i want to process the update... How do i call a function(?) on the same page rather than use another page through action=somescript.php? what i'd like to do (in seudo-code) is: form action=myfunction() ... input type=submit /form myfunction(){ process update send user back to homepage } cheers, Gav This e-mail and any attachments are intended solely for the named addressee, are confidential and may contain legally privileged information. The copying or distribution of them or of any information they contain, by anyone other than the addressee, is prohibited. If you received this e-mail in error, please notify us immediately by return e-mail or telephone +61 2 9413 2944 and destroy the original message. Thank you. As Email is subject to viruses we advise that all Emails and any attachments should be scanned by an up to-date Anti Virus programme automatically by your system. It is the responsibility of the recipient to ensure that all Emails and any attachments are cleared of Viruses before opening. KSG can not accept any responsibility for viruses that maybe contained here in. Please advise KSG by return Email if you believe any Email sent by our system may contain a virus. It should be noted that most Anti Virus programmes can not scan encrypted file attachments (example - documents saved with a password). Thus extra care should be taken when opening these files. Liability limited by the Accountants Scheme, approved under the Professional Standards Act 1994 (NSW). Level 4 54 Neridah StreetPO Box 1290 CHATSWOOD NSW 2067 CHATSWOOD NSW 2057 Ph: +61 2 9413 2944 Fax: +61 2 9413 9901 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] calling function on submit instead of going to a new script
long story short - you can't you can only call a function in javascript or some other client-side scripting language like that, and you would use the onSubmit= attribute of the form tag. by the sounds of what you want to do - i would say you would do something like; 1. load values from db and display in a form (with a submit button, and perhaps a hidden field of some sort) 2. make your changes on the form and submit it 3. the form posts BACK TO THE SAME PAGE 4. on that page, you check for either the hidden variable (more reliable), or the variable for the submit button (which gets created when the user clicks it) 5. do whatever you want with the changes made (UPDATE?), then display the form again, now with the new values in it. HTH Beau // -Original Message- // From: Gavin Amm [mailto:[EMAIL PROTECTED]] // Sent: Thursday, 5 December 2002 1:31 PM // To: Php-Db (E-mail) // Subject: [PHP-DB] calling function on submit instead of // going to a new // script // // // Hi, // // I'm using some form fields on a page to pick up existing // data from a MySQL // database, make any changes, and update the database when i // hit submit. // I've picked up the data ok, now i want to process the update... // // How do i call a function(?) on the same page rather than use // another page // through action=somescript.php? // what i'd like to do (in seudo-code) is: // // form action=myfunction() // ... // input type=submit // /form // myfunction(){ // process update send user back to homepage // } // // // cheers, // Gav // // // This e-mail and any attachments are intended solely for the // named addressee, // are confidential and may contain legally privileged information. // // The copying or distribution of them or of any information // they contain, by // anyone other than the addressee, is prohibited. If you // received this e-mail // in error, please notify us immediately by return e-mail or // telephone +61 2 // 9413 2944 and destroy the original message. Thank you. // // As Email is subject to viruses we advise that all Emails and // any attachments // should be scanned by an up to-date Anti Virus programme // automatically by // your system. It is the responsibility of the recipient to // ensure that all // Emails and any attachments are cleared of Viruses before // opening. KSG can // not accept any responsibility for viruses that maybe // contained here in. // Please advise KSG by return Email if you believe any Email // sent by our // system may contain a virus. It should be noted that most Anti Virus // programmes can not scan encrypted file attachments (example // - documents // saved with a password). Thus extra care should be taken when // opening these // files. // // Liability limited by the Accountants Scheme, approved under // the Professional // Standards Act 1994 (NSW). // // // // Level 4 // 54 Neridah StreetPO Box 1290 // CHATSWOOD NSW 2067 CHATSWOOD NSW 2057 // // // Ph: +61 2 9413 2944 Fax: +61 2 9413 9901 // // -- // 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] I got this idea...
Well, we can only offer very general guidelines at this stage. What you can do is write a script that: - call all the URLs showing paintball prices (btw what is a paintball?) - extract the product name and price. this will require a specific REGEX for each URL called, and regular testing vs change of page design. the only difficult part is just this: writing and testing custom REGEXes. In fact, why not actually create a DB and run the script every night (or more often) as a scheduled task to update the DB? HTH Ignatius - Original Message - From: Mike Delorme [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 05, 2002 3:02 AM Subject: [PHP-DB] I got this idea... Hi! I am knew around here, and a newcomer to PHP, but I know enough. I have = this idea, and I have gone through all the ways that I know off to work = it, but they dont work. I am a paintball player and I get fustrated = because there are too many web sites out there that sell paintball = marker, and gear and things. I would like to take them all, let a client = search for a spacific thing, and have the search results come up with = the url to that product, and list them by price. Now, the not-so-easy = way would be to make a DB and put all the prices in and just list the by = price. Except that would be a very hard, time consuming work. And, I = would have to update the db often. I am sure there is an esyer way, but = I dont know what it is. Thanks for your help! Michael Delorme www.hybridfusion.com -- 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] calling function on submit instead of going to a new script
Simply append a parameter to the URL: action=same_page.php?selector=1 your script will take various actions based on a switch: switch $_POST['selector'] { case 1 : etc. Ignatius ___ - Original Message - From: Gavin Amm [EMAIL PROTECTED] To: Php-Db (E-mail) [EMAIL PROTECTED] Sent: Thursday, December 05, 2002 6:31 AM Subject: [PHP-DB] calling function on submit instead of going to a new script Hi, I'm using some form fields on a page to pick up existing data from a MySQL database, make any changes, and update the database when i hit submit. I've picked up the data ok, now i want to process the update... How do i call a function(?) on the same page rather than use another page through action=somescript.php? what i'd like to do (in seudo-code) is: form action=myfunction() ... input type=submit /form myfunction(){ process update send user back to homepage } cheers, Gav This e-mail and any attachments are intended solely for the named addressee, are confidential and may contain legally privileged information. The copying or distribution of them or of any information they contain, by anyone other than the addressee, is prohibited. If you received this e-mail in error, please notify us immediately by return e-mail or telephone +61 2 9413 2944 and destroy the original message. Thank you. As Email is subject to viruses we advise that all Emails and any attachments should be scanned by an up to-date Anti Virus programme automatically by your system. It is the responsibility of the recipient to ensure that all Emails and any attachments are cleared of Viruses before opening. KSG can not accept any responsibility for viruses that maybe contained here in. Please advise KSG by return Email if you believe any Email sent by our system may contain a virus. It should be noted that most Anti Virus programmes can not scan encrypted file attachments (example - documents saved with a password). Thus extra care should be taken when opening these files. Liability limited by the Accountants Scheme, approved under the Professional Standards Act 1994 (NSW). Level 4 54 Neridah StreetPO Box 1290 CHATSWOOD NSW 2067 CHATSWOOD NSW 2057 Ph: +61 2 9413 2944 Fax: +61 2 9413 9901 -- 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