Hello! Is there any function for posting from PHP sctipt? Instead of <form name="input" method="post" action="login.php" > <input type="text" name="user" /> <input type="password" name="pass" /> <input type="submit" value="Login" /> </form> HTML: I want that PHP script does that automatic, something like <?php post("login.php", "?user=$username&pass=$password"); ?> PHP: Thanks
Just create a php function post($page, $arg); and add the below code function post($post,$arg){ echo "<form method='post' action='$page'>"; for($i=0;$i<count($arg);$i++){ echo "<input type='text' name='$arg[$i]' value=''>"; } echo " </form>"; } Code (markup): Note: $arg should be list of arguments in a array
I couldn't find any helpful methods. ________________________________________________________________________________________ No. ________________________________________________________________________________________ This will only generate HTML code, that's not what I wanted. ________________________________________________________________________________________ Thanks anyway...