I want to make a url look like this in the status bar: mysite.com/cGF0aD1ob21lJmZpbGU9ZGlzY292ZXIucGhw Code (markup): How do I do this. I pull user data from a database and use the get method to pass that data to another page. It's too explicit to show that data in the status bar and the next page's url. How do I obscure it while make the link working. Thank you,
Why don't you just pull a user id or something, and pull the data on the new page? Or use post instead of get?
Thanks, I get the picture. I just think about the possibility of this thing. The reason I want to use the GET instead of POST by using <a> tag in the <form> is the design would get ugly with hidden form and the GET method would keep me working in the current root directory.
Yeah, don't ever pass explicit data via GET, encrypted or unencrypted. And especially not without SSL. Do as @PoPSiCLe says, and pass over IDs. Or used sessions.
I'm confused... what are you talking about? <a>-tag in the <form>? How, what? Hidden form? I'm assuming you've already got a form to fill the GET-variables - you just change the method to post... I don't understand how this changes anything. Nor why working in root-directory or not has anything to do with the problem... Besides, you can still use $_GET to add the user_id onto the URL - and then just pull the information you need on the second page based on the ID passed via the URL.
I'm just talking about hiding or obscuring url in the status bar and in the address bar of the page it go to after clicking. The current method I use is something like this (Can't remember the exact code): <form id="myform" name="myform" method="POST" action="nextpage.php"> <input type=hidden id=xxxx name=id value=yyyy /> <input type=hidden id=aaaa name=email value=bbbb /> <a href="javascript:function(){}" onclick="document.getElementById('myform').submit()">Go</a> </form> Code (markup): But I want to do something like this instead, so it won't break my original design. <a herf="nextpage.php?id=xxxx&email=yyyy">Go</a> Code (markup): sorry about root directory, just thinking out loud
I think you should look at the design (not the look) of your site. This seems unnecessary convoluted and bad code.
I'm intrigued. What should be the better code. I use this practice for very very long time. Any suggestions should be appreciated. Thank you,
Having used one way of coding for a long time doesn't make it the right way to do it. Automatic submit via javascript of a hidden form seems to me like a method that should have died silently during the 90s - especially if it's submitting information that shouldn't be submitted and openly available anyway. As nico_swd said - use sessions. Or cookies (albeit it's not recommended), or just pass an identifier (for instance a user_id) to the different pages, and pull the needed information on each page. There are so many ways that are better than the presented option.
Well, following PoPSiCLe suggestions. I don't think I need it anymore. It's my fault for lacking advanced PHP skills, I guess.
... and you're not using a input[submit] instead of that stupid malfing idiotic halfwit scripttardery on an anchor why exactly?!? No offense but that has to be one of the DUMBEST things I've ever seen done on a form.
Back in 2007 or 2008, they said Facebook once use hidden form to pass data around its site. I think it was good. My Google search lands me exactly to that solution. Bingo! I use it ever since. After this point, no more stupid malfing idiotic halfwit scripttardery on an anchor exactly
It works, by all means, but it's not a good way to code - and it leads to, for instance, passing of values you don't want passed, passing of values before they're ready, etc. But it seems you've gotten good advice in this thread, and hopefully, you'll be able to keep the design as is, by modifying a bit of background code