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




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)?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
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 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?

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?

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?

Post And Redirect With Post Data
The solution we have though up is the following:

1. The user fills in data in a form and hits submit
- This submits (POST) to another page (redirect.php)
2. redirect.php adds more POST data to POST and then submits all this POST data to another page (offsite [payment portal])

The reason why we have to do this is for someone who knows our to read html source code, could easily find the sucessful page which will then do the processing we need to do on our side. Which means freebeis.

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.

Calling A Post Script From A Post Script; Curl Works But ...
I am trying to call a php script B from script A.

However, when I do this with curl everything works fine except the url of the script is the url of script A. How can I make the URL the URL of script B.

Is this possible with curl?

"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?

PHP Post, Then HTML Post?
Using PHP, I want to POST or GET some variables to a second php page.
This, I already know how to do.

However, on the second php page, I want to use a simple, standard HTML
form using the standard form-submitting method such as:

<form action="https://orderpage.ic3.com/hop/orderform.jsp"
method="post">

whereupon both sets of variables --- the earlier variables that were
POSTed or GETted to the second page, along with the standard form
variables derived within the second page --- will be POSTed to the
above URL.

In the second page, might I actually translate the received variables
into actual HTML code? For instance, if my first page POSTed the
variable xyz to the second page, then might the following code on the
second page receive that variable and then include it when the second
page's "Submit" button is pressed?

<? $xyz=$_POST['xyz']; ?>
<INPUT TYPE="HIDDEN" NAME="xyz" value="<?=$_POST['xyz']?>" >

Or how, otherwise, might this be done?

"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.

How To POST Using PHP ?
I am fairly new to PHP, I am not sure if what I want to do can be done. I have done some research but cannot find the asnwer.
Here is the problem. I have a Perl script that is called from and HTML form, with some hidden inputs, that uses POST method. The user has to enter some text input into the form and click 'Submit" button.

What I want to do is have my PHP script call the Perl script and pass similar information but obtained from a mySQL database, rather than the user form. How can I have my PHP simulate POST method?

Using $ GET And $ POST From Same URL
I am finishing off a new payment gateway script for the Shop-script Pro shopping cart and have run into a problem reading $_POST variables being sent back from the payment processor.

I supply the payment processor (paymate) with a return URL which has some variables in the URL string (?status=success&processor=paymate).

The payment processor constructs a confirmation page with a form which uses my return URL as a form action and a set of hidden fields which details of the transaction itself.

When I try to read the POST variables, they are not there. I am trying to figure out why that might be.

One possibility is that the URL I provide has GET variables in it, so maybe the PHP receiving page recognises this and will not try to read POST variables, even though I ask it to?

Another possibility is that Shop-script does not call the actual PHP script with the $_POST array reader as the return URL, but instead uses "[domain.com]?blah" (which calls index.php and it then calls the actual PHP receiving page (adding the header/footer/etc added in the process), therefore losing the POST data?

Is one of these more likely than the other? Any thoughts on how I might get around it without rewriting Shop-script completely?

Post And Get
I recently re-installed windows and with that apache, mysql and php. I've downloaded the new php version and now I have this problem. In my script I use post and get methods and now they aren't working anymore.

I've tried several things but when I use a form with post or get or and hyperlink (e.g. index.php?name=1) the page I go to doesn't recieve the values for some reason. I've tried a print() at the 1st line of the script so I know I don't have some code messing up, but they're empty.

Post To Self?
if test.php is this file:

<?php
$lang = $_POST["lang"];
print $lang;
?>

<form method=post action=test.php>
<input type=image src=engFlag.jpg name="lang" value=en>
<input type=image src=fraFlag.jpg name="lang" value=fr>
</form>

Post/get
Is there a way to sent data using hyperlink (GET routine) and retrieve it in $_POST array?? something like...

echo '<a href="boss.php?foo=bar" method="POST">link text</a>'
doesn't work (I retrieve data in $_GET) Is there another way?

POST Var
I'm trying to retrieve a file location, and then insert it into mysql as a longblob - but that is beside the point. I have a simple HTML form with <input type="file"... /> which should store the path selected, and that path should then be sent to a post var on 'submit'.

My problem is, the path is not showing up! It shows up in the HTML form, but when I submit the form, nothing is in the POST array representing it. Other form elements pass, but not the type="file". Is this some type of PHP issue with the way it handles HTML Forms? Code:

PHP Pre 4.2 VS. PHP Post 4.2
My local PHP install (for development/learning) is 4.3, but my hosting
service uses 4.0.6. Without turning on registered globals, is there a
common way these two versions can handle form data? 4.0.6 doesn't have
import_request_variable(), $_POST, or $_REQUEST, and 4.3 chokes on
$HTTP_POST_VARS[].

GET And POST
I just started learning PHP and got really confused by how PHP
receives varables from HTML form. I'm using PHP 4.3.9 downloaded from
php.net. In my html file I use POST to send variable 'userfile':

Getting POST From A URL?
I have a user system where I'd like players to be able to view each others' profiles. So basically what I'm hoping for is something like...

The URL, is viewprofile.php?id=xxxxxx

Where xxxxxx is, would be that player's ID number. But what I'm wondering is how exactly if I generated that, the script would figure out what the ID was referring to. This'd also make searching for the ID easier cuz I have a cool way of doing that.

Md5 And Post
I have a signup form that encrypts the password into md5 format, which then stores it in to the database.

I then have a login section that translates the password into md5 to check against the stored version. However the one that is entered and posted via a password field, results in a different md5 hash, is this due to the nature of the password field or post, if so what is the best way to store an encrypted password and then compare it?

PHP POST
I'm doing a page (only a demo) where there are articles. I've decided to practice and make a backstage admin page where I can add, modify or delete articles, and It works fine. Ah, I forgot to tell, I'm using a MySQL database to store the articles.

And the problem: I made my admin page, where I have a form which has all the articles, and have a checkbox assigned to each and every one of them. I'm using the POST method to go to a new page where I can edit the article. So, the problem is, I want the main admin page to be able to send more article IDs with POST (if more than one checkbox is checked) and the editorial page could edit multiple articles at the same time. I thought of arrays, and stuff, but I cannot make it work!

POST Not Working...
hello. im running php/mysql/apache on linux, os x and freebsd. on os x, everything works fine, but on linux and freebsd the default install of 4.2.3 does not accept POST....i dont know how to explain but when i submit a form, the data wont be changed to variables. i checked the ./configure --help file but there was no option...i just assumed it was built in...anyways thanks for any help.


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