Hi guys,

I have two questions, I wonder if they are possible to implement.

1. <form action="nextform.php" method="POST"> Is it possible to hide nextform.php from other users as I don't want anyone seeing where the data is being POSTed. Or similar solution.

2. Is it possible to hide javascript files as well? Again, I don't want anyone seeing where javascript file is stored. Or similar solution.

Thanks in advance

hi, for the first case what you can do is,just replace the action="nextform.php" with
action="#" ,so in case of any submit method it will redirect to the current page. So do not use submit to post the data,change the method="get" or leave it as it is ,but do not use submit in any button.

Instead use java-script function to call nextform.php on clicking a button that you wished to use for submitting the data,and send the data through query string like this
window.location.href="nextpage.php?id=123&value=151"

And your second question is quite difficult,because most of the developer tools in the browsers and source code will provide the javascipt file location
But you can try this link,a bit hard to understand but it may solve your problem

http://www.frontpagewebmaster.com/m-189383/tm.htm

Good luck....

For the 1st question, is this what you mean?

<form action="" method="GET">
<input type="text" name="myname" />
<input type="submit" name="submitbutton" value="Show my name" />
</form>

index.php
<?php
if(isset($_GET["myname"]) && $_GET["myname"] != ""){
	header("location: nextform.php?myname=".urlencode($_GET["myname"]));
	exit;
}
?>

nextform.php

<?php
if(isset($_GET["myname"]) && $_GET["myname"] != ""){
	echo "Process is finalised in this page and redirected to thanks page.";
	header("location: thanks.php");
	exit;
}
?>

Yes it is correct,i suggested you to use java script and you are using php instead.
But it is correct :)


But try using java script,because the code you have shown will make two page calls
1st is your index page itself
--> There it will check the query string and then call 2nd the nextpage.php

But in case of java script,only nextpage.php will get called.

:)

I understand you but if I use it in javascript, the name of the file (nextpage.php) will be visible to everyone who opens source code from their browsers. I don't want anyone to see which file I am sending the data.

If I use window.location.href="nextpage.php?id=...........", it will be visible.

Ohh yes, i overlooked that point.
Php code is the correct one.


:)

Thanks very much for the help.

myPleasure
happy coding ahead :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.