Wildhalf Posted March 14, 2007 Share Posted March 14, 2007 Hi, I was wondering if it is possible to hide some html code in a php script. What i have is a paypal button on my site but i want to hide the form code for paypal. What i want is for my visitor to click this button which calls a php script, which then redirects the user to the paypal payment screen. The reason i am doing this is because i can not encrypt my subscription button as i am trying to pay my affiliates directly into there paypal account regards, Kieron Quote Link to comment https://forums.phpfreaks.com/topic/42733-solved-is-it-possible/ Share on other sites More sharing options...
per1os Posted March 14, 2007 Share Posted March 14, 2007 if (isset($_POST['btnSubmit'])) { // user clicked paypal button. // do processing here header("Location: http://www.paypalste.com/page?parameters=ok } If thats not what you are looking for post some code. --FrosT Quote Link to comment https://forums.phpfreaks.com/topic/42733-solved-is-it-possible/#findComment-207330 Share on other sites More sharing options...
Wildhalf Posted March 14, 2007 Author Share Posted March 14, 2007 THanks frost, I didn't describe what i want properly... All i wanted on my html page is a button with a link to some php code that holds the information about the payment. Basically i don't want the user to be able to look at the paypal payment source code. Quote Link to comment https://forums.phpfreaks.com/topic/42733-solved-is-it-possible/#findComment-207334 Share on other sites More sharing options...
per1os Posted March 14, 2007 Share Posted March 14, 2007 File1.php <html> <a href="process.php">Pay Now!</a> </html> process.php <?php // process the pay pal data here //redirect user to paypal site for payment header("Location: http://www.paypalste.com/page?parameters=ok ?> If that is not it, you need to be alot more clearer on what you want. --FrosT Quote Link to comment https://forums.phpfreaks.com/topic/42733-solved-is-it-possible/#findComment-207340 Share on other sites More sharing options...
Wildhalf Posted March 14, 2007 Author Share Posted March 14, 2007 thanks again... Ill test it out later and get back to you Quote Link to comment https://forums.phpfreaks.com/topic/42733-solved-is-it-possible/#findComment-207356 Share on other sites More sharing options...
Wildhalf Posted March 14, 2007 Author Share Posted March 14, 2007 I've looked into it a bit further and Frost is right.... I could use <? header("Location: http://www.paypal.com/xclick/[email protected]&amount=1.00&item_name=Testing+123"); ?> or i could use javascript like the example below <html> <head> <script language="JavaScript" type="text/javascript"> <!-- function submitForm() { document.myForm.submit(); setTimeout('self.close();',10000); } //--> </script> </head> <body onLoad="javascript:submitForm()"> You are being redirected to PayPal. This window will close itself in 10 seconds. <form name="myForm" method="post" action="https://www.paypal.com/cgi-bin/webscr" target="_blank"> <input type="hidden" name="business" value="[email protected]"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="item_name" value="test"> <input type="hidden" name="amount" value="12.00"> </form> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/42733-solved-is-it-possible/#findComment-207394 Share on other sites More sharing options...
Wildhalf Posted March 14, 2007 Author Share Posted March 14, 2007 Just to let you all know... I used the second example in the above post and it works like a dream... I changed the .close to 500 which is half a second... The paypal page opens and the main page shuts behind it.... Quote Link to comment https://forums.phpfreaks.com/topic/42733-solved-is-it-possible/#findComment-207544 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.