thewooleymammoth Posted April 2, 2009 Share Posted April 2, 2009 I installed codepress for a code editor im creating. the problem is after installing it my $_POST['data'] stopped working this doesnt work <form method="post"> <textarea onkeydown="return catchTab(this,event)" rows="50" id="myCpWindow" class="codepress '.$extension.'" wrap="off" name="'.$pass.'">'.$contents.'</textarea> <input type="submit" value="save" name="save"> </form> <?php if(isset($_POST['save'])){//if user has selected save if(isset($_POST[$pass])){ $contentsdec=htmlspecialchars_decode(stripslashes($_POST[$pass])); if(e_wwrite($file, $contentsdec)){ echo " <br />saved file: $file "; }else{ echo " error Saving, Recommend you copy your work onto a file on your computer and contact support "; } }else{ echo " error retrieving data from saved file "; } } ?> and this does <form method="post"> <textarea onkeydown="return catchTab(this,event)" rows="50" id="myCpWindow" wrap="off" name="'.$pass.'">'.$contents.'</textarea> <input type="submit" value="save" name="save"> </form> <?php if(isset($_POST['save'])){//if user has selected save if(isset($_POST[$pass])){ $contentsdec=htmlspecialchars_decode(stripslashes($_POST[$pass])); if(e_wwrite($file, $contentsdec)){ echo " <br />saved file: $file "; }else{ echo " error Saving, Recommend you copy your work onto a file on your computer and contact support "; } }else{ echo " error retrieving data from saved file "; } } ?> the only difference is the class='' so im kinda guess that using a name and a class element in a tag doesnt work? But i need to have both, so im not sure it to do this. Quote Link to comment https://forums.phpfreaks.com/topic/152164-_post-while-using-a-class-and-a-name-in-the/ Share on other sites More sharing options...
thewooleymammoth Posted April 2, 2009 Author Share Posted April 2, 2009 ???? if my question is unclear please let me know Quote Link to comment https://forums.phpfreaks.com/topic/152164-_post-while-using-a-class-and-a-name-in-the/#findComment-799210 Share on other sites More sharing options...
premiso Posted April 2, 2009 Share Posted April 2, 2009 In the form section you are outside of PHP, not sure how it ever worked to be honest. <form method="post"> <textarea onkeydown="return catchTab(this,event)" rows="50" id="myCpWindow" class="codepress <?php echo $extension;?>" wrap="off" name="<?php echo $pass;?>"><?php echo $contents; ?></textarea> <input type="submit" value="save" name="save"> </form> Try that and see if it works. Quote Link to comment https://forums.phpfreaks.com/topic/152164-_post-while-using-a-class-and-a-name-in-the/#findComment-799511 Share on other sites More sharing options...
thewooleymammoth Posted April 4, 2009 Author Share Posted April 4, 2009 that was in php, sorry but i copied it from a different of my code and forgot to place it in the php tags Quote Link to comment https://forums.phpfreaks.com/topic/152164-_post-while-using-a-class-and-a-name-in-the/#findComment-801032 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.