Log in

View Full Version : Resolved Help coverting to PHP



tgallagher26
03-12-2009, 08:52 PM
Ok so I am trying to make a

$mainpage="TEXT BELOW";


<div align="center">
<center><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"<?php echo ($_GET['a'] == 'txt' || !isset($_GET['a'])) ? " checked=\"checked\"" : ""; ?> name="a" value="txt" /> |
Images: <input type="radio"<?php echo ($_GET['a'] == 'img') ? " checked=\"checked\"" : ""; ?> name="a" value="img" /> |
Video: <input type="radio"<?php echo ($_GET['a'] == 'avi') ? " checked=\"checked\"" : ""; ?> name="a" value="avi" /> |
News: <input type="radio"<?php echo ($_GET['a'] == 'news') ? " checked=\"checked\"" : ""; ?> name="a" value="news" /> |
Music: <input type="radio"<?php echo ($_GET['a'] == 'mp3') ? " checked=\"checked\"" : ""; ?> name="a" value="mp3" /><br />
</p>
<input type="text" name="q" size="55" value="<?php echo ucwords($q .''); ?>" /><br />
<input type="submit" value="KyWordPRO Search" /><br /><br /><br />

But need help converting it since it has several PHP portions.

Can anyone help?

Tim..

Master_script_maker
03-12-2009, 09:10 PM
$mainpage='<div align="center">
<center><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"'.($_GET['a'] == 'txt' || !isset($_GET['a'])) ? " checked=\"checked\"" : "" .' name="a" value="txt" /> |
Images: <input type="radio"'. ($_GET['a'] == 'img') ? " checked=\"checked\"" : "" .' name="a" value="img" /> |
Video: <input type="radio"'. ($_GET['a'] == 'avi') ? " checked=\"checked\"" : "" .' name="a" value="avi" /> |
News: <input type="radio"'. ($_GET['a'] == 'news') ? " checked=\"checked\"" : "" .' name="a" value="news" /> |
Music: <input type="radio"'. ($_GET['a'] == 'mp3') ? " checked=\"checked\"" : "" .' name="a" value="mp3" /><br />
</p>
<input type="text" name="q" size="55" value="'. ucwords($q .'') .'" /><br />
<input type="submit" value="KyWordPRO Search" /><br /><br /><br />
<input type=\'hidden\' name="num" value="10"></form></div>';

tgallagher26
03-12-2009, 09:15 PM
I applied the code and

Parse error: syntax error, unexpected '.' in /home/content/t/g/a/tgallagher26/html/index.php on line 35

Tim..

Master_script_maker
03-12-2009, 09:17 PM
fixed

tgallagher26
03-12-2009, 09:21 PM
Parse error: syntax error, unexpected T_ECHO in /home/content/t/g/a/tgallagher26/html/index.php on line 41

Master_script_maker
03-12-2009, 09:24 PM
didn't notice that. fixed

tgallagher26
03-12-2009, 09:28 PM
Parse error: syntax error, unexpected ';' in /home/content/t/g/a/tgallagher26/html/index.php on line 41

Plus I left the last line out.

<input type='hidden' name="num" value="10"></form></div>

Master_script_maker
03-12-2009, 09:29 PM
ops, took out the wrong character. fixed now

tgallagher26
03-12-2009, 09:32 PM
it dint work

Look at http://kywordpro.com/index.php

Tell me when you look at it

Master_script_maker
03-12-2009, 09:36 PM
ok try:
$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\"" : "";

$mainpage='<div align="center">
<center><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" /><br /><br /><br />
<input type=\'hidden\' name="num" value="10"></form></div>';

tgallagher26
03-12-2009, 09:40 PM
Thanks for you help.

If you would please look at

http://www.dynamicdrive.com/forums/showthread.php?t=42706

to see if you can help with this one too.

Master_script_maker
03-12-2009, 09:44 PM
sure. glad i could help