[PHP] PHP --with-dbm enabled???
I'm being told that I need to have php compiled --with-dbm and it is not, but it is complied --with-db3. Is that the same thing or do I need recopile --with-dbm to use the dbmopen() function? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Hiding Errors
Is there a way to have errors in script not output to the screen? I have a page that creates an error which really isn't a problem and I don't want users to see the error message. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Difference between 2 Dates
I found this code on the php.net web site but am new to php and can't figure out how to dispaly the difference once calucuated. Belowis the code I'm using: # --- Date Difference --- #Date 1 from MySQL database recordset row $date1 = $row_rsMESSAGES['privmsgs_date']; #Date 2 - now $date2 = date("ymd H:is"); #function function date_diff($date1, $date2) { $s = strtotime($date2)-strtotime($date1); $d = intval($s/86400); $s -= $d*86400; $h = intval($s/3600); $s -= $h*3600; $m = intval($s/60); $s -= $m*60; return array("d"=>$d,"h"=>$h,"m"=>$m,"s"=>$s); } #what I thought would dispaly the diffence but returns and error. echo date_diff("$m, $d, $h, $m"); Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Difference between 2 Dates
I'm trying to do a mail function where if the date the email was posted was today then a "new message" would display, otherwise not. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL field to maintain formatting
I'm having users post messages to a MySQL database records and want to retain the formatting (such as carriage returns and so forth). I have everything actually working all except that the formatting. Messages are being posted but when they are returned they lack the carriage returns. I'd like to be able to make characters bold and so forth, but would settle for the carriage returns if the rest is too difficult. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL field to maintain formatting
That did it thanks! V -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Having / not posted to MySQL Database
When posting to a MySQL database field database record slashes are being added to the data where there is an apostrophe. How do I either, not have the apostrophe posted without the slash or have it not displayed when it is being retrieved? Thanks V -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Informing a User of an Illegal Character in a post
I'm having trouble when a user post a message to a MySQL database where if a user create a user name like 'user&user' as the & symbol is used in URLs. Does anyone have any idea how I can inform user that they have entered and illegal character and are there are illegal characters that I should let them use other than '&' and '?' Thanks V -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Graphic Pie Charts
How do I create a graphic pie chart on the fly with PHP. I have already figured out how to get the variables from the database and so forth am just looking to create the graphics. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Creating an Array from a Recordset
I'm trying to create an array from a rocordset that will do somethingt like this: $datay=array(12,8,19,3,10,5,55,88,3); the following is the code I have attempted to create, which is not working: do { $dat = ($row_rsCOUNTRY['CountryCount'] & "," $row_rsCOUNTRY['CountryCount']); } while ($row_rsCOUNTRY = mysql_fetch_assoc($rsCOUNTRY)); $datay=array($dat); Can anyone help? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating an Array from a Recordset
That gives me something that looks like this: Array ( [0] => 34 [1] => 31 [2] => 16 [3] => 16 [4] => 6 [5] => 4 [6] => 4 [7] => 3 [8] => 2 [9] => 2 [10] => 2 [11] => 2 [12] => 2 [13] => 2 [14] => 2 [15] => 2 [16] => 1 [17] => 1 [18] => 1 [19] => 1 [20] => 1 [21] => 1 [22] => 1 [23] => 1 [24] => 1 [25] => 1 [26] => 1 [27] => 1 [28] => 1 [29] => 1 [30] => 1 [31] => 1 [32] => 1 [33] => 1 [34] => 1 ) when what I need is set the variable $datay to be something like this $datay=array(12,8,19,3,10,5,55,88,3); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Searching MySQL 'text' field
I've setup a search page using PHP which when searching a MySQL 'varchar' field it works just fine, but I'm trying to extend the search to include a field that is a 'text' field and it keeps coming back with no results. Is searching text fields allowed? It would seem that it only be logical that it would be. Is there something special I have to do to have this field searched? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Who's Online
I have a membership base that is logging into a php and MySQL based web site and am wanting to be able to create a who's online (and perhaps an ability to contact that person, but that's later) so that that person's profile is available. Anyone have any ideas where I could download a quick script someone to plug it in or if not a tutorial on how to make that happen? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Search Results - Web Page has Expired after Viewing Results
I've successfully created a search and result page for a dating site which off of the result page is a detail page for reviewing the profile online and so forth. The problem I'm having is once a user does his/her search they may come up with a number of results which after reviewing one of the members details the search has to be done over again. If a user uses the back arrow or if I use a javascript that causes the user to go back one page they get the typical "Web Page has Expired after Viewing Results" message. Now I that I can create profiles that are viewed from a pop-up window, but that's really not convent. Is there any way to for go the expired page message so that a user can go back to their results? Or does anyone have any suggestions on better handling this? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Search Results - Web Page has Expired after Viewing Results
When I do that I get syntax errors in the SQL "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Simple answer is - use GET method instead of POST for your searches -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Search Results - Web Page has Expired after Viewing Results
That did it. Thanks (in all the years I have been doing this you think I would have learned that already) "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Changing the method also implies changing $_POST to $_GET in your code. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
After upgrading to MySQL 4.0.1.2 I ma getting the message : Fatal error: Call to undefined function: mysql_connect() in /home/penpals/pub/mysql.php on line 3 Please help my production server is down! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
Just so you know, MySQL is working. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
Yes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
This is not helping me. I know very well that I should not and I tried the upgrade on two other machines and all went wll. My problem still stands and a search does ntohiong but tell me to check that the path is correct. If it worked before then obviously the path is fine, unless something has changed. Please I need help getting this thing up now. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
For some reason I do not see any error logs for today. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
I think the point is here that I can connect with a MySQL client, so MySQL is running. I cannot however connect using PHP. What would cause this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
I'm sorry I have no idea what that means. "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > try > ldd /usr/lib/php4/mysql.so -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
When I try to restart Apche I get the following error: PHP Warning: Unable to load dynamic library '/usr/lib/php4/mysql.so' - /usr/lib/php4/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 Any ideas, pleas ethis thing is still down. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
There is no mysql.so file "Lucas Lain" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > ldd /usr/lib/php4/mysql.so? > > Vernon wrote: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
When I try to install that I am told: libmysqlclient.so.10 is needed by php-mysql-4.1.2-7.2.6 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
OK, I looked up that file and found that I needed to install the MySQL-shared-3.23.51-1.i386.rpm which I did and realized that I already have the php-mysql installed. But am still getting the same erro message when restarting. However I did find the file you were asking about but in the /usr/lib/php folder and here is what I got: ldd /usr/lib/php/mysql.so libmysqlclient.so.10 => /usr/lib/libmysqlclient.so.10 (0x40026000) libc.so.6 => /lib/i686/libc.so.6 (0x40057000) libz.so.1 => /usr/lib/libz.so.1 (0x40193000) libcrypt.so.1 => /lib/libcrypt.so.1 (0x401a1000) libnsl.so.1 => /lib/libnsl.so.1 (0x401ce000) libm.so.6 => /lib/i686/libm.so.6 (0x401e5000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x8000) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
I finally got it! I had to downgrade to an older verison of the php-mysql for God know what reason. I am back up now. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Converting a large number of passwords to MD5 at once.
I made the mistake of opening a web site with encrypting the passwords stored in the database and want to encrypt them all in one fell swoop. Any ideas on how to do that? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MD5 login troubles
Hey all, I'm using the following code to save an MD5 password into a database along with an unencrypted username and email address: $insertSQL = sprintf("INSERT INTO penpals (email, password, username) VALUES (%s, MD5(%s), %s)", All seems to have worked well, the password is encrypted and so forth. I have also attempted to use the following MySQL command to encrypt the password and came up with the same result: UPDATE penpals SET password = MD5(password) WHERE ID = 1 So the trouble seems to be with the login where I am using the following code: SELECT email, password, access FROM penpals WHERE email= '%s' AND password = MD5('%s') Am I missing something here? Am I some how double encrypting the password? Is there a de-encrypt function or something I'm missing? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MD5 Passwords (How it works?)
I'm thinking that the MD5 function more than likely encrypts a password to store into a database, and when you log in using the MD5 function it will simply encrypt the value being passed along again the same way. Now I'm wondering what happens when I user has lost there password and needs to retrieve it, there is no way to reverse the process is there? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MD5 Password Login Driving me Crazy
For what ever reason I cannot seem to get a user to login using MD5. The user creates the password on log and it works fine, password encrypted and all. I test to see if the process is working ok on creation by using the UPDATE penpals SET password = MD5(password) and the encrypted passwords match. When the user goes to login into the page though I have the encrypted password echo to the page and they match except a 52 on the end of it which I am assuming is a space or something being picked up on submit or something. I recall there is a way to trim the field so that it doesn't pick up spaces but can't recall what it is. Anyone know what it is and if it could be that? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Web Based Video Conferencing Solution
Anyone know of a video conferencing solution (hopefully GNU) for use within a php web site? I'm looking to do something where a number of people can video conference at the same time. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Deleting Files
I need to have files that exist within a folder on my server based on the a MySQL record that contains it's name. What command would I be looking for in the php functions list? Anyone? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Resizing Images Uploaded to Web Page
I have users uploading images to a server and need to have those files resized on upload. I looked under filesystem, but found nothing like that. Anyone? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SQL DISTINCT with MYSQL
I'm setting up a user online system using MySQL where I have 4 fields, all of which is working fine. I need the information from all the fields but want only distinct values based on the uname column. If I use the: SELECT DISTINCT uname FROM useronline of course I come back with the values I desire, but only the user names. As I am also tracking the page they are on I need other columns in the table as well. So the question is, using an SQL statement, how do I return only distinct useronline.uname values from the database as well as the useronline.file column? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SQL DISTINCT with MYSQL
The problem is > a f1 > a f2 > b f1 > b f2 Where I need it to return the a only once and the b only once. For instance the vlaues may be: jimmy login.php jimmy successfullogin.php susan default.php susan search.php Since the records are order the way I need them to be (or else I could use a ORDER BY command) the last one is the only one I want and only want to return: jimmy successfullogin.php susan search.php make sense? "Arturo Barajas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Vernon, > > Don't know if I get it right, but: > > SELECT DISTINCT uname, file > FROM useronline > > should do that. > > I mean, if you have something like: > > uname file > a f1 > a f2 > a f1 > a f2 > b f1 > b f2 > b f1 > > the query should deliver: > > uname file > a f1 > a f2 > b f1 > b f2 > > Is that what you're looking for? > -- > Un gran saludo/Big regards... >Arturo Barajas, IT/Systems PPG MX (SJDR) >(427) 271-9918, x448 > > > -Original Message- > > From: Vernon [mailto:[EMAIL PROTECTED] > > Sent: Jueves, 13 de Marzo de 2003 06:24 p.m. > > To: [EMAIL PROTECTED] > > Subject: [PHP] SQL DISTINCT with MYSQL > > > > > > I'm setting up a user online system using MySQL where I have > > 4 fields, all > > of which is working fine. > > > > I need the information from all the fields but want only > > distinct values > > based on the uname column. If I use the: > > > > SELECT DISTINCT uname > > FROM useronline > > > > of course I come back with the values I desire, but only the > > user names. > > > > As I am also tracking the page they are on I need other > > columns in the table > > as well. So the question is, using an SQL statement, how do I > > return only > > distinct useronline.uname values from the database as well as the > > useronline.file column? > > > > Thanks > > > > > > > > > > > > -- > > 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] Convert Date to MySQL format
I've had to convert times in a MySQL field to a normal date, but never in reverse. How to I convert a date in this format, 03/14/2003, to MySQL format so it can be posted to a date field? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Text boxes posted to MySQL record that contain quotes
I know that using stripslashes will remove \ using php but I'm having trouble with posting quotation marks in a text record field. Anyone know how I can get them to post to the database? It's basically like an email and I'd like anything written to be able to post. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Text boxes posted to MySQL record that contain quotes
OK when I use the mysql_escape_string() it adds the slashes so that the message will have \"the message\" so I've tried using the stripslashes() as such: $message = stripslashes(mysql_escape_string($HTTP_POST_VARS['message'])); which then causes the orginal problem, so it seems that I keep trying to reverse each other. I don't want the slashes and I need the quotes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Email always set to server's email, why?
All the email coming from a web site, even though I have set the Reply-To, have the Reply-To set to [EMAIL PROTECTED] Anyone have any ideas why? I want the reply-to set to somethign else. Here is what I have: mail("$clubemail", "$subject", "$message" , "From: $email\r\n","Reply-To: $email"); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sorting Recordset by a calculation between 2 Records
I am calculating distances between to record's zip codes using php and have a need to sort the recordset by that value. How do I do something like this? I mean it's not a value in the table that I can use the SQL ORDER BY statement. I want to be able to have the distances closest to the individual first. Any ideas? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sorting Recordset by a calculation between 2 Records
> When you say "using php" I'm assuming that this means you are not doing > the calculation at the database, but rather in your PHP code. Correct. > Use the distance you've calculated as the numeric index of an array, pointing to > the record that corresponds to that distance. Can you please expalin this statement? Perhaps a tutorial somewhere? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using includes with page locations
Please forgive the ignorance of this question but I am trying to use an include for a site navigation menu and am having a hard time figuring out how to point at the route of the site. For instance I may have home set as index.php, but if my users are in messages/index.php that will always bring that back to the same page. I know in ASP there is a way to set the root directory, how do I do that in PHP. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Uploading Files Via PHP
Is there some thing that needs to be turned on in the php.ini in order to be able to upload photos VIA php? I have the same script on one machine with the right permissions on the upload dirs on one machine and am moving to another machine which is not being uploaded. Funny thing is I'm not getting any errors in the Apache logs. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Webtrends
I know this is sort of off topic but I was wondering it any one knew if there was a GNU version of Webtrends or perhaps a GNU equivalent, maybe in php to use on an Apache Linux Red Hat server? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Do not display page errors...
Not sure if there is an html tag or php that will tell a page not to display any errors on the page, but does anyone know how to do that? I want to hide any error that might be displayed, JavaScript or otherwise. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GNU Distance Calculation - for the world in php
I have a way of getting the distances from one zip code to the next in the US, but I need to be able to do that for other countries as well. I've found a web site on the net that sells a database of all postal codes and their longitude and latitudes but they want a $1000 which I am not willing to pay, especially since I got all the US zips for free. Anyone know where I can get a database with all the postal codes and so forth or perhaps a couple different ones and hopefully the code in php to calculate the distances. I need to be able to at least do major countries in the world from one place in that country to the next. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Web Server Firewall Suggested
I am very big on Internet security and anyone running a web server should know IPChains and IPTables. If you don't get a couple of books and learn. Once you understand how things work you we will be much better equipped to handle any security issues that may come up. Having said that you don't really need to know these items (but again anyone running a web server that does not, IMHO, is crazy) when using Bastille-Linux (http://www.bastille-linux.org/). This is lock down yor box very well and create the scripts needed to protect your system. Be careful though and read all prompts carefully as it can lock the box down so tight it won't let you in. ;) V -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Wild Card with unlink
I'm trying to delete two files in on fell shoop. One is defined with $file2 // returns "filename without extension" $filename_small = substr($file1, 8, 10); // returns define location and file name to delete $file2 = "/home/httpd/vhosts/servername/httpdocs/photoalbum/$filename_small"; // the other file name has _small appended to it with it's owen extension (png, jpg, gif, etc.) // I thought it would be this but it doesn't work unlink("$file2"."_small.*"); Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Wild Card with unlink
Figured it out thanks anyway for looking. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] File lsiting exec(ls... using variables.
I'm trying to add a variable to the end of a directory listing. This will give me the root directory and show me all the files exec('ls /home/httpd/vhosts/sitename.com/httpdocs/resumes/', $filelist); I figured I could do this but it shows me all the files in the root of the site not of the folder I want. So what it seems is that it is ignoring the $path variable all together. $folder = $HTTP_GET_VARS['id']; $path = "/home/httpd/vhosts/sitename.com/httpdocs/resumes/$folder/"; exec('ls $path', $filelist); I've even tried to add echo but then nothing at all is listed: exec('ls ', $filelist); Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Quick SQL Question
I'm using the "ORDER BY RAND() LIMIT 0,1" to give be a random record from a recordset but it seems like it puts a real heavy load on the server. Is there a better way to pull a random record from a database? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick SQL Question
Here it is: SELECT penpals.username, penpals.zoneid, penpals_photos.album, penpals_photos.rating, zones.zone_id, zones.zone_code, penpals_photos.filename, penpals.city FROM penpals, penpals_photos, zones WHERE penpals.username = penpals_photos.album AND penpals_photos.rating != 'X' AND penpals.zoneid = zones.zone_id ORDER BY RAND() LIMIT 0,1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] User's Screen Resolution Size
I what to be able to set a variable based on user's screen resolution. Can anyone tell me who to do that? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] User's Screen Resolution Size
The point is I don't know how to do that. That's why I was asking. :) Vern -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] User's Screen Resolution Size
Thats' great! Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] User's Screen Resolution Size
Not for nothing, but every time I post to this group I get treated poorly. It has to do with php and I've already gotten an answer from this group, off the PHP web site no less! http://www.php.net/manual/en/faq.html.php#faq.html.javascript-variable Doesn't take much to spread a little kindness. If you didn't want to respond, nothing making you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] User's Screen Resolution Size
Missing the point all tighter. The point now is merely that courtesy goes a long way. Why some one needs to respond in such a fashion is beyond me. I think it's pretty simple, if I'm posting to a php group, then obviously I'm using php. Also very simple, yet again, is if you don't want to waste your time responding then why do you? Some one else answered with a good response. I do my home work. I Google but don't always know how to phrase the question in Google, forgive me! But when I ask a human being, more than likely they know what I'm asking and as in this case I got my answer. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Error in code - Seems simple enough
I'm having trouble with the following code dispalying an error, which I don't understand because the code actually works (other than the error). Any ideas? Login"; } else { echo "Logout"; } ?> Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error in code - Seems simple enough
That's the thing, everything works but the error message keeps coming up? Runtime Error: Syntax Error -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] UPDATE MySQL
Can anyone tell me what's wrong with theis code. I don't get any errors but the databse is never updated: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php Wildcard???
Hey all, I'm coming over from programming ASP in VBScript and I know that a wildcard there is '%' can anyone tell me what it is in PHP? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Check Left 4 characters of Form Variable
I have a form that is acting like an email page where there Subject is being submitted from one page to another and tagging the subject with "RE: ". I want to be able tack the RE: on but only if it doesn't already have it there. I know that I can use and if statement, but how to I check the left 4 characters: '" } else { echo "'" } ?> Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Distance Based on Zip Code
Does anyone know how I can set something up that tells the distance between one Zip Code and another? I'm needing to be able to set something up where one user's record is compared to another and a distance is measured. Any have any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Form Submitted without Submit Button????
I've gotten Geozip, as was suggested here, and I need to return the value of a form that contains two zip codes (one each from two different recordsets) binded to hidden fields which is then submitted to the "cgi-bin/geozip.pl" which then returns the distance between them. My problem is how do I get that info to display on a results page? Typically this works by entering the zip code in text fields and having the user hit a submit button. However I don't want the user to have to hit a submit button I want the info displayed automatically. Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Submitted without Submit Button????
> In case you have them already available in your script, you could execute > the geozip.pl using exec() or system(), and merging the result into your > output. They are in the script. But how do I use these exec() or system()? Are they javascript? Could you give me an example? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session Not Registering on Page it is Set On
These pup session are going to drive me nuts! I can't seem to get this session to register on the same page it is set. For instance I load a record, then set a session right after it using: session_register("suckered"); $suckered = $row_rouser['ID']; The session is set throughout the site, but not on the page I set it on. What am I doing wrong? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Boolean Searches using PHP and using File System fgetss
I'm wondering if anyone knows of a good file system script that allows some one to do searches on files in a directory. For instance I'm storing resumes in folder defined on upload dates and so forth and want to be able to do searches through these files for keywords and would like to be able to do Boolean searches and hopefully return a brief description and perhaps a percentage relevance. What is very important is the Boolean thing as I need to be able to do searches like "this AND that" OR "this AND NOT that" Any ideas? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HELP NEEDED PLEASE - IMAP, MySQL and PHP
Hello all, I have been struggling for some time now to develop or find some product that will allow me to scan documents (I have that part down no problem, using OMNIPAGE 14.0) and put then into a searchable database with a copy of it in some form that is readable like a formatted txt file. I am looking for the easiest way to do this. I'm thinking if I can have the files emailed into a MySQL database that would work expect the programs I have found, however,will not allow me to bring the attachments into the database. I've tried Xeoport which uses IMAP to access the email records and pull all but the attachments in. Anyone know of anything that will help me do this? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL Sub search - Is there such a thing?
Some one is asking me to create a sub search on a search that has already been done. For instance, the database has 50,000 records, a user does a search for two keywords which yielded 1700 records. They want to now filter that list with other keywords. The logic is that searching 1700 records has got to be faster than searching 50,000 records. The only way I know how to do this is to save the results of the pervious search to hidden fields and allow the user to add more keywords, which in essence isn't doing other than adding more keywords to the search doing the same exact thing they did before with new keywords. Is this logic correct or is there a way to save that queries results and search only that? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question about an array
I want to create an array with some text. Let's say the following: $sometext = array(explode(" ", "Objective: Position as a Machine Attendant and or Operator Summary - Over 16 years experience in packaging and maintenance of various operating machinery. - 13 years experience in cutting steel and operating a steel press. - Part time experience in packaging and shipping bread for a bakery.")); I can easily return that text using: print_r($sometext); However I want loop through that text for to bold certain words in the array. In any event I've tried using the following but it only returns "sometext at[0] is: [Array]" which is not want I want, I want it to show me each word in the array through the loop. Any ideas what I am doing wrong? $arrayLength = count($sometext); for ($i = 0; $i < $arrayLength; $i++){ echo "sometext at[" . $i . "] is: [" .$sometext[$i] . "]\n"; } Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Remove quotes from form field
I'm having trouble returning the value less the quatation marks from the following: $words=explode(" ", strtolower($keywords)); I'm having the words from the form field put into an array. Problem is if the field contains something like trackworker AND "New York" It seperates the words into the array as follows: Array ( [0] => trackworker [1] => "new [2] => york" ) Therefore not finding the words "new york" because they don't exist like that but rather without the quotaions. Question is how do I remove the quatation marks so it returns? Array ( [0] => trackworker [1] => new [2] => york ) Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Remove quotes from form field
The search is already completd. The previous response answered my question. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] str_replace to ignore commas
I'm trying to use str_replace to ignore sertain characters from a recordset field and it seems I am having difficulties with ignoring commas and carriage returns. I've gotten the following but when searching for, let's say, New York. When York is at the end of a sentence from a recordset field it is skipped and if it has a comma like York, it is skipped. Any ideas? Here's the code I'm using so far //IGNORED CHARACTERS $replacement = array("\"", "\,", ".", "!", "?"); //CREATE THE ARRAY OF WORDS //STRIP SLASHES, IGNORE CAPS, IGNORE REPLACEMET CHARACTERS //$keywords = form field value $words=explode(" ", stripslashes(strtolower(str_replace($replacement, "", $keywords; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_replace to ignore commas
> could the problem be that you explode on " " so the phrase 'New York', > having a space, is split up? Could be. Some times the New is on one line and the York is on the next line. I need for it to explode no matter what. How would I do that? For instance the print_r for the array shows me this in one instance. None of which is hightlighted (and should be) in other words all of these where skipped and the New York should have been selected. I know that the comma is causing trouble as well. /> New [913] => York, [914] => New [915] => York /> Dear [917] => Mr. [918] => Conlin: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_replace to ignore commas
> Nowhere in your replacement array do you check for, or remove, > carriage returns. > Add this \n to it: > $replacement = array("\"", "\,", ".", "!", "?", "\n"); > Your exploded array should now be correct. When I do this I get some really unexpected results. Almost everything comes up bold. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Identifiying multiple records for databse submission
I'm creating a resume database where I am having resumes submitted to this database and keyword searches done. All works. Now I need to have a way of tagging items found in the database much like a shopping cart. So, I have a unique ID created each time someone does a search on the page which is based on the time and date. Each time a search is done the old one is destroyed and a new ID created. Users will search the database and select resumes they think are suitable and tag them, before doing a new search they will submit the resumes (actually the IDs of the resumes) to a table. I'm wondering what is the best way to do something like this. Each resume needs to be tagged when a popup window of the resume is open. Any ideas? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Identifiying multiple records for databse submission
Sure glad I figured it out myself. :( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] str_replace and TABS
I'm using the following to replace certain characters but am having troubles with TABS. How do I find them? $replacement = array("\"", ",", ".", "!", "?",";", ":",")","(","\n"); Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: str_replace and TABS
In case anyone wanted to know I found it: $replacement = array("\"", ",", ".", "!", "?",";", ":",")","(","\n", "\t", "\v"); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session not working...
I'm in the process of moving to a new server and no sessions are working. Does something need to be set in the php.ini file? Why would sessions not be working? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Session not working...
Figured it out. Had to turn on RegisterGolbals (which I had, but didn't restart Apache). Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP: Mulitiple Arrary Sort
I've gotten the one array down and I've figured out how to sort that array, however, I need to sort the array by the modified date of the file. Here's what I got so far: "; } } } ?> Any ideas on how to fix this? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP: Mulitiple Arrary Sort
This may be a stupid question, but I am sick and under the guy and am wondering if you could you show me how to simply echo each file name using the exmaple below? Thanks "Jim Lucas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Jim Lucas wrote: ok, here would be my version of this code. $file, 'filemtime' => $filemtime, ); # This is the list of filemtimes to sort by later $filemtimes[] = $filemtime; } # Sort array based on $filemtimes # http://php.net/array-multisort Example #3 if ( array_multisort($filemtimes, SORT_DESC, $sorting_list) ) { echo "List was sorted by filemtime\n"; } else { echo "List was not sorted by filemtime\n"; } var_dump($sorting_list); } else { echo 'Directory listing call failed!'; } ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP: Mulitiple Arrary Sort
Ok, I've gotten the following so far, which is giving me the results, except it is still sorting by file name and not the file's date. $file, 'filemtime' => $filemtime); # This is the list of filemtimes to sort by later $filemtimes[] = $filemtime; # Sort array based on $filemtimes # http://php.net/array-multisort Example #3 if (array_multisort($filemtimes, SORT_DESC, $sorting_list) ) { echo date("m-d-Y", filemtime($file)) . " " . $file . "\n"; } } } else { echo 'Directory listing call failed!'; } ?> Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP: Mulitiple Arrary Sort
I'm really starting to feel incompitant here. Sorry to ask, but could you show me what you mean? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP: Mulitiple Arrary Sort
All is weel except for 2 things: 1. $filemtime = filemtime( $dir . $file ); needed to be changed to > $filemtime = filemtime( $file ); 2. The filename is the same filename over and over again. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP: Mulitiple Arrary Sort
SOLVED! I made the following change as well to fix the file name: BEFORE: echo date("m-d-Y", $entry['filemtime']) . " {$file}\n"; AFTER: echo date("m-d-Y", $entry['filemtime']) . $entry['filename'] . " />\n"; One last question. The $entry['filename'] is the file name and path: /home/website/public_html/resumes/1218044880/filename.htm How do I get it to display filename.htm only? Thanks for all your help Jim. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP: Mulitiple Arrary Sort
That worked great. Thanks. "Micah Gersten" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] http://us3.php.net/basename -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Replace space from form field using preg_replace
I want to be able to replace a space that comes from a form field (such as in 123 My Street) with a + sign. Can anyone help me with this? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upload file field not working as a form element
As much as I try I cannot get a file field in a form inserted into a MySQL record. I've even tried to get it to echo to the page when the page is submitted to itself and it's not reading the field. What am I missing here? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Upload file field not working as a form element
All I am trying to do is insert the file name, not the file. The file is being uploaded to the server in a specific location. All I need is the filename inserted into the database. I've gotten the upload part to work and everything I just can't get the file name inserted for God knows what reason. I removed the upload code and am simply trying to insert the filename and userid into the database. The userid goes in but I cannot get the file name inserted. Here is the form: and here is the php code http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Upload file field not working as a form element
> The uploaded file name will be $HTTP_POST_FILES["filename"]["name"] -- use > that rather than $_POST["filename"]. I'm sorry I don't understand. What is the extra ["name"] for? When I use this in the insert into the value that is inserted into the database is Array, as opposed to the actual filename. Thanks -V -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cookies help please
Hiya, Ive got a few websites that use sessions and I thought id upgrade them now to use cookies. In the main file it calls the session start function, and then this function is called, but it does not seem to work. I open a new window and the cookie does not seem to auto log me on. Sorry if I have not explained it right, I want a feature like amazon where you go back to a site and you are still logged in. The test member has rememberpassword as y. The code below keeps my sessions but the cookie bit dosent work. Thanks, Steve XX /* Check a session is valid */ function session_check($db_link) { //Ok so either want to log on, or have a session or cookie allready if(isset($_SESSION['ssun']) || isset($_COKKIE["ssun"]) || isset($_POST['ssname'])) { //Attempt to logon. Set the logon form variables to the session variables. if(isset($_POST['sspass'])&&isset($_POST['ssname'])) { $_SESSION['sspw'] =$_POST['sspass']; $_SESSION['ssun'] =$_POST['ssname']; if(isset($_COOKIE["ssun"])) { $_COOKIE['ssun']=""; $_COOKIE["ssun"]=""; } } if(isset($_COOKIE["ssun"])) { $result = mysql_query("SELECT rememberpassword, memberid, title, lastname, lastnamenow, md5(memberpassword), email FROM members WHERE md5(memberpassword)='".$_COOKIE['sspw']."' AND email='".$_COOKIE['ssun']."'", $db_link); } else { //Check if the session username and password are correct $result = mysql_query("SELECT rememberpassword, memberid, title, lastname, lastnamenow, md5(memberpassword), email FROM members WHERE memberpassword='".$_SESSION['sspw']."' AND email='".$_SESSION['ssun']."'", $db_link); } if(mysql_num_rows($result)==1) { $loggedin="yes"; $userdata = mysql_fetch_row($result); if($userdata[0]=="y") { //Set up the cookies, store the md5 version of the password setcookie ("ssun", $userdata[6],time()+604800); setcookie ("sspw", $userdata[5],time()+604800); } if($userdata[4]=="") //If no last name now { $_SESSION['title']=$userdata[2]; $_SESSION['lastname']=$userdata[3]; } else //Use the last name now { $_SESSION['title']=$userdata[2]; $_SESSION['lastname']=$userdata[4]; } } else { $loggedin="no"; } if(isset($_GET['logoff'])) { if($_GET['logoff']=="true") { //Remove the session and cookies $loggedin="no"; $_SESSION['ssun']=""; $_SESSION['sspw']=""; $_SESSION['title']=""; $_SESSION['lastname']=""; setcookie ("ssun", "",time()-3600); setcookie ("sspw", "",time()-3600); } } return $loggedin; } else { return "no"; } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cookies help please
Thanks a million, must of had something else on my mind ;-) Love, Steve XX -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Looping through Form Elements in a form
Hiya, I am working on a generic JavaScript form checked, that takes the names of the elements, with the first two letters being the type of element, so its checks that it is right, if not gives a generic error message e.g. YOu Need To Fill this in and selects it, or Sorry only numbers are allowed in this box or Email addresses only, so reemail could mean a field which is required and an email address. . JavaScript as long as you have a link to the object of the form, gives the elements in an array. Is there a way to do this in PHP? Have a form with the action something like register.php?action=updatemembers with members being a table name. The elements would be checked like JavaScripts checks them. Ok I would need to then set the order and manually do the call to the database, but it would be nice not to have to do the manuual checks on the elements. So a function to check all the elements in a form in PHP would be nice, then if it fails it would return an array with the wrong fields, and the error, this could then be used to make a page where they correct there mistakes. Thanks! Love, Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Image resize with database
(PHP 4.23, GD 1.6.2 or higher) Hiya, I have code to place the picture in a database, and I normally shrink it when the user requests a picture. What I would like it to change to is that it should shrink or expand the picture to be 300 pixels wide and then place it into the database. I thought the function below would work to do to return a text resized version. It does sort of works, but makes a picture where only part of it is the picture (top part), the rest is blank. Any help would be gr8! THanks, Steve function shrink_picture($tmp_name,$size,$name) { $result = ereg(".gif$",strtolower($name)); if($result) { $img = imagecreatefromgif($tmp_name); } else { $img = imagecreatefromjpeg($tmp_name); } $width = imagesx($img); $height = imagesy($img); $new_height = abs(300.0 * ($height/$width)); $new_img = imagecreate(300, $new_height ); imagecopyresized($new_img,$img,0,0,0,0,300,$new_height,imagesx($img),imagesy ($img)); imagejpeg($new_img,$tmp_name."a",70); imagedestroy($new_img); imagedestroy($img); $data = addslashes(fread(fopen($tmp_name."a","r"),$size)); return $data; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] JavaScript or browser detection
Hiya, I know it is probably out there somewhere, but I cannot find out a script to detect the browser. I have seen it, and I sorta remember how to do it, but I just can't find it! I have a script that adds nice features to my webpage, but if JavaScript is off the site still can be used. Basically the script does not work in Netscape 4.08 but works above that, so either I could bracket out and check the code, but in this case I cannot as it is code I am not allowed to alter, and I include it, it is not in my HTML file. So I need a way to say in PHP this is a bad web browser for JavaScript, so ignore this bit of the file. Thanks, Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Images not stored in Databases
Hiya, I have had help from a very useful person on storing images in databases, and basically now I don't want to do this. But I may end up storing a lot of pictures, and don't want to mess around. Is there a script or class, that is as simple as storing in a database, that will handle possibly millions of pictures, and given a picture will return the URL where it is stored? I suppose I could build one myself, but I can see it being quite difficult, with problems such as maximum number of files in directories etc. I have had a look at a few PHP pages, but cannot find anything suitable. Any help would be great. Have a great Christmas. Love, Steve XX -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php