Jump to content

Recommended Posts

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.

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.

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.