Jump to content

Calling a .php file


_giles_

Recommended Posts

Hi all,

I’m working on my first PHP project – fill a form, email details to me, trigger a force download. All the main components work, just need to fit them together

I have a normal HTML page with a number of fields. Submit calls a .php page which checks the fields for user input, if >0  a email is dispatched to me. I have another .php page which starts a force download. Thing is how do I call this page from the end of the first script page?

It has to be after the Email check script, which means it’s in the body so I can’t use headders or page divert. A manual hyperlink (as a way of testing) works just fine, but how to I call a automatically call a URL? fopen() appears to open and READ the file, calling the page via echo”URL” also fails.

It can’t be that difficult can it?
Hope you can help

Many thanks
Giles
Link to comment
Share on other sites

Typically people use meta redirect for this..

[code]<meta http-equiv="Refresh" content="0; http://site.com/path/file.php">[/code]

That means "Act as if you got a header called Refresh with this value".  The browser should redirect after 0 seconds (immediately).  Display a link anyway in case it doesn't work.

There's a number of javascript methods to redirect as well.

Alternatively, you can do the email check before displaying any output.  Then you can use a header redirect as usual.  That sounds like it ought to work given your setup.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.