[PHP] Mysql update problems
I've been scratching my head over the following code for a while now. It's supposed to check a given weblog for specific tags, and if they're present, update the weblog's table in my database. I believe the problem is around the execution of the db query, but I can't seem to get it figured out. function is_news($address, $blogtitle, $host, $user, $pass, $dbname){ $f = fopen($address, 'r'); $read = fread($f, 2); fclose($f); $title_start = strpos($read, ""); $title_end = strpos($read, ""); $title = substr($read, $title_start, ($title_end - $title_start)); $blog_start = strpos($read, ""); $blog_end = strpos($read, ""); $blog = substr($read, $blog_start, ($blog_end - $blog_start)); $link = mysql_connect($host, $user, $pass) or die("Can't connect to database"); $query = "update bloggers set cache='$blog', title='$title' where url='$address'"; if(mysql_db_query ($dbname, $query, $link)) { $is_news = 1; }else{ $is_news = 0; } return $is_news; } Thanks a million for any help, Jesse Lawrence __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Hitting return in a textarea box...
I'm putting together a message board, and I'm having problems with hitting the return(enter) key within my textarea. I've looked around for a solution, I tried wrap="hard", wrap="soft" and wrap="vitual" and none of them worked (should they? I may have done it wrong?) and I also tried nohardbreaks and nosoftbreaks, but I think they may be no longer supported. Is this a case for regex? If so, can someone perhaps point me to an article on how to accomplish this? Thanks very much for any help. Jesse __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Image upload into database
I've setup an image upload feature on a site, which uploads images into a mysql database. The uploads are working absolutely as expected on my local computer (the server), but when someone else tried to upload, only 1/3 of the image was uploaded. Could it be a matter of size? I was originally using just a Blob, and have since switched to a Long Blob. Any thoughts or comments on this would be greatly appreciated. Thanks a bunch, Jesse __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Create a link where http://
Hello there, I'm putting together a message board, and would like to automatically turn any instance of http://whatever into a link, without requiring the viewers to enter html. I'm thinking regex is probably the way to go with this, but I'm not really seeing how to do it. If someone could point me towards a solution, it would be greatly appreciated. Thanks very much, Jesse Lawrence http://soniceast.d2g.ca/jesse/ __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] make problems, sapi
Hello all, I'm trying to install php 4.2.2 as a DSO with Apache-2.0.40 on a Mandrake Linux machine, and have come come upon a problem. It's having problems with sapi(?). I'm just wondering if anyone might know what is causing this problem, and if you could possibly point me towards a solution. Here's the error message: sapi_apache2.c: In function `php_register_hook': sapi_apache2.c:534: warning: passing arg 3 of `ap_register_output_filter' makes pointer from integer without a cast sapi_apache2.c:534: too few arguments to function `ap_register_output_filter' sapi_apache2.c:535: warning: passing arg 3 of `ap_register_input_filter' makes pointer from integer without a cast sapi_apache2.c:535: too few arguments to function `ap_register_input_filter' make[3]: *** [sapi_apache2.lo] Error 1 make[3]: Leaving directory `/home/jalaw/downloads/php-4.2.2/sapi/apachefilter' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/jalaw/downloads/php-4.2.2/sapi/apachefilter' make[1]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/jalaw/downloads/php-4.2.2/sapi/' make: *** [all-recursive] Error 1 Thanks very much, Jesse Lawrence __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strange error message when trying to start apache
Hello again, so earlier I was trying to install PHP-4.2.2 with Apache-2.0.40 and was having some sapi problems. I then read that I might be better off going with Apache-1.3.26. Well, I installed 1.3.26, and then configured and installed php into apache as a DSO. Everything appeared to go smoothly, except when I try to start up Apache, I get the following error message: Syntax error on line 205 of /usr/local/apache/conf/httpd.conf: API module structure `php4_module' in file /usr/local/apache/libexec/libphp4.so is garbled -perhaps this is not an Apache module DSO? /usr/local/apache/bin/apachectl start: httpd could not be started Can anyone lend me a hand with this? Thanks very much, Jesse Lawrence __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem updating post on a basic weblog system
Hello all, I've got a bit of a code problem that's been baffling me for a while now. I'm working on a basic weblog system for personal use, using MySQL. I've got the "new post" and "delete a post" aspects working fine, but for some reason, I can't get the "update a post" part happening. What happens is I select a post to update, and then the post comes up in a textarea box. You then make your update, and submit. Doing this calls the following function: function updateBlog($input,$edit_blog) { include 'db_connect.php'; $update_query = "update $table set blog='$input' where id='$edit_blog'"; if(mysql_db_query ($database, $update_query, $link)) { print "Successfully Edited!!"; }else{ print "no"; } The variables being passed to the function are: $input = "The body of the post" and $edit_blog = id # of post At this point everything appears to have been a success. The "Successfully Edited!!" confirmation appears, and everything seems fine, but when I look at my database, nothing has been updated or changed in any way. Does anyone have any suggestions or help they could lend me? I've been facing this problem for a while now, and can't seem to get my head around it. You can view the entire code here: http://soniceast.d2g.ca/~jalaw/blog/admin.txt Thanks a bunch for any help, Jesse Lawrence __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange submission problem
Hello everyone, In a simple signup form that I'm using, I send the variables to a script, which performs a function if ($submit == "register") { function(); } The problem is, my signup form isn't passing the submit variable, though it is passing the other variables in the form. The strange thing is, when I try this in the Opera web browser, the $submit variable does get passed along, but in both Mozilla and Konqueror, it does not. Have I made a little error in the following code? Any thoughts? Join ... Username: Name: Email: Homepage: About you: Password: Confirm Password: Your help is greatly appreciated, Jesse Lawrence __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange submission problem
Hmmm, that was the solution. That's kind of a strange little thing isn't it? Thanks a lot for your help, Jesse I've had this same problem. It seems that the value of submit is only sent if the button is clicked (netscape and internet explorer). Could it be that you're using the enter key to submit the form? The solution I used was to remove the value assignment to the submit button and set it in a hidden variable - Jacob At 10:58 09/19/2002, Jesse Lawrence wrote: >Hello everyone, >In a simple signup form that I'm using, I send the >variables to a script, which performs a function if >($submit == "register") { >function(); > } > >The problem is, my signup form isn't passing the >submit variable, though it is passing the other >variables in the form. > >The strange thing is, when I try this in the Opera web >browser, the $submit variable does get passed along, >but in both Mozilla and Konqueror, it does not. > >Have I made a little error in the following code? Any >thoughts? > > > > >Join ... > > >Username: > > >Name: > >Email: > >Homepage: > >About you: > > > > >Password: > >Confirm Password: > > > > /> > > > > > > > >Your help is greatly appreciated, >Jesse Lawrence > > __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] why isn
__ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] why isn't this working?
This little code snippet is from a login system that I've made, which takes unconfirmed user-info out of a mysql table, and places it into a confirmed table (Uses email confirmation). Now, this has really got me baffled, because it seemed to be working fine yesterday. Can anyone please tell me what's wrong with the following code? Your help will be greatly appreciated. //confirm and register new user, get info from unconfirmed_user and put it in user, then delete from unconfirmed_user function confirmNewUser ($confirm_new_user) { include '../config.php'; global $DB_INCLUDE; include $DB_INCLUDE; $user_wait = "select * from unconfirmed_user where username='$confirm_new_user'"; $user_result = mysql_db_query ($database, $user_wait, $link); while ($user_row = mysql_fetch_array($user_result)) { $insert_user = "insert into user values (' ','$user_row[name]','$user_row[email_address]','$user_row[password]','$user_row[access]','$user_row[username]','$user_row[description]','$user_row[homepage]','$user_row[online]','$user_row[image]')"; if (mysql_db_query ($database, $insert_user, $link)) { $Query2 = "delete from unconfirmed_user where user_id='$row[user_id]'"; if (mysql_db_query ($database, $Query2, $link)) { include $SERVER_ROOT.'admin/email.php'; mail($row[email_address], "Welcome to ".$SITE_NAME."",$mail_content,"From: News Bomber@".$SITE_DOMAIN ,"Reply-To: Auto Mailer"); print "Registration Complete\n"; print "Welcome to ".$SITE_NAME.", ".$row[name].". To make a news post, you must first LoginA welcome email has been sent to your email address. Check this out for info of interest about News Bomber.\n"; }else{ print "Registration Failed\n"; } }else{ print "Registration Failed\n"; } } } __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php