>>  Site Map >>  Forums >>  General 7x

Forum module - topics in forum:



General 7x - Discussions reagarding any other PHP-Nuke Problems. 7x



Google search block

I have been trying to add the google search box with code created via adsense and then the 'create block' tool. When I try to show the block it displays some of the code itself, and messes up the whole page! I have tried adding it as a centre block, or a left block. Is there something simple wrong with the code, please? Is there some problem with the size of the block? (I have hidden my account by the pub- bit!)
Thanks for any help.
I have the ads running okay.
I am running PHP-Nuke 7.5 patched to 3.2b

Code: :
<?php
#### Generated by Block Creator by Disipal Site (www.disipal.net) ###
if (eregi("block-googlesearch.php",$PHP_SELF)) {
    Header("Location: index.php");
    die();
}
$content  =  "<!-- Search Google -->";
$content  .= "center>";
$content  .= "form method=\"get\" action=\"http://www.google.co.uk/custom\" target=\"google_window\">";
$content  .= "table bgcolor=\"#ffffff\">";
$content  .= "tr><td nowrap=\"nowrap\" valign=\"top\" align=\"left\" height=\"32\">";
$content  .= "a href=\"http://www.google.com/\">";
$content  .= "img src=\"http://www.google.com/logos/Logo_25wht.gif\" border=\"0\" alt=\"Google\" align=\"middle\"></img></a>";
$content  .= "br/>";
$content  .= "input type=\"text\" name=\"q\" size=\"15\" maxlength=\"255\" value=\"\"></input>";
$content  .= "/td></tr>";
$content  .= "tr><td valign=\"top\" align=\"left\">";
$content  .= "input type=\"submit\" name=\"sa\" value=\"Search\"></input>";
$content  .= "input type=\"hidden\" name=\"client\" value=\"pub-myadsenseaccount\"></input>";
$content  .= "input type=\"hidden\" name=\"forid\" value=\"1\"></input>";
$content  .= "input type=\"hidden\" name=\"ie\" value=\"ISO-8859-1\"></input>";
$content  .= "input type=\"hidden\" name=\"oe\" value=\"ISO-8859-1\"></input>";
$content  .= "input type=\"hidden\" name=\"safe\" value=\"active\"></input>";
$content  .= "input type=\"hidden\" name=\"cof\" value=\"GALT:#9A2C06;GL:1;DIV:#33FFFF;VLC:D03500;AH:center;BGC:99CCFF;LBGC:CCE5F9;ALC:440066;LC:440066;T:336699;GFNT:223472;GIMP:223472;FORID:1\"></input>";
$content  .= "input type=\"hidden\" name=\"hl\" value=\"en\"></input>";
$content  .= "/td></tr></table>";
$content  .= "/form>";
$content  .= "/center>";
$content  .= "!-- Search Google -->";
?>







The reason why it is messed up is because most of the tags are missing the start "<" character. What you need to do is add a < to each line.

E.G

Code: :
$content  .= "<center>";
$content  .= "<form method=\"get\" action=\"http://www.google.co.uk/custom\" target=\"google_window\">";







Works like a charm, cheers Cypher!

Embarassed




Attention! You are currently viewing sitemap page!
We strongly suggest to look at original content

Search from web

Valid HTML 4.01 Valid CSS