Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Help coverting to PHP

  1. #1
    Join Date
    Feb 2009
    Posts
    62
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default Help coverting to PHP

    Ok so I am trying to make a

    $mainpage="TEXT BELOW";

    HTML Code:
    <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..
    Last edited by tgallagher26; 03-13-2009 at 12:19 PM.

  2. #2
    Join Date
    Jun 2007
    Posts
    543
    Thanks
    3
    Thanked 78 Times in 78 Posts
    Blog Entries
    1

    Default

    PHP Code:
    $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>'

    Last edited by Master_script_maker; 03-12-2009 at 09:30 PM.
    [Jasme Library (Javascript Motion Effects)] My Site
    /\/\@§†ê® §©®¡þ† /\/\@|{ê®
    There are 10 kinds of people in the world, those that understand binary and those that don't.

  3. The Following User Says Thank You to Master_script_maker For This Useful Post:

    tgallagher26 (03-12-2009)

  4. #3
    Join Date
    Feb 2009
    Posts
    62
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    I applied the code and

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

    Tim..

  5. #4
    Join Date
    Jun 2007
    Posts
    543
    Thanks
    3
    Thanked 78 Times in 78 Posts
    Blog Entries
    1

    Default

    fixed
    [Jasme Library (Javascript Motion Effects)] My Site
    /\/\@§†ê® §©®¡þ† /\/\@|{ê®
    There are 10 kinds of people in the world, those that understand binary and those that don't.

  6. The Following User Says Thank You to Master_script_maker For This Useful Post:

    tgallagher26 (03-12-2009)

  7. #5
    Join Date
    Feb 2009
    Posts
    62
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

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

  8. #6
    Join Date
    Jun 2007
    Posts
    543
    Thanks
    3
    Thanked 78 Times in 78 Posts
    Blog Entries
    1

    Default

    didn't notice that. fixed
    [Jasme Library (Javascript Motion Effects)] My Site
    /\/\@§†ê® §©®¡þ† /\/\@|{ê®
    There are 10 kinds of people in the world, those that understand binary and those that don't.

  9. The Following User Says Thank You to Master_script_maker For This Useful Post:

    tgallagher26 (03-12-2009)

  10. #7
    Join Date
    Feb 2009
    Posts
    62
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    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>

  11. #8
    Join Date
    Jun 2007
    Posts
    543
    Thanks
    3
    Thanked 78 Times in 78 Posts
    Blog Entries
    1

    Default

    ops, took out the wrong character. fixed now
    [Jasme Library (Javascript Motion Effects)] My Site
    /\/\@§†ê® §©®¡þ† /\/\@|{ê®
    There are 10 kinds of people in the world, those that understand binary and those that don't.

  12. The Following User Says Thank You to Master_script_maker For This Useful Post:

    tgallagher26 (03-12-2009)

  13. #9
    Join Date
    Feb 2009
    Posts
    62
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    it dint work

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

    Tell me when you look at it

  14. #10
    Join Date
    Jun 2007
    Posts
    543
    Thanks
    3
    Thanked 78 Times in 78 Posts
    Blog Entries
    1

    Default

    ok try:
    Code:
    $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>';
    [Jasme Library (Javascript Motion Effects)] My Site
    /\/\@§†ê® §©®¡þ† /\/\@|{ê®
    There are 10 kinds of people in the world, those that understand binary and those that don't.

  15. The Following User Says Thank You to Master_script_maker For This Useful Post:

    tgallagher26 (03-12-2009)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •