Jump to content

rajivgonsalves

Members
  • Posts

    2,166
  • Joined

  • Last visited

    Never

About rajivgonsalves

  • Birthday 07/31/1979

Contact Methods

  • MSN
    rajivgonsalves@hotmail.com
  • Website URL
    http://www.rajivgonsalves.com
  • Yahoo
    rajivgonsalves

Profile Information

  • Gender
    Male
  • Location
    Pune, India

rajivgonsalves's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. you got an error on line 35 this if ($src == 'home') { $src = admin.php'; } should be if ($src == 'home') { $src = 'admin.php'; }
  2. do you mean like a confirm box ? or a dialog ?
  3. if your looking for one that checks the starting letter I think the following should do <?php function getBefore($word) { return in_array(strtolower(substr($word,0,1)), array('a','e','i','o','u')) ? 'an' : 'a'; } echo getBefore('english') . '<br />'; echo getBefore('spanish') . '<br />'; ?>
  4. taking your example into consideration this should work <?php $string = '=? utf-8 ? B ? This is an example text ?='; $string = preg_replace("#=\? (.*?) \? (B|Q)? \? (.*?) \?=#", '$3', $string); echo $string; ?>
  5. I think your browser is doing the autofill not the website
  6. its should consider the following <?php $string = 'Sam Neill|William H. Macy|Tea Leoni|'; foreach (explode('|', $string) as $name) { if (!(empty($name))) echo "<a href='/Movies/&actor=" . urlencode($name) ."'>$name</a><br />"; } ?>
  7. You should study the designated site (browse threw it) and see if it has pagination there, then you can modify your script to add parameters so that you only fetch a limited amount of data at each call, this will ensure that your script is light on resources and only processes the amount of data it displays. However if you can't do this, I would suggest putting it in the database. 1) Write a script which processes data add/updates the database every 1/2 hour or 1 hour or which ever time interval you desire (so that your data is up to date) 2) Just write simple scripts to fetch data from the database and list them This will ensure that your listing on your site is fast. hope its helpful
  8. I would suggest parse all the data out and put it in a database, it will be faster and more controllable, then you can use a easy pagination script to achieve the 50 per page. you can do it with the code you already have but you would be parsing the pages everytime, One alternate solution would be parse out the pages and put it in the session and on pagination pick it up from the session instead of again parsing it out again. however if there is alot of data it would be slow.
  9. there is a logical error in your code try this <?php $st = isset($_POST['submit']) ? $_POST['state'] : ''; $urls = array(); if ($st == "AL") { $urls = array("http://auburn.craigslist.org", "http://bham.craigslist.org"); } else if ($st == "AK") { $urls= array("http://anchorage.craigslist.org"); } else if ($st == "AZ") { $urls = array("http://anchorage.craigslist.org"); } foreach ($urls as $url) { $html = file_get_contents("$url/muc/"); preg_match_all('/<a href="([^"]+)">([^<]+)<\/a><font size="-1">([^"]+)<\/font>/s', $html,$posts,PREG_SET_ORDER); //echo "<pre>";print_r($posts); foreach ($posts as $post) { //print $post[0]; //HTML $post[2] = str_ireplace($url,"",$post[2]); //remove domain echo "<a href=\"$url{$post[1]}\">{$post[2]}<font size=\"3\">{$post[3]}<br />"; print "<BR />\n"; } } ?>
  10. You would have to save your files with .php that is how the server identifies and parses out your php files unless you configure the server differently, for different date formatting you can see the following link http://php.net/manual/en/function.date.php there are examples which show you how you can format your date
  11. you can use strtotime with date e.g <?php echo date('F d', strtotime("-3 days")); ?>
  12. you'll have to check your query try echo $query; and see if its showing up correctly, also what is the column type for col_date
×
×
  • 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.