Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Force PHP CLI To Stay In RAM?


I have a couple of command-line PHP scripts that are often called, and
I was wondering if it were possible to have the PHP interpreter remain
in RAM instead of being removed after the scipts end?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How Can I Stay Logged In?
I've made a CPanel on my personal website so I can log in and edit my site from there. But now I've made it as simple as I stay logged in for 1 hour.. after that I get logged out automaticly..

so what I wonder is what can I do to stay logged in untill I either close the whole site or I'm idle for moer than 5 minutes?

Sessions Stay Registered With Multi-logins
I log in with one username, and it says Welcome User1. I click back, and log in with a different user and it says Welcome User1. Now when I click log out with either username, it destroys the session. How do I get it so this doesnt happed. I mean so it will display the correct name and the correct info for each log in name.. PHP Code:

Outputting Username To Stay At Top Of Page Throughout User Session.
I have a successful login and session created using PHP and MYSQL and now I would like to have the username appear at the top of the screen after successful login, and possibly, though not necessarily , throughout the entire user session until logout.

Any suggestions as to the easiest, lightest weight and newbie friendly code to use?

Make Selected Option Stay Selected In A Combo After Submit
I have 3 comboboxes, one for the day, other for the month and another one for the year. Every time i select a value for the three of them and press the "Submit" button, they reset to the default option. Anyway this can be solved?

How Do You Force A Download?
Hello, how do I force a file to be downloaded instead of displaying it? I have PHP and HTML files that I don't want to be displayed but downloaded. How would I do this?

Force Https
I want to make sure people are on the secure version of a page (https). If a person is on the regular http, how can I force them to go to https?

Trying To Force A Login
I have an include file that I use to secure pages with a login. When I check the password, Im also trying to check the login date While testing, Im setting the time difference to less than 10 seconds. So the idea is that when i login, then come back to a protected page more than 10 seconds later, I should be forced to login again. However, im not getting forced to login after a 10 second wait. Code:

$sQuery = "Select iUser From Table Where sGUID = '$sGUID' and TIMEDIFF($login_date,LogInDate) < &#3900;:00:10'";
. . .
//so if no returned records...
header('Location: Login.php');

Force Reload
Is there any way I can force my php scripts to reload everytime they are used ?

Force A Download
i know that when i place a .zip, or .exe in my web directory, the  browser automatically asled the user to download the file. however i want to place a PDF into my site, and only make it available as a download, becauase i know that especially with IE and Firefox, it reads it within the browser instead.

how can i have the file a download, instead of read?

Force Post?
I'm wondering if there's a way to force a post from one page to another, without the user having to send it in a form.

If not, how do you make a textbox in a form automatically conain a variable in it (the post from the last page)?

Zip Files, Then Force Download
Is there any examples or scripts that already will do this?

I need to zip an arbitrary amount of files, say maybe a $files array full of path names to the files filled dynamically from database based on an id number...

then i need it to automatically force a download of the zip file to the browser, then automatically delete the zip file when its finished...

Force A Number To Have 2 Decimals
I have a query, and one of the results is a number that I want to forcefully have rounded to 2 decimal places. I couldn't find a good search query to find this if it's been asked before How can I achieve it, so it's like 1.00 or 187.25

$_REQUEST With Force Download
Im using this code forom the code snipits bit of the forum, but cant work out how to enter the file name?

I tried$file = $_REQUEST['/var/www/html/file.mp3']
but it gave me the error: QuoteNotice: Undefined index: /var/www/vhosts/qrecords.co.uk/httpdocs/PumpUpThePirates.mp3 in /var/www/html/file.mp3 on line 2
Code:

Force A Page To Be Re-validated?
I'm trying to force a page to be re-validated every time someone views it, even when they click the back button. I'm currently using:

header("Expires: " . gmdate("D, d M Y H:i:s", strtotime("-1 year")) . " GMT");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: no-cache");

However, my pages still seem to display without the server being called when the back button is pressed.

Can anyone suggest the correct headers/code I can use to force the server to be re-called when the back button is pressed?

Force Download .adr File
I have a .adr file (Opera bookmarks) that I want users of my website to download. The problem is that when I open it in my browser, it shows up just like a .css or .txt file, but I want to automatically start to download the file. I know there is a way to do that in php, but I don't know how.

Force PHP Redirect Instead Of Displaying CGI Error
I am sure I found the answer before on here but I cant for the life of me find it now. I need to change the way one site in iis works when someone tries and goes to a non-existant php page, instead of displaying:

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

How To Force A Download Of An Html File
I'm making a poll management system, and when the administrator creates a new poll I want an html file (containing the actual voting form) to be automatically forced to download via the save as dialog. How is this done? Secondly, I would prefer it not to have to be written to the server first. I just want to dump all of the text in a string variable to the save dialog.

Force Browser Download Of Content
Ok, this isn't a "How do i force the browser to download my file..." question.

This is a bit different because what i want to give the user isn't a file.

I want to provide a copy of a database table as a CSV file.

(force) Delete A Session File, How?
I dunno if this is meant for here or apache anyway.. my script uses sessions... if the person logsout.. the session is closed and the session file is deleted.. if the person just shuts down the browser the session file is not deleted and hence i've got hundreds of redundant session files.

Force 2 Decimal Places For Currency
How can I force a value to retain 2 decimal places (or atleast display them)? E.G. force $19.90 to be displayed as such, not $19.9

How Best To Avoid Brute-force Looping?
I have a style/php question. (I am a C hacker by background, and
thus everything is a loop... But PHP is different...)

I write out my array and read it back in. It comes in thus:

Array (
[currentField] => 103
[brgf1] => 0.000000
[brgt1] => 1.000000
[axa1] => 1
[brgf2] => 2.000000
[brgt2] => 2.000000
[axa2] => 2
[axb2] => 2
[axc2] => 2
[axd2] => 2
[brgf3] => 2.000000
[brgt3] => 3.000000
[axa3] => 2
[axb3] => 2
[axc3] => 2
[axd3] => 2

.....
.....
)

Basically each line consists of two bearings and 4 true/false switches.
The line number in the schedule is apended to the name of the field.

In my C mind, this calls for a loop, bruteforcing our way and appending
the counter to each name....

But I *know* there is a more elegant PHP way to do this. While it makes
sense in C, it just looks fugly in PHP....

As I use PHP to generate the field names, I can change those if it makes
things easier....

Force Download On Win2k Server
My win2k server has read write and execute permissions throughout the entire account and I can't really change it without removing those permissions throught the entire account, so what I need to do is force download an exe file, since just linking to it tries to execute it on the server. Is there some way in PHP or ASP that I can force it to download and not execute?

Any Way To Force Implict Variable Definition Etc?
A lot of languages you can force implict variable definition, where you must declare your variables at the top of the function/code before it's used. This way you create less bugs using the wrong variable name, which may not crop up until later on....

How Do I Force A FRESH RELOAD Of A Page
I've built a few php scripts, but since its reloading the same page I can't get it to refresh the page. I've implemented some expire meta tag...but is there anyway I can try and force it to refresh?

How Do You Force Received: Variable In Mail()?
I was able to change my Return-Path parameter
seen in the full headers of email sent with mail().

Now I still see my userID in the parameter as shown here seen in my full
headers of my email sent.

Received: (from userID@localhost) by mydomain.com

Is There A PHP Function To Force A Browser Refresh
I have an html page that gets updated about once a week. I would like to FORCE the browser (IE, Firefox, Netscape, or Opera) to REFRESH when the user opens the page to ensure they receive the latest update. Been searching around for some php code to add to the page to accomplish this without success. Can anyone give me a steer to how to accomplish this.

Create/force A New Session ID Different From The Existing One?
Is there a way to create/force a new session ID different from the existing one?

Force Header To Download File
I've created a document system that allows our company to upload files and create documents for internal use. I've completed the system except for the download system. When a user uploads a physical file say a .xls it's uploads outside of the home dir so it's not accessible via the web to anyone.

I'm trying to figure out the standard method for creating a download link for such a file. what it's the most common method for this? How can I cause the header or browser to call and then dowload the said file?

Php COPY Command... Any Way To Force Chmod 0660?
I want to copy my MySQL table via copy(oldtable, newtable) but I hear that the mode it sets is 0777.... Is there any way to force it to be anything else?

How Do You Force Return-Path: Variable In Mail()?
I am sending email using the mail() function on a hosted account. I am
trying to override the RETURN-PATH variable but it is not working. The
server keeps overriding the variable I put in.

Here's what I have:
.....
$headers = "From: me <me@mine.com>
"
$headers .= "Return-Path: me <me@mine.com>
";
.....

When I send one to myself and display full headers, it shows my
userID@myserver.com as the Return-Path.

WWW-Authenticate: How To Force Password Login At Every Page Refresh ?
<!--
The following sample should authorize the user to log on the site.
This works once but after refreshing the browser, it does not prompt
again for login until all browser (IE 6) windows are closed and the
same page is opened.
I turned off all caching but still it does cache (as a refresh doen
not promt again).

How can I force the page to prompt for a password at every refresh

-->

<html>
<head>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<?php

$showall = false;
error_reporting (E_ERROR);

if (($PHP_AUTH_USER != "myname") || ($PHP_AUTH_PW != "mypass"))
{
header('WWW-Authenticate: Basic realm="Secure Login"');
header('HTTP/1.0 401 Unauthorized');
$showall = false;
}
else
{
error_reporting (E_ALL ^ E_NOTICE);
$showall = true;
}

if (!showall) {
echo "access denied";
} else {
?>

................

</head>
<body>

.................

<? } ?>

</body>
</html>

How To Allow Downloaded Files To Be Splitted When Using A Force-download Script ?
I suppose you all know force-download scripts. The problem is that
these scripts don't allow files to be splitted when downloading them
via a download manager.
I've found a solution to enable download resuming, but now, it remains
the splitting problem. Does anyone have any idea ?

Force-downloading / Octet-streaming Multiple Files At Once
as my methods of file distribution involve the cloaking of the source, i am using application/force-download via urls using get variable methods to give authenticated users the file... only thing is, i can't get more than one stream to happen simultaneously.  when i choose another file, the page perpetually loads until the first download has finished.   

Anyone know how to make this work in my favor?  I have considered ziping the files into one, and am seeking out a script for that to happen (can that be done on the fly?).  I would like to do both. 

Force User To Enter Characters Into A Form Field?
I have a form that our visitors need to use to sign up for our newsletter... Country is a required field on this form.. and I have it set up for PHP to check and make sure some thing was entered but what I am finding is that lot of visitors are just putting in several spaces. I have it validating to make sure something was put it in and to make sure that it wasnt just one space.. but if they enter multiple spaces the form processes. Is there any way or built in function that anyone knows about that will make sure that characters are entered and just not a series of spaces? or will I have to look to javascript for that?

Force Reload Of Page When User Press "Back" Button
Is there a way to force a page to reload if a user har pressed the "Back" button in the browser.

"Force Download" Function
I've built a website that uses a force-download php script that's triggered by an on-click javascript event.

The script works fine when fired via javascript, but I'm trying to tweak it into an includable function that's generically portable and is triggered by an input button within an "empty" form - nothing's between the form tags but the input button and two hidden fields which feed the file name and directory path of the file to the download function.

The input trigger works, and the file name and path are passed succesfully, but I get a bunch of "can't modify header information" warnings.

The force-download script does have a bunch of header information in it.

Anyway, is there a way to make this work without using javascript?

"force" A Download
Ive got the following code.  however its telling me to download itself ( download.php), and not the file in the $_GET data...

<?php
header("Content-type: application/".$_GET['type']."");
header("Content-Disposition: attachment; ".$_GET['file'].";");
readfile("$_GET['file']");
?>

is this the correct code or do i need to try something different?  The data type will change.  at the moment the data types are as following:  .py, .java, .zip, .js( not sure).  We may also be downloading .exe etc.  *its a programmign website.


Copyright © 2005-08 www.BigResource.com, All rights reserved