Jump to content

webmaster1

Members
  • Posts

    607
  • Joined

  • Last visited

    Never

Posts posted by webmaster1

  1. I have an advert banner in the header of my web page. When the end-user rolls over it I want it to expand/drop-down to display further information about the advert. This is commonplace in rich-media adverts but I can't find any tutorials or resources to get me started.

     

    Here's an example of the effect: http://www.e-planning.net/products/admagic/formats/rollover_expandable_video_banner.html

     

    Here's an image of what I'm trying to achieve.

    advertry.png

     

    What's the best way to acheive this? Jquery? Flash? Ajax?

     

    Any links would be greatly appreciated.

  2. I came across a 'mystery' in an online discussion relating to two files found on fourchan whereby one requires the password and the other file is alleged to contain a 'clue'.

     

    Sure, it's not PHP but the problem solving process is essentially the same. If anyone thinks they can 'crack' the 'mystery' then let me know.

     

    Here's a screenshot of what can be seen using a spectrum analysis after changing the *.mp3 file to a *.jpg:

     

    26443vb.jpg

     

    It reads "pain is all that humans have in common".

     

    Source: http://www.abovetopsecret.com/forum/thread603464/pg1

  3. Thanks for checking back. It works fine:

     

    <?php
    //$contactemail="valid@email.com"
    $contactemail="invalidemail";
    $valid = (bool)filter_var($contactemail, FILTER_VALIDATE_EMAIL); // returns true or false
    
    // Notes:
    // http://www.phpfreaks.com/forums/index.php/topic,305419.0.html
    // http://www.w3schools.com/php/filter_validate_email.asp
    ?>
    <hr>
    <?php
    if ($valid == FALSE){
    echo "The following email is invalid: ".$contactemail;
    }
    else{
    echo "The following email is valid: ".$contactemail;
    }
    ?>
    <hr>

  4. Firstly, do you need to build this from scratch or would something like osCommerce: http://www.oscommerce.com/ suit you?

     

    In any case, you need to create a separate table for orders presuming you already have a table for the photos that can be ordered.

     

    The orders will have it's own auto-increment primary key just like the photos table. You'll be able to tie photos with orders by creating a second column in the orders table (orders.photoid). Each time an order is made the photo.id should be inserted into orders.photoid.

     

    This way, you can reference the entries of the two tables with :

    select * from orders, photo

    where orders.photoid = photo.id

  5.  

     

    Brilliant, thanks! The working code:

     

    <?php
    //$contactemail="valid@email.com"
    $contactemail="invalidemail";
    $valid = filter_var($contactemail, FILTER_VALIDATE_EMAIL); // returns true or false
    
    // Notes:
    // http://www.phpfreaks.com/forums/index.php/topic,305419.0.html
    // http://www.w3schools.com/php/filter_validate_email.asp
    ?>
    <hr>
    <?php
         if ($valid == FALSE){
                    echo "The following email is invalid: ".$contactemail;
                }
         else{echo "The following email is valid: ".$contactemail;}
    ?>
    <hr>

  6. erregi is deprecated. I'm having the same problem with preg_match.

     

    If anyone could copy and paste the below code and point out the error I'd  grateful.

     

    <?php
    $contactemail="invalidemail";
        if (preg_match('/^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]/', $contactemail)) 
        {
    echo"Validation FALSE!";
            $contactemail_validated = FALSE; //email is not valid
        }
        else{
    echo"Validation TRUE!";
            $contactemail_validated = TRUE; //email is valid
         }
    ?>
    <hr>
    <?php
         if ($contactemail_validated == FALSE){
                    echo "You did not input a valid email address!";
                }
         else{echo $contactemail;}
    ?>
    <hr>

  7. Whether I use a valid email address or not, I never end up with a FALSE result:

     

    <?php
    $contactemail="bla";
        if (eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $contactemail)) 
        {
            $contactemail_validated = FALSE; //This is my own addition.
        }
        else{
            $contactemail_validated = TRUE; //email is valid
         }
    ?>
    <ul>
    <?php
         if ($contactemail_validated == FALSE){
                    echo "<li class='fail'><label for='contactsubjecterror'> </label>↓ You did not input a valid email address.</li>";
                }
    else{echo $contactemail;}
    ?>
    </ul>

     

  8. Here's a tested solution:

     

    a.php:

     

    <?php
    session_start();
    
    if (isset($_POST['submit']))
    {
    $_SESSION['uname'] = $_POST["uname"];
    $url = $_POST["gourl"];
    header("Location: $url");
    }
    
    ?>
    <html>
    <head>
    </head>
    <body>
    
    <form action='<?php echo $_SERVER['PHP_SELF']; ?>' method='post'>
    <p><input type='text' name='uname'><br>
    <select name='gourl'>
    <option value=''>Choose a Destination...</option>
    <option value='b.php'>Page B</option>
    </select>
    <input type='submit' value='Go' name='submit'>
    </form>
    
    </body></html>

     

    b.php:

    <?php
    session_start();
    ?>
    
    <html><body>
    <?php
    $testinghere = $_SESSION['uname'];
    echo "Hello, $testinghere \n";
    ?>
    </body></html>

     

    You'll need to input a value into the uname field to see the session echo on the next page.

  9. The objective

    If the email field of my form doesn't validate I want to set a variable to be true that then prompts and if/else statement to echo the error message.

     

    The problem

    All tutorials use a function to achieve this. I don't want to.

     

    The code

     

    This is the code I'm trying to implement:

    <?php
    $contactemail="notanemailatnotadomaindotcom";
    if (eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $contactemail)) 
    {
       return FALSE;
      $contactemail = FALSE; //This is my own addition.
    }
    ?>
    <ul>
    <?php
    if (!$contactemail){
                    echo "<li class='fail'><label for='contactsubjecterror'> </label>↓ You did not input a valid email address.</li>";
                }
    ?>
    </ul>
    

     

    The question

    Without having to use a function how do I validate my email field by outputing a TRUE/FALSE variable and without having to use a function?

     

     

     

     

     

     

  10. I'm no expert myself but that seems like an unnecessarily complicated approach. Here's what I suggest instead:

     

    1) Whatever the conditions are for the form appearing, create a variable and define it as TRUE. Here's the code. I've tested it for you.

     

    <?php
    // Add this to the end of whatever if/else statement you're using to prompt the form to appear. e.g. if isset
    // If the the form is submitted...
    if (isset($_POST['somebutton']))
    {
    // Create the triggerform variable and define it as TRUE.
    $triggerform = TRUE;
    }
    //
    ?>
    <html>
    <body>
    Some content here..<br>
    Some content here..<br>
    Some content here...<br>
    <form name="someform" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <input type="submit" name="somebutton" value="Trigger the form"><br>
    </form>
    <?php 
    // If the triggerform variable is TRUE...
    if ($triggerform)
    {
    echo "
    <br>
    <br>
    <strong>Paste your form and php code here!</strong> 
    <br>
    <br>
    ";
    }
    ?>
    Some content here..<br>
    Some content here..<br>
    Some content here..
    </body>
    </html>
    

     

    2) Remember that you can only use single quotes within the double quotes of this echo. e.g. style='color: #F00' but not style="color: #F00". The double quotes open and close the echo string.

     

    3) The above example requires the posting of a button which may reset/erase whatever other forms you may be simultaneously using. This is beginning to sound a lot more like something you should be doing with JavaScript:

     

    http://www.cssnewbie.com/showhide-content-css-javascript/

  11. For Wordpress, wp-config.php sits in web root and contains sensitive information relating to databases etc.

     

    I've used .htaccess to forbid access. I've also read that I need to move the file above/below the web root.

     

    Moving it to a subdirectory doesn't really seem secure. I've tried including the details from a directory outside  of (above, I think) public_html but Wordpress breaks and simply displays the included code as plain text (with all the sensitive details in plain sight mind you).

     

    Any tips?

×
×
  • 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.