|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#46
|
|||
|
|||
|
#44 - How do I make a PHP CRON job run?
Most server hosts these days have CRON control panels and you can setup the time and frequency of how often you want it to run. Usually there is an obvious pull down menu or descrptions of how to set time. Then there is usually a box where you enter the command itself. On this line you must first enter 'php' then a space then the full path to the script to run on the server. For example: php /home/mydomain/public_html/script.php Also, if your php script uses any includes or tried to open any text files for reading or writing you'll need to include the full path those files as above inside your script.php - ie '/home/etc/etc' even if those files reside in the same directory as the php script your initiallly referencing with the cron job. |
|
#47
|
|||
|
|||
|
Reducing the number of sql queries
[edit] Posted in the wrong place, sorry. What a bad start
![]() |
|
#48
|
|||
|
|||
|
Php development in wrong category
Hey, this php category is in programming languages, while it should be in scripting languages. You probably dont care, I was just making sure you know
![]() |
|
#49
|
|||
|
|||
|
you notice that before HTML programming
![]() |
|
#50
|
||||
|
||||
|
Quote:
Enough with the nitpicking. ![]() |
|
#51
|
|||
|
|||
|
dynamic dropdown script missing form_open function
Good clean script.
I copied and pasted the code and got several error messages. Copying in sections and reformating lines cleaned up script. I don't seem to find the "form_open ()" function per the "print form_open ()" statement. Please provide function or feedback. Thanks for your valued assistance. ~~~~~~~~~~~~~~ Quote:
|
|
#52
|
||||
|
||||
|
i'm thinking form_open is another function in the chemistry lab app that is not critical for the demonstration at hand.
|
|
#53
|
|||
|
|||
|
#45 - Why aren't my Session variables staying set?
1. Check to make sure that all pages begin with session_start() and that all the session variables you are trying to set or access are called within $_SESSION[] such as $_SESSION['username'] 2. If you are using redirects anywhere on your pages using the header() function with LOCATION then chances are your session variables may get lost along the way. The way to solve this is anywhere you use a header() redirect, on the line prior to it put: session_write_close(); //then redirect here This makes sure your session variable updates are written before the redirect takes place. 3. If you've checked all of the above and you're still losing session variables or even worse they're changing on you to different values and you can't figure out why there is a more insidious problem with session vars and register_globals. Usually you think of register_globals as an easy way to access GET or POST vars without having to parse through the whole $_GET or $_POST array. Well register_globals effects $_SESSION too, and not just for reading variables but for writing them too!! This is important because if register globals is turned on, and on the first page of your site you set a session var like: $_SESSION['fruit']="apple"; Then on some other page of your site afterwards you write: $fruit="banana"; It sets $_SESSION['fruit'] equal to "banana" without you even using the syntax $_SESSION['fruit'] !!! This sucks because you now need to be very careful not to write to any normal variables that have the same name as a $_SESSION[] variable, because PHP sort of 'aliases' it over to the session var for reading and writing purposes. Took me a lot of hair pulling to realize this, hopefully it saves you from the same. |
|
#54
|
|||
|
|||
|
[QUOTE=firepages]#29 Why does my page and/or javascript not work in $browser_type
A - Check ur javascript generated by PHP.Every browser has its DOM specifications.your javascript must be compatible with the DOM of the browser on which you are running ur javascript so that the page don't get rendered. Use DHTML tags instead of HTML tags in your html page to provide cross browser compatibility so that your pages not get rendered on different browsers.PHP has nothing to do with the page display on the browser.Its only the javascript/html/CSS that decides the layout of your page on different browsers. check your browser name using navigator.appName and then load ur page according to the browser name/DOM type of the browser. cheers..... Abhishek |
|
#55
|
|||
|
|||
|
for sessions...
it took me forever to figure out how exactly they work, but you can have LOTS of code before your session_start(); the only thing is that NONE OF IT CAN OUTPUT ANYTHING TO THE SCREEN. if it does you'll get the cant send headers info. this means you can set cookies and session vars without using javascript redirects etc |
|
#56
|
||||
|
||||
|
#46 - I am changing the settings in my php.ini but the changes are not taking affect
1. You MUST restart the server unless php is running as a CGI for the changes to take affect 2. Check the value of "Configuration File (php.ini) Path" in your phpinfo(); page if the value is a path to a file (gives the full path to the php.ini, including the php.ini part), then make sure that that is the file that you are editing if php does not give the php.ini part in the path (ie, it gives the path to a folder) then this means that php searched that folder for a php.ini but could not find one, so it is not using the defaults, if you would like to change the settings put a file named php.ini in that folder and edit that 3. You server may be telling php to set new values in apache for example, you can change the settings with the "php_flag" config option in either your httpd.conf or a .htaccess, check these files if you are running apache to make sure that they are not overriding the settings in the php.ini if this is happing then the phpinfo(); page will have differing values for master and local in some places (probably the ones you are having trouble setting) 4. You scripts may be changing the settings check you scripts for calls to ini_set(), that function can set some (but not all) configuration options from the script again, if this is happing then the phpinfo(); page will have differing values for master and local in some places (probably the ones you are having trouble setting)
__________________
Feed ME |
|
#57
|
||||
|
||||
|
Quote:
As an alternative: include_once (or require_once) will only include the file if it hasn't done so already.. |
|
#58
|
||||
|