Jump to content

can't "cache" request


web_master

Recommended Posts

Hi,

 

I got a problem, and I can't find where is the problem :(

 

Here is a 2 files, first is a list and there is a form:

 

<div class="SubmitCont">
				<form action="<?php echo 'UpdScroll.php';?>" method="post">
					<div><input type="submit" name="UpdateSubmit" value="<?php echo 'CHANGE';?>" class="SubmitOn" /></div>
					<div><input type="hidden" name="scroll_id" value="<?php echo $REQUEST[ 'scroll_id' ];?>" /></div>
				</form>
			</div>

 

the other file is a file for update, but I don't know where is a problem, because I can't "cache" the ID (scroll_id)

 

<?php 
// Reload == 1
if ( $Reload == '1' ) {

// Reload from dBase
$QueryReturn = mysql_query( 'SELECT * FROM `scroll` WHERE `scroll_id` = "' . $_POST[ 'scroll_id ' ] . '" ' );

// Check query
if ( !$QueryReturn ) { echo mysql_error(); exit; }

// Request query
$REQUEST = mysql_fetch_array ( $QueryReturn );

} // end of Reload == 1
?>

Link to comment
https://forums.phpfreaks.com/topic/188074-cant-cache-request/
Share on other sites

your missing a _ in your $_REQUEST:

 

<div class="SubmitCont">
               <form action="<?php echo 'UpdScroll.php';?>" method="post">
                  <div><input type="submit" name="UpdateSubmit" value="<?php echo 'CHANGE';?>" class="SubmitOn" /></div>
                  <div><input type="hidden" name="scroll_id" value="<?php echo $_REQUEST[ 'scroll_id' ];?>" /></div>
               </form>
            </div>

Link to comment
https://forums.phpfreaks.com/topic/188074-cant-cache-request/#findComment-992894
Share on other sites

Also why use php to echo static text?

<form action="<?php echo 'UpdScroll.php';?>" method="post">

<form action="UpdScroll.php" method="post">

<div><input type="submit" name="UpdateSubmit" value="<?php echo 'CHANGE';?>" class="SubmitOn" /></div>

<div><input type="submit" name="UpdateSubmit" value="CHANGE" class="SubmitOn" /></div>

 

Link to comment
https://forums.phpfreaks.com/topic/188074-cant-cache-request/#findComment-992902
Share on other sites

your missing a _ in your $_REQUEST:

 

<div class="SubmitCont">
               <form action="<?php echo 'UpdScroll.php';?>" method="post">
                  <div><input type="submit" name="UpdateSubmit" value="<?php echo 'CHANGE';?>" class="SubmitOn" /></div>
                  <div><input type="hidden" name="scroll_id" value="<?php echo $_REQUEST[ 'scroll_id' ];?>" /></div>
               </form>
            </div>

 

 

$REQUEST is OK, because:

 

<?php 
// Reload from dBase
$QueryReturn = mysql_query( 'SELECT * FROM `scroll` ORDER BY `scroll_id` DESC ' );

// Check query
if ( !$QueryReturn ) { echo mysql_error(); exit; }

// Request query
while ( $REQUEST = mysql_fetch_array ( $QueryReturn ) ) {


?>

<div class="SubmitCont">
               <form action="<?php echo 'UpdScroll.php';?>" method="post">
                  <div><input type="submit" name="UpdateSubmit" value="<?php echo 'CHANGE';?>" class="SubmitOn" /></div>
                  <div><input type="hidden" name="scroll_id" value="<?php echo $REQUEST[ 'scroll_id' ];?>" /></div>
               </form>
            </div>

<?php }?>

 

as You see after while, when Im reloading list

Link to comment
https://forums.phpfreaks.com/topic/188074-cant-cache-request/#findComment-992919
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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