laserlight wrote:Why do you want to do that? The second table=$name will override the first.
Please do not recommend the ereg family of regular expression functions. Recommend the PCRE functions instead. In this case, regex is overkill as [man]strpos/man will suffice. Depending on what oaskedal really wants to do, it may be even better to use [man]parse_url/man, [man]parse_str/man and [man]http_build_query/man.
Ok, maybe some more details will do 🙂
When I push the 'attach' button the first time, the following should be added to the $url (which before this operation only contain e.g. 'page2.php'):
?table=$name
the second time I push the 'attach' button, the following should be added to the $url (which before this operation should contain 'page2.php?table=$name'):
&table2=$name
the third time I push the 'attach' button, the following should be added to the $url (which before this operation should contain 'somepage.php?table=$name&table2=$name'):
&table3= $name
and so on...
So, why this script?
I will use it to verify my different session arrays on the next page (the place where the page2.php should go to in the end). A new session array is stored every time I hit the 'attach' button, and the name of it is $name. That way I can identify them, when I hit my 'finished' button and are sent to page2.php... Here I will print them all to the screen, so the user can see what input he did on the previous page..
If there's another way around - please let me know :-)
I hope this was not to complicated...:queasy: