Ok so here is my code
I want to use the ucwords function on $q but I cant get it to work.PHP Code:$myAd = "Do you own a site about \"$q\"? ";
Can anyone help me please.
Ok so here is my code
I want to use the ucwords function on $q but I cant get it to work.PHP Code:$myAd = "Do you own a site about \"$q\"? ";
Can anyone help me please.
Last edited by tgallagher26; 03-17-2009 at 01:45 PM.
PHP Code:$myAd = 'Do you own a site about "' . ucwords($q) . '"? ';
Yea I ha already tied that.
look at the ad space below banner ad and you can see the results.
http://kywordpro.com/txt/1/10/kansas%20city%20zoo.html
You have to put PHP tags around that.
Code:<?phpCode:?>
I know I already have it PHP like this.
PHP Code:<?php
if(!file_exists('config.php')) header('Location: install.php');
include 'config.php';
include 'inc/database.php';
include 'inc/functions.php';
clearCache($options[$clear]);
remUserAd();
if(isset($_GET['q']) && strlen(trim($_GET['q'])) > 1) {
$q = urlencode($_GET['q']);
$flag = true;
if(!isBlackListed($q)) {
$blackListed = false;
$array = array('txt', 'img', 'avi', 'news', 'mp3');
$a = strtolower($_GET['a']);
if(!in_array($a, $array)) $a = 'txt';
include 'inc/search.php';
}
else {
$blackListed = true;
}
$q = urldecode($q);
}
$myAd = "<font face=\"verdana\" size=\"2\"><table bgcolor=\"ffff88\" width=\"100%\"><tr>
<td valign=\"top\">
<a href=\"http://kywordpro.com/sponsor/index.php\"><b>Advertise Your Website with KyWordPRO!</a></b><br />
Do you own a site about \"' . ucwords($q) . '\"? Then put your text ad right here in front of 1000's of potential customers with our Targeted Keyword Ads for only $20.00 a year.<br /><span style=\"color: green;\">http://kywordpro.com/sponsor/index.php</span></td></tr></table> </font>";
$txt=($_GET['a'] == 'txt' || !isset($_GET['a'])) ? " checked=\"checked\"" : "";
$img=($_GET['a'] == 'img') ? " checked=\"checked\"" : "";
$avi=($_GET['a'] == 'avi') ? " checked=\"checked\"" : "";
$news=($_GET['a'] == 'news') ? " checked=\"checked\"" : "";
$mp3=($_GET['a'] == 'mp3') ? " checked=\"checked\"" : "";
$footer=file_get_contents('http://kywordpro.com/footer.php');
$mainpage='<div id="header"><br /><br /><br /><br /><div id="main" style="width: 600px; margin: 100px auto;" valign="center" align="center">
<center><br /><a href="http://kywordpro.com/index.php"><img src="http://kywordpro.com/img/logo.gif" border="0" alt="" style="margin-bottom: 20px;" /></a><br />
<form action="http://kywordpro.com/redirect.php" method="get" class="style1">
<p style="margin-top: 10px;">
Web: <input type="radio"'. $txt .' name="a" value="txt" /> |
Images: <input type="radio"'. $img .' name="a" value="img" /> |
Video: <input type="radio"'. $avi .' name="a" value="avi" /> |
News: <input type="radio"'. $news .' name="a" value="news" /> |
Music: <input type="radio"'. $mp3 .' name="a" value="mp3" /><br />
</p>
<input type="text" name="q" size="55" value="'. ucwords($q .'') .'" /><br />
<input type="submit" value="KyWordPRO Search" />
<input type=\'hidden\' name="num" value="10"></form>
'. $footer .'<br /></center></div><br /><br /><table align=center><tr><td id="main">
<font face="verdana" size=1">Background Sponsered by
<a href="http://links.verotel.com/cgi-bin/showsite.verotel?vercode=19175:9804000000002269">3d-passion.com</a></font></td></tr></table></div>';
?>
$myAd = "<font face=\"verdana\" size=\"2\"><table bgcolor=\"ffff88\" width=\"100%\"><tr>
<td valign=\"top\">
<a href=\"http://kywordpro.com/sponsor/index.php\"><b>Advertise Your Website with KyWordPRO!</a></b><br />
Do you own a site about \"' . ucwords($q) . '\"? Then put your text ad right here in front of 1000's of potential customers with our Targeted Keyword Ads for only $20.00 a year.<br /><span style=\"color: green;\">http://kywordpro.com/sponsor/index.php</span></td></tr></table> </font>";then add this to your stylesheetCode:$myAd = '<div class="advertisement"><p><a href="http://kywordpro.com/sponsor/index.php">Advertise Your Website with KyWordPRO!</a></p><p>Do you own a site about '. ucwords($q) .'?. Then put your text ad right here in front of 1000's of potential customers with our Targeted Keyword Ads for only $20.00 a year.</p></div>';
Code:div.advertisement { font-family: Verdana sans-serif; width:100%; background-color: #ffff88; }
I would also suggest that you validate your page, since I can see a number of really poor HTML.
See www.w3c.org and www.howtocreate.co.uk for more information
Make the above look like Tim's example.PHP Code:<input type="text" name="q" size="55" value="'. ucwords($q .'') .'" /><br />
Boogyman this is the result
Parse error: syntax error, unexpected T_STRING in /home/content/t/g/a/tgallagher26/html/index.php on line 27
Last edited by tgallagher26; 03-16-2009 at 07:00 PM.
The problem is that you are not escaping from the php correctly. It should be sort of like this:
PHP Code:<?php
echo "<input type=\"text\" name=\"q\" size=\"55\" value=\"".ucwords($q)."\" />";
?>
It should be like this:
You should not be putting HTML inside PHP tags. Or as strings in variables. There are exceptions, but I don't see any in your code.PHP Code:<input type="text" name="q" size="55" value="<?php echo ucwords($q); ?>" />
This for example
is not good.PHP Code:$myAd = "<font face=\"verdana\" size=\"2\"><table bgcolor=\"ffff88\" width=\"100%\"><tr>
<td valign=\"top\">
<a href=\"http://kywordpro.com/sponsor/index.php\"><b>Advertise Your Website with KyWordPRO!</a></b><br />
Do you own a site about \"' . ucwords($q) . '\"? Then put your text ad right here in front of 1000's of potential customers with our Targeted Keyword Ads for only $20.00 a year.<br /><span style=\"color: green;\">http://kywordpro.com/sponsor/index.php</span></td></tr></table> </font>";
Bookmarks