if($rewrite) {
			    echo "<p><a href=\"/blog-". $blog[0] ."-$clean_url\">" .$blog[3]."</a><br>";
			} else {
		        echo "<p><a href=\"". $blog_url ."?d=". $blog[0] ."\">" .$blog[3]."</a><br>";
			}

Hi Folks,

I am a complete novice with PHP and I cannot get this routine to work. I need to change $blog_url to an actual URL - http://www.mydomain.co.uk/blog_rec.php

I cannot seem to get the format right.

Any help will be greatly appreciated.

Thanks. John.

First of all I would tidy up your script so you can more easily read what you are doing, plus there appears to be an error in line 2:

if($rewrite) {
			    echo '<p><a href="/blog-'. $blog[0] .'-'.$clean_url.'">' .$blog[3].'</a><br>';
			} else {
		        echo '<p><a href="'. $blog_url .'?d='. $blog[0] .'">' .$blog[3].'</a><br>';
			}

If your $blog_url only holds blog_rec.php then change the 2nd echo to:

echo '<p><a href="http://www.mydomain.co.uk/'. $blog_url .'?d='. $blog[0] .'">' .$blog[3].'</a><br>';
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.