Welcome to TalkGraphics.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2010
    Location
    Qld Australia
    Posts
    108

    Default Place holder problem

    Hi All. i AM USING xwd6 and made a placeholder for a search window. After inserting the code, the code became visible to the visitors. What's wrong here? Any ideas?

  2. #2
    Join Date
    Aug 2009
    Location
    Orlando, Florida
    Posts
    64

    Default Re: Place holder problem

    Señor, are you sure you have the full code inserted, with < and /> terminations, etc? Does it work OK if you use it away from XWD6, like in Front Page?

    I guess we'd need some more details, maybe sample code to play with...

  3. #3
    Join Date
    Jan 2010
    Location
    Qld Australia
    Posts
    108

    Default Re: Place holder problem

    <div id="radio_search">
    <h3>Find Adventist Radio Near You</h3>
    <?php
    if (isset($_POST['search'])) {
    $postcode = isset($_POST['postcode']) ? (int)$_POST['postcode'] : "";
    if ($postcode != "") {
    // Select city, state, postcode, and station where postcode = postcode entered.

    /* @$conn = new mysqli('h50mysql109.secureserver.net', 'xxxxxxx', 'xxxxxxxx', 'xxxxxxxxx');
    if (mysqli_connect_errno()) {
    echo 'Error: Could not connect to database. Please try again later.';
    exit;
    }
    $query = "SELECT city, state, postcode, station FROM stations
    WHERE postcode={$postcode}";
    $result = $conn->query($query);
    $num_results = $result->num_rows;
    if ($num_results != 0) {
    // If found display
    for ($i=0; $i < $num_results; $i++) {
    $row = $result->fetch_assoc();
    echo "<p>Start listening to Adventist radio in <strong>" . htmlspecialchars(stripslashes($row['city']))
    . ", " . htmlspecialchars(stripslashes($row['state'])) . "</strong> on <strong>" .
    htmlspecialchars(stripslashes($row['station'])) . " FM</strong> right now!</p>";
    }
    } else {
    echo "<p>Sorry there is no adventist radio in you area. Want to change
    that? <a href=\"contact.html\">Contact us</a> to find out how.</p>";
    } */






    $connection = mysql_connect('h50mysql109.secureserver.net', 'xxxxxxxxx', 'xxxxxxxxxxx');
    if (!$connection) {
    die('Could not connect: ' . mysql_error());
    }
    mysql_select_db('adventistradio', $connection);

    # Check If Record Exists

    $query = "SELECT city, state, postcode, station FROM stations
    WHERE postcode={$postcode}";

    $result = mysql_query($query);
    if (mysql_num_rows($result) <= 0) {
    echo "<p>Sorry there is no adventist radio in you area. Want to change
    that? <a href=\"contact.html\">Contact us</a> to find out how.</p>";
    } else {
    while($row = mysql_fetch_array($result)) {
    echo "<p>Start listening to Adventist radio in <strong>" . htmlspecialchars(stripslashes($row['city']))
    . ", " . htmlspecialchars(stripslashes($row['state'])) . "</strong> on <strong>" .
    htmlspecialchars(stripslashes($row['station'])) . " FM</strong> right now!</p>";
    }
    }







    } else {
    echo "<p>You must enter a valid 4 digit postcode.</p>";
    }
    }
    ?>
    <form action="index.php#radio_search" method="post">
    <div>
    <label for="postcode">Enter Postcode: </label>
    <input type="text" name="postcode" id="postcode" value="" />
    <input type="submit" name="search" value="Search" />
    </div>
    </form>
    </div>

  4. #4
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,044

    Default Re: Place holder problem

    The code looks good. Is PHP running on the server ?

  5. #5
    Join Date
    Aug 2007
    Location
    Maghull UK
    Posts
    6,202

    Default Re: Place holder problem

    I think the page in which the code is inserted needs to have a .php extension.
    JOHN -XaReg (FB) XaReg (DB - ignore prompt to register)
    Windows 10 [Anniversary] pro Intel Pentium CPU G630 @ 2.70Ghz RAM: 4 GB; 64-bit x64

  6. #6
    Join Date
    Jan 2010
    Location
    Qld Australia
    Posts
    108

    Default Re: Place holder problem

    yes, PHP is running on the remote server
    Quote Originally Posted by Drwyd View Post
    The code looks good. Is PHP running on the server ?

  7. #7
    Join Date
    Jan 2010
    Location
    Qld Australia
    Posts
    108

    Default Re: Place holder problem

    Thanks John. I'll try this even though I cannot imagine it to be the problem. I had this issue with FrontPage
    Quote Originally Posted by neodeist View Post
    I think the page in which the code is inserted needs to have a .php extension.

  8. #8
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,044

    Default Re: Place holder problem

    By default only files that have a PHP extension will be parsed for PHP code but the server can be set up to parse other extensions such as HTM HTML SHTML etc.

 

 

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
  •