cmgmyr
Members-
Posts
1,278 -
Joined
-
Last visited
Never
Everything posted by cmgmyr
-
I've never used them but I would think that you would use them just like a regular query: mysql_query("COMMIT"); mysql_query("ROLLBACK");
-
Try this out: <?php include "connect.php"; $files = ""; $dir = "images/products"; //no trailing slash $path = opendir($dir); while (false !== ($file = readdir($path))) { if($file!="." && $file!="..") { if(is_file($dir."/".$file)) $files[]=$file; else $dirs[]=$dir."/".$file; } } if($files) { //Output information natcasesort($files); $x = 0; foreach ($files as $file){ //This is where you want to run your query $sql = "SELECT * FROM posts WHERE body LIKE \"%$file%\""; $result = mysql_query($sql); $count = mysql_num_rows($result); if($count == 0){ unlink($dir.$file); } } } closedir($path); ?>
-
there ya go...thats what I meant
-
I agree with that about the cell phone idea. For the amount of programming that you would have to do for only a few people to use??? Doesn't seem worth it for anyone. Let me put it into perspective so maybe you can explain it to your client. Who is going to fill out a classified ad on their cell phone? How long will that take someone to fill out an ad? ... Too long. No one wants to sit with their phone for 30 min to fill out an ad that they can do in 5 min or less in front of their computer. So, I offer this to you...Bring up the idea to your client that you can offer SMS alerts and notifications. 1. User signs up 2. User makes ad 3. If user chooses they can get text message notifications if someone "shows interest" in their add, maybe ad hits per day, if someone replies to the ad 4. Notifications on other ads if something changes...example: user1 posts an ad for a table for $100, user2 wants to "watch" the add (something like ebay), user1 doesn't sell it for 2 weeks and drops the price down to $50, the system now sends a SMS message to user2 stating that there was a price drop on an ad that he was watching...user2 logs into the site and sees the ad and buys the table ...obviously that was the quick and dirty explanation but I think you can take it from there. But do you see how you can flip a "bad" idea around to possibly get your customer more excited about what you can do for him? That means more features for him and his site and more work and $$$ for you... Hope this helps
-
ok ok sorry I found it... When I made my new config file I for got to copy: <?php $phpver = phpversion(); if ($phpver < '4.1.0') { $_GET = $HTTP_GET_VARS; $_POST = $HTTP_POST_VARS; $_SERVER = $HTTP_SERVER_VARS; } if ($phpver >= '4.0.4pl1' && strstr($_SERVER["HTTP_USER_AGENT"],'compatible')) { if (extension_loaded('zlib')) { ob_end_clean(); ob_start('ob_gzhandler'); } } else if ($phpver > '4.0') { if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) { if (extension_loaded('zlib')) { $do_gzip_compress = TRUE; ob_start(array('ob_gzhandler',5)); ob_implicit_flush(0); } } } $phpver = explode(".", $phpver); $phpver = "$phpver[0]$phpver[1]"; if ($phpver >= 41) { $PHP_SELF = $_SERVER['PHP_SELF']; } if (!ini_get("register_globals")) { import_request_variables('GPC'); } ?> now it works like a charm! Thanks for all the help guys! The moral of the story...copy your WHOLE config file...
-
hmmmm...then why would it work for 2 other sites on my localhost (I checked another one too)? ???
-
yeah i think thats a good idea, can someone hook that up?
-
header.php is just my header html i'm not using header: anywhere in the script
-
I'm on a different computer now but now I'm getting this... Line 59 is: setcookie("user","$info",0); delete cookie Warning: Cannot modify header information - headers already sent by (output started at C:\web\www\htdocs\tarson\header.php: in C:\web\www\htdocs\tarson\includes\do_login.php on line 59
-
you see where the values are being put into an html table? Just add input text boxes in there...make the whole thing a form and BAM! instant ajax dropdown DB form!
-
apache, php4, xp pro
-
You first will have to scan the directory for images. Then take each image and do a query like this: $sql = "SELECT * FROM posts WHERE body LIKE \"%$img_name%\""; count the number of rows in the query if($count ==0){ delete image } ...move on to next image Hope this helps
-
*Bump* any ideas?
-
Yes, I did change the cookie names, delete all my cookies, tried again...nothing
-
thanks frost but that didn't work either. It also doesn't make sense why 1 site works and 1 doesn't... ???
-
it's just a checkbox on the login form...but with or without it, it should still set the cookie. The information sent from the form has been validated and set into variables ($info) and I can echo $info. But the actual cookie is not setting.
-
Ok...this I don't get... I have: if (isset($remember)){ setcookie("user","$info",time()+1209600); }else{ setcookie("user","$info",0); } I can echo $info and it looks fine, but when i echo the cookie...nothing. I have this in 2 sites on my local computer...one works...one doesn't. I don't know why it's not setting the cookie. (it's going to the else statement) any ideas? Thanks
-
Centering Layers Between Different Screen Resolutions
cmgmyr replied to richie19rich77's topic in CSS Help
why don't you use width:100%;? Any div that you want centered in that first div you can use: margin: 0px auto; hope this helps -
Here is a little something that I use: <?php $page = $_SERVER['PHP_SELF']; $page = str_replace('/', '', $page); include "connect.php"; //Find the meta data $sql = mysql_query("SELECT * FROM meta_data WHERE page = \"$page\"") or die('Query failed: ' . mysql_error()); $count = mysql_num_rows($sql); if($count > 0){ $page_title = mysql_result($sql, 0, 'title'); $keywords = mysql_result($sql, 0, 'keywords'); $description = mysql_result($sql, 0, 'description'); $page_title = stripslashes($page_title); $keywords = stripslashes($keywords); $description = stripslashes($description); if(strlen($page_title) > 0){ $page_title .= " "; } }else{ $sql = mysql_query("SELECT * FROM meta_data WHERE page = \"default.php\"") or die('Query failed: ' . mysql_error()); $page_title = mysql_result($sql, 0, 'title'); $keywords = mysql_result($sql, 0, 'keywords'); $description = mysql_result($sql, 0, 'description'); $page_title = stripslashes($page_title); $keywords = stripslashes($keywords); $description = stripslashes($description); } ?> it just pulls the metadata from the DB for the page specified (if I put something into the DB). Then I just echo it in the html where it needs to go hope this helps.
-
The first thing that you should do is lookup SEO and how to use it in your website. Some things to help: 1. Submit your site to search engines ex. Google 2. Link your sites to as many other sites as you can 3. Advertise as much as you can When you first make a site it is NOT automatically indexed...you have to tell search engines that it is there. If you have a slow traffic site it could take up to 1 month to actually show up. If you have a high-traffic site it will be shorter...I've had a high traffic site get #1 in less then a week. Bottom line...Submit your link to search engines and get traffic traffic traffic AND content content content! Hope this helped
-
I would check out COMMIT and ROLLBACK with mysql. Check this out to get you started: http://www.databasejournal.com/features/mysql/article.php/3382171
-
hey no problem. That is the one that I found a while ago when I first started out (a few versions ago). I took what he wrote as an example and built and improved off of that. Membership sites are the way to go now, everyone wants them and they are willing to pay for them too...FYI
-
I know, I DID read that you only programmed it. I was just merely trying to say that if you don't like design...get someone else to do it for you . If you just wanted to test the functionality we do have a forum for that. (For future reference...please do not double post)
-
try something like this: <?php function login(){ include 'lib/config.php'; include 'lib/db_open.php'; // username and password sent from signup form $user=$_POST['username']; $pass=$_POST['password']; $sql="SELECT * FROM $tbl_login WHERE username='$user' and password='$pass'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $user and redirect to users location session_register("username"); header("location:index2.php"); } elseif($count!=1) { echo "<div style='text-align:center'>"; echo "<form name='form1' method='post' action='<?php echo $PHP_SELF;?>'>"; echo "<table border='0' cellpadding='3' cellspacing='3' style='padding-top:15px;margin:0 auto;'>"; echo "<tr>"; echo "<td>Username:</td>"; echo "<td><input name='username' id='username' type='text' size='20'></td>"; echo "</tr>"; echo "<tr>"; echo "<td>Password:</td>"; echo "<td><input name='password' id='password' type='password' size='20'></td>"; echo "</tr>"; echo "<tr align='right'>"; echo "<td colspan='2'><input name='Login' type='submit' id='Login' value=' Login '><input type=\"hidden\" name=\"action\" value=\"checklogin\"></td>"; echo "</tr>"; echo "</table>"; echo "</form>"; echo "</div>"; } else { echo "<b>Error:</b> Wrong Username or Password"; } } function checklogin(){ include 'lib/config.php'; include 'lib/db_open.php'; // username and password sent from signup form $user=$_POST['username']; $pass=$_POST['password']; $sql="SELECT * FROM $tbl_login WHERE username='$user' and password='$pass'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $user and redirect to users location session_register("username"); header("location:this_script.php"); // can also be header("location:this_script.php?action=login"); } else { echo "Wrong Username or Password"; } } switch ($action){ case "login": login(); break; case "checklogin": checklogin(); break; default: login(); break; } ?> *** notice the hidden value in your login form hope this helps
-
can you provide the script?