how to clear POST values
I'm writing my scraped data to a mysql database using a php script (as described in Tutorial 5 (http://www.screen-scraper.com/support/tutorials/tutorial5/setting_up_the...), and am encountering a strange problem.
If I scrape a page and a $_POST var is established, and then scrape subsequent pages where it is empty, the old variable is written into the database for all pages until a new variable is saved.
So I end up with database entries something like this:
TITLE | FNAME | LNAME | OCCUPATION | BORN
----------------------------------------------------
Mrs. | Jacqueline | Smith | | 1965
Mr. | Henry | Wood | autowrecker| 1945
Ms. | Hanna | Banana | autowrecker | 1955
Miss | Tammy | Whammy | autowrecker | 1970
Dr. | Josep | March | pediatrician | 1959
Dr. | Jimbo | Dumbo | barrista | 1948
----------------------------------------------------
Mrs. | Jacqueline | Smith | | 1965
Mr. | Henry | Wood | autowrecker| 1945
Ms. | Hanna | Banana | autowrecker | 1955
Miss | Tammy | Whammy | autowrecker | 1970
Dr. | Josep | March | pediatrician | 1959
Dr. | Jimbo | Dumbo | barrista | 1948
[where OCCUPATION should be empty for Hanna Banana and Tammy Whammy, and TITLE should be empty for Jimbo Dumbo]
Is it possible to re-set all Parameters from each session to NULL before a new page is scraped?
how to clear POST values
It looks as though the answer was in the forum already:
[url=http://www.screen-scraper.com/forum/phpBB2/viewtopic.php?t=1040&highlight=null]Session variables carry-over[/url]
Using the script:
session.setVariable("MyVar2", null);
session.setVariable("MyVar3", null);
session.setVariable("MyVar4", null);
etc. after each page is scraped and the data written out seems to work.