web_master Posted October 23, 2009 Share Posted October 23, 2009 hi, well, I try to find what I'm I done wrong... the "reload" don't work, and I don't know why? The code is: <?php // Connect to MySQL include ( '../MySQLconnect.php' ); error_reporting(E_ALL); @ini_set( 'display_errors', '1' ); $Reload = $_REQUEST[ 'reload' ]; ++$Reload; ?> <?php if ( $Reload == '2' ) { // No Preg $Preg = $_POST[ 'shout_txt' ]; $Replacement['0'] = '/\\\"(.*?)\\\"/'; $Replacement['1'] = '/\\\'/'; $Replaced['0'] = '„$1”'; $Replaced['1'] = '’'; $NoPregText = preg_replace($Replacement, $Replaced, $Preg); // Insert into dBase $Query = mysql_query(' INSERT INTO `shout` ( `shout_nick`, `shout_txt`, `shout_datetime`, `shout_ip`, `shout_host` ) VALUES ( "' . $_POST[ 'shout_nick' ] . '", "' . $NoPregText . '", "' . date( 'Y-m-d H:i:s' ) . '", "' . getenv( 'REMOTE_ADDR' ) . '", "' . gethostbyaddr( getenv( 'REMOTE_ADDR' ) ) . '" )' ); // Check query if ( !$Query ) { echo mysql_error(); exit; } // Retrieves the last ID $shout_id = mysql_insert_id(); // Reload from dBase $QueryReturn = mysql_query( 'SELECT * FROM `shout` WHERE `shout_id` = "' . $shout_id . '" ' ); // Check query if ( !$QueryReturn ) { echo mysql_error(); exit; } // Request query $REQUEST = mysql_fetch_array ( $QueryReturn ); } ?> <div><form id="ShoutForm" action="<?php echo $_SERVER[ 'REQUEST_URI' ];?>" method="post"> <div><input type="text" id="ShoutNick" name="shout_nick" value="<?php echo $REQUEST[ 'shout_nick' ];?>" maxlength="8" class="Nick" /></div> <div><textarea id="ShoutTxt" name="shout_txt" cols="55" rows="4" class="ShoutTxt"><?php echo $REQUEST[ 'shout_txt' ];?></textarea></div> <div><input type="submit" id="ShoutSubmit" name="shout_submit" value="ELKÜLD" class="Submit" /></div> <div><input type="hidden" id="ShoutID" name="shout_id" valud="<?php echo $REQUEST[ 'shout_id' ];?>" /></div> <div><input type="hidden" id="ShoutReload" name="reload" valud="<?php echo $Reload;?>" /></div> </form></div> Link to comment https://forums.phpfreaks.com/topic/178738-solved-reload/ Share on other sites More sharing options...
Bricktop Posted October 23, 2009 Share Posted October 23, 2009 Hi web_master, On your form you are using "valud" instead of "value" for both the "ShoutID" and "ShoutReload" input fields. Change the last to lines of your form to read: <div><input type="hidden" id="ShoutID" name="shout_id" value="<?php echo $REQUEST[ 'shout_id' ];?>" /></div> <div><input type="hidden" id="ShoutReload" name="reload" value="<?php echo $Reload;?>" /></div> Hope this helps. Link to comment https://forums.phpfreaks.com/topic/178738-solved-reload/#findComment-942858 Share on other sites More sharing options...
web_master Posted October 23, 2009 Author Share Posted October 23, 2009 Hi web_master, On your form you are using "valud" instead of "value" for both the "ShoutID" and "ShoutReload" input fields. Change the last to lines of your form to read: <div><input type="hidden" id="ShoutID" name="shout_id" value="<?php echo $REQUEST[ 'shout_id' ];?>" /></div> <div><input type="hidden" id="ShoutReload" name="reload" value="<?php echo $Reload;?>" /></div> Hope this helps. Oh, what an amateur mistake, thanks, maybe Im tired... THANX Bricktop !!!!!!!!!!!! Link to comment https://forums.phpfreaks.com/topic/178738-solved-reload/#findComment-942863 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.