joda Posted September 30, 2009 Share Posted September 30, 2009 Hi! I wish to generate a php script in my web page so does it can automatically execute a form option with some input boxes with a predefined values what I put in a variables in the php... Is there any possibility ? Quote Link to comment https://forums.phpfreaks.com/topic/176049-solved-how-to-automatically-start-a-form-with-php/ Share on other sites More sharing options...
smerny Posted September 30, 2009 Share Posted September 30, 2009 if you're doing it automatically (no input from user), why do you want to use a form? not sure what you're trying to do.. Quote Link to comment https://forums.phpfreaks.com/topic/176049-solved-how-to-automatically-start-a-form-with-php/#findComment-927643 Share on other sites More sharing options...
joda Posted September 30, 2009 Author Share Posted September 30, 2009 Yes,It is a little confused what I try to do,but I can not find any other possibility... So,here is my post before http://www.phpfreaks.com/forums/index.php/topic,271070.0.html I have 2 web sites. the site1 is mine but the site2 is the web server where I put my web page. I have a web mail to on the site2. I try to make a log in option on my site,on site1 but, the proble is: If I wish to log in to my web mail a have to input my e-mail address that's a little terrible for me. So I wish to input only the user name what is the first some characters left of the @ sign and I wish to create a variable where I can put together the inputted user name with the character @ and the domain name and so I got automatically my e-mail address and I can send it to site2 to log in. The problem is that I can only through a form send the values to the log in page. I think, I can collect the user name and password on my site1 and the collected info's send through a external php files in a form to the log in pages to site2. So I should generate and start automatically this: <form action="some action.." method="POST" target="_blank"> <b>Login</b> <input type="text" name="user" size="16" value="[email protected]"> <input type="password" name="pass" size="16" value="some pass" > </form> some idea? Quote Link to comment https://forums.phpfreaks.com/topic/176049-solved-how-to-automatically-start-a-form-with-php/#findComment-927653 Share on other sites More sharing options...
marvelade Posted September 30, 2009 Share Posted September 30, 2009 So we are talking about XSS here? I hope your mail administrator won't suspend u for that. Chances are that he checks HTTP_REFERER and if that's not in the same domain you can't log in. At least that's how I like to code my login forms. grtz, Marvelade Quote Link to comment https://forums.phpfreaks.com/topic/176049-solved-how-to-automatically-start-a-form-with-php/#findComment-927670 Share on other sites More sharing options...
joda Posted September 30, 2009 Author Share Posted September 30, 2009 Yes,it is a little XSS but in the real word it is not. If we are talking about XSS then I should use another server from where I start some injection or activities and make an attack on the other side... So, I wish to use the same domain where the web mail are located. Here is the real script how I log in: <form action="https://cpanel2.eutelnet.rs:2096/login/" method="POST" target="_blank"> <b>Login</b> <input type="text" name="user" size="16" > <input type="password" name="pass" size="16" > <input type="submit" value="Login" > </form> this is the same script like if I go to the web mail. The modification should be in the line: <input type="text" name="user" size="16" value="[email protected]"> and <input type="password" name="pass" size="16" value="password" > I can make the script for collecting the user name and pass and to put together the stings of user name and "@yahoo.com" so I have a variable with "[email protected]" but I should print out through php script the following code and start it automatically : <form action="https://cpanel2.eutelnet.rs:2096/login/" method="POST"> <input type="text" name="user" size="16" value="[email protected]"> <input type="password" name="pass" size="16" value="password" > </form> So, have somebody some idea ? Quote Link to comment https://forums.phpfreaks.com/topic/176049-solved-how-to-automatically-start-a-form-with-php/#findComment-927983 Share on other sites More sharing options...
jon23d Posted September 30, 2009 Share Posted September 30, 2009 Javascript, form.submit() and window.onload() Quote Link to comment https://forums.phpfreaks.com/topic/176049-solved-how-to-automatically-start-a-form-with-php/#findComment-928030 Share on other sites More sharing options...
joda Posted October 1, 2009 Author Share Posted October 1, 2009 Thanks to all of you, I solved my problem with java script, document.form_name.submit() And this work very well... Great works. Quote Link to comment https://forums.phpfreaks.com/topic/176049-solved-how-to-automatically-start-a-form-with-php/#findComment-928087 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.