How do I add a banner to a PHP based file? I try to enter plain HTML and it keeps giving my an error on one line or another and I can't figure it out. So now how would I add a banner using PHP so everything works properly? By the way I am using PHP-Fusion.
could you post some code, i.e where you want to add the image ? Its very simply...need to see some code really.
I don't know what PHP Fusion is but when adding raw HTML to a PHP page, you have to make sure it's not inside any of the <?php ?> tags. If it is, simply put one of the following instead: ?><img src="your banner" /><? //OR echo '<img src="your banner" />'; //OR print '<img src="your banner" />'; PHP: The first one will close the PHP tags and put out the HTML and then reopen them while the other two will simply use the PHP commands echo or print to output the HTML.
Here is the code I am trying to work on... $res = 0; if (dbrows($result) != 0) { $data = dbarray($result); if (checkgroup($data['article_cat_access'])) { $res = 1; if ($rowstart == 0) $result = dbquery("UPDATE ".$db_prefix."articles SET article_reads=article_reads+1 WHERE article_id='$article_id'"); $article = stripslashes($data['article_article']); $article = explode("<--PAGEBREAK-->", $article); $pagecount = count($article); $article_subject = stripslashes($data['article_subject']); $article_info = array( "article_id" => $data['article_id'], "user_id" => $data['user_id'], "user_name" => $data['user_name'], "article_date" => $data['article_datestamp'], "article_breaks" => $data['article_breaks'], "article_comments" => dbcount("(comment_id)", "comments", "comment_type='A' AND comment_item_id='".$data['article_id']."'"), "article_reads" => $data['article_reads'], "article_allow_comments" => $data['article_allow_comments'] ); render_article($article_subject, $article[$rowstart], $article_info); if (count($article) > 1) { $rows = $pagecount; echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,1,$rows,3,FUSION_SELF."?article_id=$article_id&")."\n</div>\n"; } if ($data['article_allow_ratings']) showratings("A",$article_id,FUSION_SELF."?article_id=$article_id"); } } if ($res == 0) redirect("articles.php"); Code (markup): I want the banner above the rating code but below the main article if you get what I am saying. Here is the link to a sample of what i am talking about: http://www.tvshowrush.com/readarticle.php?article_id=1 So above the blue bar but below the posted by part. How could I add this?
hmm ok could you not just insert- echo "<img src="IMAGE PATH.JPG" />"; Before if ($res == 0) redirect("articles.php"); Im 100% sure how the code lays out the page but try moving it around.
hmm ok could you not just insert- echo "<img src="IMAGE PATH.JPG" />"; Before if ($res == 0) redirect("articles.php"); Im 100% sure how the code lays out the page but try moving it around. edit - be sure not to mess up your if statements