Search Box - No Downloads

have a search box on my downloads site, where you’re meant to type in the name of an application and if I have it on my downloads site, it will come up under the search box.

However, my issue is that when I search anything, it doesn’t come up with any results - clarification on what I’ve done wrong would be appreciated.




<?php // gets elements by tagnames $app = $_POST['app']; $space = "
";

// following code will echo search results

echo ‘Form Results
’;
echo 'Application Searched: '.$_POST[‘app’].$space;

// finish PHP
?>

Showing what you actually did to search would be helpful. Now, all you do is print what they were looking for in the search field.

Are you storing application traits in a database? What applications are you holding for download? Where/ How are they being stored?

The search box is on http://appstash.x10.mx/Security.php

I’m having another problem, where when I add the code in bold, the site is blank when you visit it.

Select a category to see it's top applications!

Security Browsers Messaging Tune-Ups
<?php $category = $_POST['application']; // now arrays! $security = '
  • Security App 3
  • ';

    $messaging = '<a href=“Downloads/Security/RKill.exe” onClick="(‘You are being navigated to the contact us page!’)"rel=“nofollow”>RKill

  • Messaging App 2
  • Messaging App 3
  • ';

    $tuneups = ’

  • Tune-Ups App 2
  • Tune-Ups App 3
  • ';

    $browsers = '

  • Browser App 1
  • Browser App 2
  • Browser App 3
  • '; ?>

    Your results for: <?php echo $category; ?>

    <?php // begin form search script

    if ($category == “Security”) {
    echo $security;
    } elseif ($category == “Browsers”) {
    echo $browsers;
    } elseif ($category == “Messaging”) {
    echo $messaging;
    } elseif ($category == “Tune-Ups”) {
    echo $tuneups;
    } else {
    // do nothing (comment)
    }
    ?>

    Add,

    [php]error_reporting(E_ALL);
    ini_set(‘display_errors’, 1);[/php]

    to the top of the page.

    I’ve added that, but I still get the white screen… appstash.x10.mx

    You are still generating an error.
    [php]
    $messaging = '<a href=“Downloads/Security/RKill.exe” onClick="(‘You are being navigated to the contact us page!’)"rel=“nofollow”>RKill

  • Messaging App 2
  • Messaging App 3
  • ';[/php]

    Look how the boards PHP syntax highlighting handles the problem area.

    And now,

    [php]$messaging = '<a href=“Downloads/Security/RKill.exe” onClick="(‘You are being navigated to the contact us page!’)"rel=“nofollow”>RKill

  • Messaging App 2
  • Messaging App 3
  • ';[/php]

    Although I don’t know why you are calling a function named “(‘You are being navigated to the contact us page!’)” That is what onClick does.

    The problem with that, is that the on click alert doesnt work.

    Probably because that isn’t what you have. you have a string inside of a function call.

    So how do I make the onclick alert work?

    Personally, I use functions for almost everything. At it’s most basic level you will want to give a function name in the onClick space.

    Look into Prompt, out of preference, but

    alert("You are being navigated to the contact us page!");

    I got this code, but the on-click alert still doesn’t work.

    <a href=“Downloads/Security/RKill.exe” alert(“You are being navigated to the contact us page!”);"rel=“nofollow”>RKill

    [php] $messaging = ‘RKill’;
    [/php]

    This works for me.

    After applying that code, I’m getting the blank screen again.

    <>

    It’s still giving me a blank screen…

    $messaging = ‘RKill

    Is that the entire $messaging variable? Or did you add in the other code that I snipped off?

    I added the code you gave me in reply #11

    Actually let’s forget about the issue with the on-click alert.

    Can we move back to the search results for the search box?

    The code you posted in Post #14 is not a complete statement.

    Can we move back to the search results for the search box?

    An example of what I’m looking for, is the search box on filehippo.com

    Sponsor our Newsletter | Privacy Policy | Terms of Service