Jump to content

dougjohnson

Members
  • Posts

    98
  • Joined

  • Last visited

Everything posted by dougjohnson

  1. You may need to save the file to some other location other than the temp location and then calculate the file size??? For security reasons you probably want this location to be outside the root of your server.
  2. I agree. I would always use PHP instead of javascript if possible.
  3. The code above works but you'll need to fix the syntax error at the end: fulldatetime = currentDate + " " + thetime + " " ampm TO fulldatetime = currentDate + " " + thetime + " " + ampm
  4. Something like this? (I didn't verfiy this) var currentTime = new Date() var month = currentTime.getMonth() + 1 var day = currentTime.getDate() var year = currentTime.getFullYear() var hours = currentTime.getHours() var minutes = currentTime.getMinutes() currentDate = year + "-" + month + "-" + day if (minutes < 10){ minutes = "0" + minutes } thetime = hours + ":" + minutes + " " if (hours > 11) { ampm = "PM" } else { ampm = "AM" } fulldatetime = currentDate + " " + thetime + " " ampm
  5. This tizag link will show you all you need to now I think: http://www.tizag.com/javascriptT/javascriptdate.php
  6. $homepage = file_get_contents('http://www.example.com/'); Then parse $homepage, this would be one way to do this... I think
  7. if (strlen($pass) < 5 ) { header("location:register.php?msg=Your password must be at least 6 characters."); } else if(strlen($pass) > 29 ) { header("location:register.php?msg=Your password must be less than 29 characters."); }
  8. How are you going to use the mid value?
  9. Could you get your random movie info, then redirect to movies.php and append the ?mid=xxxx to the url before the redirect? Or I may not understand your question?
  10. This works for me: $path = "/path/to/file/on/server/file.zip"; $mm_type="application/x-zip-compressed"; // modify accordingly to the file type of $path header("Content-Description: File Transfer"); header("Content-Type: " . $mm_type); header('Content-Disposition: attachment; filename="' . basename($path) . '"'); header('Content-Transfer-Encoding: binary'); header("Expires: 0"); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header("Content-Length: " . (string)(filesize($path)) ); header("Cache-Control: private"); readfile($path); // outputs the content of the file
  11. I think you need an array index number in: if($_SESSION[$c][->index#here<-]
  12. This javascript function might work? I haven't tested it. It may not work inside the "options" tag"? <script type="text/javascript"> function changeBGCol(obj, color) { obj.style.backgroundColor=color } </script>
  13. I think you need to concatenate the string while building the csv file "row"?
  14. Check this out -> http://phpexcelreader.sourceforge.net/ I've never done this but it would be very useful if it works.
  15. Nested select statements might work. Depending on what data is stored in which database, you could select (connect to this database) from the user db, get jane doe's company, then select from the company db (connect to this database) and display all of her specific company data. Again, I don't know the structure of your database's or what a "box number" is.
  16. I would use the "full path" to the redirect page so you can use the code no matter what "level" the redirect happens in your site. header( 'Location: http://www.yoursite.com/new_page.html' ) ; Also, you might check for a specific value in your $session variable: if ($session == "Y") {
  17. Instead of [?key=a] try: php -f /home/zyquo/public_html/ghosthuntersportal.com/cj_run.php a I don't think you can pass variables the same way in cron as you do from the URL.
  18. Have you ran other php scripts in cron on your server successfully using the syntax you have shown? If not, you might try this.... In your crontab: (make sure the path to your script is correct and the script has the correct permissions) */5 * * * * php -q /CORRECT path to script/cj_run.php?key=a In the script itself, at least on my servers, I don't use the BASH at the top of the php script. But like I said, if this has worked in the past, leave it.
  19. I think TRIM() would do the same thing also.
  20. What kind of pop up are you wanting? If a javascript "alert" popup is what you want, you could do: <body onLoad="alert('popup text');"> If you want a popup "window", you could do the same "onLoad" but use: <body onLoad="javascript:window.open('popuppage.php')";> I'm not sure exactly what you're asking for so I'm sorry if I'm off the mark.
  21. I think I found the script you are using (http://www.javascriptkit.com/script/script2/dyndateselector.shtml)? You might try making a backup of your current script. Then replace it with the working one from the javascriptkit site. Then you could bring in your custom code step by step, checking for the bug as you go.
  22. Take a look at this: http://php.net/manual/en/mysqli.prepare.php What's going on here is the ?'s are place holders for the actual user variable input. The bind_param "maps" the input to the corresponding "?" placeholder. The binding "s" is for alphanumeric input, "i" would be for numeric and there are a couple other types see the link above. The bind_result loads up the resulting values from the prepared mysql statement. At first all of this is a pain, but after a while it's ok and you don't have to worry about injections.
  23. That should work. Your single and double quotes may be incorrect? Try this: <?php $bottle[0]="<img src='images/bottlesandcaps/diamondbottles/smalldiamonddarkblue.gif'>"; $bottle[1]="<img src='images/bottlesandcaps/diamondbottles/smalldiamonddarkclear.gif'>"; echo $bottle[0]; ?>
  24. This might help? print( date("H:i:s", strtotime("1:30 pm")) ); output: 13:30:00 print( date("g:i a", strtotime("13:30:30 UTC")) ); output: 8:30 am
×
×
  • 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.