Jump to content

ethoemmes

Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ethoemmes's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I have a script which pulls information from a mySQL database. The field contains descriptions of books. The output is formatted within a <p class="description"> tag. The data in the database has coding within the field which determines quote's so for example: databasefield = "This is normal text which I would like to format as above. [quote]The database stores quotes in these square brackets[/quote] Normal text again etc etc" What I would like to do is apply a different style to the text within the square brackets. Whats the best way of achieving this? Thanks Edgar
  2. Hi, I have used the following script for about a year now but yesterday I started receiving a lot of emails in my email box (looks like someone has hacked this script to send spam) Can anyone spot any improvements I could make to it? It is called from the following page http://rrbltd.co.uk/contact.htm Thanks E [code]   <?php   session_start();   header("Cache-control: private");     $Title = $_POST['Title'];   $FirstName = $_POST['FirstName'];   $LastName = $_POST['LastName'];   $Email = $_POST['Email'];   $Comments = $_POST['Comments'];   $AddToML = $_POST['AddToML'];     $_SESSION['Title'] = $Title;   $_SESSION['FirstName'] = $FirstName;   $_SESSION['LastName'] = $LastName;   $_SESSION['Email'] = $Email;     $strMailTo = 'Info@rrbltd.com';   $strSubject = 'Enquiry from Website';   $strBody = "$Comments \n   Received from \n   $Title $FirstName $LastName \n   $Email";     if (empty($FirstName) || empty($LastName) || empty($Email)) {       header( "Location: form_error.php" );     }   else {     $From = "From: \"$FirstName $LastName\" <$Email>\nX-Mailer: PHP/" . phpversion();     mail ($strMailTo, $strSubject, $strBody, $From);     if (isset($_POST['AddToML'])) {     header( "Location: http://www.rrbltd.com/registration_form.htm" );   }   else {   header( "Location: http://www.rrbltd.com/contact_thanks.htm");   }   }   ?> [/code]
  3. Thanks for the quick reply. Worked perfectly! E
  4. Hi, I am trying to write a function (my first one) to help select the current page within my menu include. Basically the function is called from each menu <li>. If the <li> is the current page the function should ouput id="active". Can anyone spot what I am doing wrong? Thanks [code] <?php $currentpage = ltrim(($_SERVER['PHP_SELF']), "/dev/"); function CurrentPageSelector($page) { if ($page == $currentpage) { return "id='active'"; } } ?>   <div id="navcontainer">       <ul id="navlist">         <li <?php echo CurrentPageSelector("index.php");?>>           <a href="index.php" id=>Introduction</a>         </li>         <li <?php echo CurrentPageSelector(catalogue.php);?>>           <a href="catalogue.php">Catalogue 2</a>         </li>         <li <?php echo CurrentPageSelector("back_catalogue.php");?>>           <a href="back_catalogue.php">Back Catalogues</a>         </li>         <li <?php echo CurrentPageSelector("mailinglist.php");?>>           <a href="mailinglist.php">Mailing List</a>         </li>         <li <?php echo CurrentPageSelector("contact.php");?>>           <a href="contact.php">Contact Form</a>         </li> <li> <?php echo "page: " . $page . "current: " .$currentpage ?> </li>       </ul>     </div> <br />       <ul id="leftbar"> <h2 id="leftbartitle">Resource Area</h2>         <li>         <a href="#">Portrait Gallery</a>         </li>         <li>           <a href="#">Title Pages</a>         </li>         <li>           <a href="#">Bibliography</a>         </li> </ul> </div> [/code]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.