I am new to PHP. I purchased a webpage that when I click an article title link, an article will come up, but it may not be the article that matches the title. When I go back to the article title, the title link has been replaced by another title link. When you click on that link, you may get the same article or a different one. What do I need to do to so that the article links stay put and the articles match the article titles??
You really need to look at the code that is generating the html page. It sounds as if it's got the record ids all mucked up.
I'm not sure what you mean by "You really need to look at the code that is generating the html page." This all looks like PHP to me
Yep, but that PHP is up to something and if you paste the relevant code in here we can let you know what is going on.
Thanks for the clarification Sarah. I misunderstood what you meant. I will get back to you with the relevant code on Monday or Tuesday. I don't have access to all of my files here. I work 4 hours from home, so I am only home a couple of days a week.
I think this is the code that is controlling the article rotation. $num_links_files = 3; $dir_kw = "../"; $dir_links = $dir_kw."links/"; $dir_articles = $dir_kw."includes/articles/"; if (isset($_POST['newkeywords'])) { if (isset($_SESSION['token']) && isset($_POST['token']) && $_POST['token'] == $_SESSION['token']) { function write_keyword_file($kwdir, $keyword, $article) { $keyword = preg_replace('/ /', '-', $keyword); $filename = $kwdir.$keyword.".php"; if($handle = fopen($filename, 'w')) { if($keyword == "index") { $content = '<?php $keyword=$mainkeyword;'."\n"; } else { $content = '<?php $keyword="'.$keyword."\";\n"; } $content .= "\t".'$pagetype="contentpage";'."\n"; if($article != '# random article #') { $content .= "\t".'$static_article="'.$article."\";\n"; } $content .= "\t".'include("includes/pages.php"); ?>'."\n"; if(fwrite($handle, $content) === FALSE) { echo "WARNING: Cannot write to file ($filename)"; PHP: I need the articles to match the title links.