Jump to content

cmgmyr

Members
  • Posts

    1,278
  • Joined

  • Last visited

    Never

Posts posted by cmgmyr

  1. 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);
    ?>

  2. Is it bad that I would turn down half of the requests your clients make?

     

    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

  3. 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... ;D

  4. 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:8) in C:\web\www\htdocs\tarson\includes\do_login.php on line 59

  5. 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

  6. 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.

  7. 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 :)

  8. 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 ;)

  9. 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)

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.