Monkuar Posted May 10, 2009 Share Posted May 10, 2009 Thanks for viewing. First, I have this funtion I need to run (I use it on my forum it's a mod) $SDK->write_pm ("1", "Hello!", "Hello! This is a test message sent to user id 1"); And whenever I put that between <?Php codes on my forum (Each Refresh it runs) it runs and send's a Message (PM) To the user id 1 and title then message.. But the problem is I'm making it so users can send a Pm to somone while viewing a topic. sO Do I save that into a form.php then make a form and put action = form.php and fill out variables or something like that? If your kind can u tell me how. Thanks for reading... Quote Link to comment https://forums.phpfreaks.com/topic/157537-help-on-a-php-form/ Share on other sites More sharing options...
RussellReal Posted May 10, 2009 Share Posted May 10, 2009 you can probably use AJAX.. sorry I don'ty quite understand your question.. you alrdy have a function to send a PM, all u need to do is make a form and fill in the blanks? Quote Link to comment https://forums.phpfreaks.com/topic/157537-help-on-a-php-form/#findComment-830628 Share on other sites More sharing options...
Ken2k7 Posted May 10, 2009 Share Posted May 10, 2009 You can use AJAX, which can be easier if you know it because you don't have to worry about PHP codes, but you can do this without AJAX by just writing the form and put that line in when the form is submitted. Quote Link to comment https://forums.phpfreaks.com/topic/157537-help-on-a-php-form/#findComment-830632 Share on other sites More sharing options...
Monkuar Posted May 10, 2009 Author Share Posted May 10, 2009 Thanks for all the stuff you guys said too bad I dont know how to start anything.. I just need a basic form.. I would love to use ajax any help? I dont know anything about ajax nonetheless I know a little about php.. WOuld it work if i put that code in form.php and used it as a action = form.php in a form would it still work? with my defined variables?? Quote Link to comment https://forums.phpfreaks.com/topic/157537-help-on-a-php-form/#findComment-830638 Share on other sites More sharing options...
Ken2k7 Posted May 10, 2009 Share Posted May 10, 2009 You can't really ask someone to start something so simple as this. I would Google how to write a form. It's just basic HTML. Quote Link to comment https://forums.phpfreaks.com/topic/157537-help-on-a-php-form/#findComment-830660 Share on other sites More sharing options...
Monkuar Posted May 10, 2009 Author Share Posted May 10, 2009 You can't really ask someone to start something so simple as this. I would Google how to write a form. It's just basic HTML. Im confused if i can put that in form.php then how would i get variables form a form.php to get used in my forums.php lo so that they correspond.. Quote Link to comment https://forums.phpfreaks.com/topic/157537-help-on-a-php-form/#findComment-830698 Share on other sites More sharing options...
Ken2k7 Posted May 10, 2009 Share Posted May 10, 2009 Oh you use the action attribute of the form to pass the data in the form to forums.php. In forums.php, you can use $_POST to get the data. Quote Link to comment https://forums.phpfreaks.com/topic/157537-help-on-a-php-form/#findComment-830703 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.