Jump to content

webmaster1

Members
  • Posts

    607
  • Joined

  • Last visited

    Never

Everything posted by webmaster1

  1. Search Google using the following keywords for a few solutions: This looks good: http://www.phpmotion.com/ Otherwise tweak a shopping cart to embed videos.
  2. Sorted! The xdebug website actually finds the dll when you paste in your phpinfo(): http://www.xdebug.org/find-binary.php
  3. I have a general idea of what it does but is it an optional install or is it required? Can anyone explain to me what this instruction means: I 'm not sure what to pick from the download page: http://www.xdebug.org/download.php Should I simply download the most recent source link?
  4. Thanks Crayon; jquery it is then. I wasn't expecting any code so double thanks for the skeleton you've provided. Now I know what functions I need to familiarize myself with.
  5. 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. What's the best way to acheive this? Jquery? Flash? Ajax? Any links would be greatly appreciated.
  6. *edit for above: *.jpg changed to *.mp3 (I said the reverse). Some folk reckon that it's a slick viral marketing campaign for Skyline or Super 8 a la 2012 or District 9. Remember this?: http://www.instituteforhumancontinuity.org/ Or these?:
  7. 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: It reads "pain is all that humans have in common". Source: http://www.abovetopsecret.com/forum/thread603464/pg1
  8. Yes. Stripslashes will do the trick. <?php // Remove backslashes... stripslashes($somevariable); // Notes: http://php.net/manual/en/function.stripslashes.php ?>
  9. 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>
  10. 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
  11. 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>
  12. 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>
  13. It's a forbidden page. I might be asking the obvious here but why not save the files to your computer and upload them using FTP/cPanel and then link to them in your document. Am I missing something in terms of what you're trying to achieve?
  14. 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>
  15. Did that work for you? I just get a blank page after copying and pasting your code.
  16. As the lads have said, remember that session_start(); needs to be used to continue sessions as much as creating them.
  17. 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.
  18. 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?
  19. 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/
  20. Thanks for the explanation Premiso. I was trying to edit the memory_limit. For cPanel, it can be modified without directly editing the file: Main >> Service Configuration >> PHP Configuration Editor
  21. I have a VPS and my host suggested using SSH to access php.ini. Do I need to learn how to use shell access or can I use a file manager or FTP to access the file (I'm using cPanel)?
  22. 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?
  23. I'm asking 'where' and not 'what for'. i.e. Will affixing the TM symbol to the slogan cover the logo, title and slogan?
×
×
  • 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.