delete form tag

I made the code shorter by deleting the <html> and <head> <body> tags

now I want to delete the form tag
because I want to put this on a content management system that has a form and a jquery table sorter and it is not working on my cms

is this possible
ini_set('error_reporting', E_ALL); 
         if( isset($_POST) && !empty($_POST)) 
                        if(isset($_SESSION['prev']) && $_SESSION['prev']==serialize($_POST)) 
                                echo "Data already processed!"; 
                $msg="You sent " . print_r($_POST,true); 
                //here you can try to save it to the db: 
                //mysql_connect("localhost","username","password") or die($msg."\nunable to connect to server: \n".mysql_error()); 
                //mysql_select_db("dbname") or die($msg."\nUnable to select db: \n" . mysql_error()); 
                //$sql="INSERT INTO tableName(fieldName) VALUES('{$FieldName}')"; 
                //mysql_query($sql) or die($msg."\nUnable to execute query: \n$sql\n".mysql_error()); 
                echo $msg."\nData proccessed successfully"; 

                          <script type="text/javascript" src=""></script> 
                                          var opts={ 
                                                                  url: this.form.action 
                                                                  ,type: this.form.method 
                                                                  ,data:{ } 
//NOTE: ADDED a  return false; 
                                                          return false; 
                          function processResult(data, textStatus){ 
                  <form id='theForm' action='<?php $_SERVER["PHP_SELF"] ?>' method='post'> 
                          <div>Email: <input type='text' id='FieldName' name='FieldName' value=''/></div> 
                          <div><input type='submit' name='Submitter' value='Submit'/></div> 

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

it sounds like you are "pasting" that code within the body of your "template". It will not work because the session_start() cannot be called after you have sent output to the browser. You need to call session_start() at the beginning of your "template".
rgb192Author Commented:
could this code be done without a session start....
>>could this code be done without a session start....
Sure, that is what I did two posts ago on the other threads/posts, BUT you then were complaining that it reposts upon refresh.

If you still want to avoid the refresh problem, you have to remember what was previously posted, and for that you need the $_SESSION.

It's likely that your cms is using $_SESSION. If so, then it must be calling somewhere first, in which case you can just comment out the session_start(); from the code you posted above (since you need to call session_start() only ONCE and presumable the cms already called it ).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rgb192Author Commented:

I have the same question with an earlier version of your code that I removed html,head,body tags without the session
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.