|
Posted by mantrid on 08/11/06 11:52
"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:geudnTFQ18TRbUbZnZ2dnUVZ_sudnZ2d@comcast.com...
> mantrid wrote:
> >>I think your problem is not the if statement - I suspect $updatestats
> >>isn't being set. What code do you have that sets it?
> >>
> >
> >
> >
> > That occured to me so I tried
> >
> > <form action="<?php if(isset($_POST['updatestats'])){
> >
> > instead of
> >
> > <form action="<?php if(isset($updatestats)){
> >
> > but still no luck, but I got round it by getting rid of the 'if' in the
form
> > action and placing them at the top of the page, as below
> >
> > ****************************************************
> > if(isset($download)){
> > header("Location: http://www.mysite.co.uk/excelsave.php");
> > }
> >
> > if(isset($updatestats)){
> > script for creating confirmation version of original page
> > }
> >
> > <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"
> > enctype="multipart/form-data"> name="savestatments">
> >
> > ***************************************************
> > However I would still like to know why the first method didnt work.
> > Thanks all for the support
> >
> >
> > Ian
> >
> >
>
> Ian,
>
> Were you trying to change the action based on a click on the same page?
> If so, it won't work.
> PHP is server side. By the time the page gets to your browser, PHP has
> done its job and ended processing for this page.
>
> Your if statement should work if $_POST['updatestats'] was set when this
> page was called. But only then.
>
Yes silly me that was exactly what I was doing. and it works the second way
because when the page it resent only then does $_POST['updatestats'] have a
value. nice one, thanks
ian
Navigation:
[Reply to this message]
|