Jump to content

joel24

Members
  • Posts

    760
  • Joined

  • Last visited

Everything posted by joel24

  1. you need to set PHP's timezone; http://php.net/manual/en/function.date-default-timezone-set.php
  2. http://php.net/manual/en/function.imagecolortransparent.php
  3. Not without fetching the schema, looping through the fields and adding it to your query... you could write a function to do this http://stackoverflow.com/questions/3797906/mysql-query-for-searching-through-all-the-fields
  4. You don't need to use $_SERVER superglobal, if you omit the form action, it will post to itself by default. As for your dilemma, you are sending the form via GET and retrieving values via POST and GET; you need to use one or the other - stick with POST. <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body> <?php if(isset($_POST['submit'])) //just check if the form is being posted { $bgcolor = strval($_POST['thecolor']); } else { $bgcolor = "red"; } ?> <body bgcolor="<?= $bgcolor; ?>"> <form name="color" method="post"> Enter a color: <input type="text" name="thecolor" value=""> <input type ="submit" name='submit' value="Change Background Color"> </form> *edit - made it a bit prettier and set the form submit button name
  5. will need to see the code... you've already tried the common debugging print_r($_POST) etc etc?
  6. If you can't / don't want to program, use a CMS which will allow users to log in and add/edit products etc. This site has a list of a few.
  7. You should definitely use PHP to calculate, not Javascript. Using JS will allow malicious users to play with the code and enter obscure order / shipping details. divide and use modulus to find the remainder.... this will give you an idea $amount = 20; $remainder = 20 % 6; $result = ($amount - $remainder) / 6; $extra = ($remainder < 4)?'1 4pack':'1 6pack'; echo "$result x 6packs <br> $extra";
  8. my bad, as soon as I saw timestamp I was thinking unix timestamp... brain fart
  9. have a look at this open source flash document viewer, sure the API will allow you to turn off copy/print. http://flexpaper.devaldi.com/ http://stackoverflow.com/questions/6070268/secure-pdf-viewer-unprintable-undownloadable
  10. AFAIK you'll have to display it using flash, unless you were to encrypt the data, the source would be viewable
  11. SELECT * FROM table WHERE MONTH(FROM_UNIXTIME(timeStampField)) = 4 SELECT MONTH(FROM_UNIXTIME(timeStampField)) FROM table
  12. you'll have to handle the dynamic dom elements - live() , either that or have a global count variable and increment it each time a element is dropped.
  13. are you setting the email mime type headers? re: link in my last post // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n"; $headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n"; $headers .= 'Cc: birthdayarchive@example.com' . "\r\n"; $headers .= 'Bcc: birthdaycheck@example.com' . "\r\n"; // Mail it mail($to, $subject, $message, $headers); if you're still having trouble, have a look at phpMailer()
  14. might be easier to use css and "float:left" - then on every 5th element, add css "clear:both;"
  15. are your assigning the content-type to indicate a html email? read up mail function $message = "<html> <head> <style type='text/css'> .text { font-family: Arial, Helvetica, sans-serif; color: #666; font-size: 12px; font-weight: normal; text-decoration: none; margin-right: 15px; } </style> </head> <body> <span class='text'>Dear ".clean_string($Name).",<br/> Thank you for your message.</span> </body> </html> ";
  16. if the width of the bowlitems is greater than the width of the image, put it on a new line with margin-top... I would store each row of bowlitems in an array, if the row exceeds the image width, then start a new row in the array or if you just don't want to show those images which exceed, use an if condition to check
  17. maybe a viral gauge with viral percentage ranking... how you determine this figure is up to you. as for layout, I think the video container '.postbox' needs more padding. I would have a lighter grey for the background, put the top right ad center middle just below search bar and line up the ads in the right hand column.
  18. why not use PHP to add it after form submission? and have the input bg set to an image of the text 'http://' ? or use jquery's change() function
  19. if the redirects are not constantly changing, use apache's HTACCESS rewrite rule otherwise you can use PHP to do a header('location: domain.com?var=1'); exit();
  20. assign the respective error message to the array with the index of the form element if you only have two form fields... if(!preg_match($string_exp,$Name)) { $errors['name'] = $error_missing; } if(!preg_match($string_exp_number,$Phone)) { $errors['phone'] = $error_missing; } //then in form <div id="log"> <div id="log_res"> </div> </div> <form id="contact" name="contact" method="post" action="process.php"> <label>Name</label> <input type="text" name="Name" id="Name" tabindex="1" /> <?php echo (isset($errors['name']))?$errors['name']:''; ?> <label>Email</label> <input type="text" name="Phone" id="Phone" tabindex="2" /> <?php echo (isset($errors['phone']))?$errors['phone']:''; ?> </form> If you have more form elements, I would assign the elements to the array and then do a foreach to echo the elements, echoing the error if it is set.
  21. would recommend getting a copy of this book
  22. joel24

    CSV

    why would you do it every day? is the other db still live? what type of database is it? I'm sure you could connect to it via your PHP script and copy it that way.
×
×
  • 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.