Jump to content

johnnyk

Members
  • Posts

    126
  • Joined

  • Last visited

Everything posted by johnnyk

  1. The problem with that, though, is that if someone finds out the location of main.inc, they could run the cron, and that would be bad. I'm using a host and it's not like I can put the cron behind a htpasswd protected folder or anything. Also, why does it need to be in /public/?
  2. [quote author=Caesar link=topic=102929.msg409250#msg409250 date=1154652505] Where is the file calling it, in relation to the include file? One level up? In another folder? [/quote] I don't think I understand your question, but I'll try to answer. Here's how it looks: The file that is including the other 2 is /home/username/cron/main.php file1.inc is /home/username/public/includes/file1.inc file2.inc is /home/username/public/webmaster/includes/file2.inc I know that main.php includes both correctly, but the variables set in file1.inc is not accessible in file2.inc
  3. Does this have anything to do with PHP? Maybe not. Maybe it doesn't make sense at all. [code] <?php require('/web/directory/file.inc'); require('/web/differentdirectory/file2.inc'); ?> [/code] [u]file.inc[/u] <?php $a = 'whatever'; ?> [u]file2.inc[/u] <?php echo $a; ?> So the problem is that file2.inc will not echo "whatever" (as if $a isn't set). If I did the same kind of thing within the /web/ folder, it works fine. I hope I'm making sense.
  4. In my current setup, the .inc files are 644, but the folder that contains them is 755. But I am still about to include the files from other websites. How do I set the CHMOD so that the files cannot be included from any other site?
  5. What should the CHMOD of server side includes be?
  6. I read that putenv() has some problems or something. But why isn't d_d_t_s() working with the cron?
  7. Weird problem: I have a file that I include on every page of my site that looks like this: [code] <?php date_default_timezone_set('US/Eastern'); //functions and variables and what not ?> [/code] When I require() that file from a page, it loads fine. But when I require() that file from /cron/main.php (outside the public directory), I get an error that says something like "Call to undefined function date_default_timezone_set()". If it means anything, main.php is run by a...you guessed it...cron. main.php also require()s two other files, and they get included fine. Any idea? (Yay formatting!)
  8. The following will only mail if $headers isn't included in the function: [code] $headers = "MIME-Version: 1.0\nContent-type: text/plain; charset=us-ascii\nFrom: site.com <$no_reply>\nReply-To: $no_reply"; $message = "You recently requested to join the site.com mailing list. To verify that you would like to join, please click the following link:\nhttp://www.site.com/mailinglist_verify.html?email=$email&amp;id=$uniqid\n\nIf you do not see a link above, copy and paste the web address to your web browser.\n\nIf you do not wish to join the site.com mailing list, please ignore this email."; mail($email, 'site.com Mailing List Verification', $message, $headers); [/code] Any explanations?
  9. [quote author=businessman332211 link=topic=102186.msg405452#msg405452 date=1154125657] You shouldn't need to wordwrap those, just take a few extra seconds to add in br tags.  Be careful with html emails it ALWAYS double emails.  one with html and one without I believe is what the manual says [/quote] Where does it say that?
  10. How do you wordwrap html? I have a crappy little mailing list thing I made that sends an html email. Whenever I try to wordwrap() $message with "<.br />\n", the email won't send (and I'm assuming that's becuase html tags are getting broken up with "<.br />\n", which is bad). Any suggestions? And when's phpfreaks gonna fix the <.br /> problem?
  11. What about scrollbars = yes? I saw some tutorial use that so that's what I always use.
  12. So you can call a global variable from a function: $var = 'hey'; function whatever(){   echo $GLOBALS['hey']; } BUT, how would you do the reverse, something like: function whatever(){   $var2 = 'hey'; } Now say after that I want to echo $var2, is that possible?
  13. For window.open(), is it possible to set scroolbars so that they'll appear only when they're needed? I tried scrollbars=auto, but it didn't work.
  14. Ahh, there was a problem in the HTML (...target="picture"...). Thanks for the help.
  15. If you don't mind, how about one more I can't figure out: [code] function picture(img,width,height){   window.open("pictures2b.html?img=" + img,"picture","toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=no, width=" + width + ", height=" + height); } [/code] I'm no good at Javascript. ::tear::
  16. Why isn't this working: function directions(id){   window.open('\"directions.html?id=' + id + '\",\"directions\",\"toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=no, width=500, height=400\"') }
  17. Can I use str_replace on something that is required? How about if I use fopen or something like that and set that to a variable?
  18. Is it possible to set a require to a variable? Meaning: [u]a.php[/u] echo "hey"; [u]b.php[/u] $a = require('a.php'); echo eval($a); The problem I'm having is that b.php will echo "hey" even if I don't include the second line. When I do include the second line, it says: Parse error: syntax error, unexpected $end eval()'d code on line 1 I want to set the evaluated a.php to a variable, and then change the value of the variable. So I'm altering what was already included. Make sense? I hope so.
  19. 5.0.21 I had this problem before. It kept telling me there was an error in SQL syntax when there wasn't.
  20. This isn't the first time I've gotten "SQL error" things when the SQL was fine. It happened before and I don't know why. Interpolation? I am confused what you mean. And what's wrong with naming it datetime? I never name my columns according to their type, except for datetime. The php never uses $row['datetime']. I just split the datetime up to date and time using SQL. What else would I name it, and why would it matter?
  21. I can never seem to get the date function to work: SELECT *, DATE_FORMAT(`datetime`, '%W, %M %D') AS `date`, DATE_FORMAT(`datetime`, '%l:%i %p') AS `time` FROM `table` WHERE `a` IS NULL AND DATE_FORMAT(`datetime`, '%Y') = '$year' AND DATE(`datetime`) >= '2006-07-20' ORDER BY `datetime` ASC Here's the mysql_error(): You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(`datetime`) >= '2006-07-20' ORDER BY `datetime` ASC' at line 1 I don't see a problem. I'm using MySQL 5.0.21
  22. If all your horizontal rules look like <.hr />, should you use strip_tags($var, '<.hr />'); or strip_tags($var, '<.hr>'); (without the dots)
  23. Thanks alot kenrbnsn. But what do you mean about the this Sunday and next Sunday thing? pixy, that's just MySQL, and they would only work if I determine what day it currently is first. Also, is there a way to get 2 sundays from now. I'm using MySQL to select anything that is in between the upcoming sunday and a week from that (or "Sunday to a week from Sunday"). I don't need the SQL or anything, but how would I get "a week from Sunday" using strtotime()?
  24. Is there an easy way to get the date of next Sunday (or Monday or whatever). I'm thinking I could use a conditional to determine what day it is currently, and add seconds accordingly, then use adjusted date function - but is there anything better that I can do using PHP or MySQL functions?
  25. I never realized how much I hated IE until I was doing alot of CSS work. I hope IE7 is just as bad, cause if it is IE is gonna be done soon.
×
×
  • 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.