| | |
is it possible to submit a page without using a form
![]() |
I think so...
You make onSubmit() in your submit button...
or
You can use an onclick and use the form.submit() function though.
This is for checking submit button is working or not..
if(@$_POST['Submit'])
{
or
or
try using header("location:abc.php?username=xyz");
You have to make your header() calls before your script outputs anything.
Thanks
Shanti..
You make onSubmit() in your submit button...
or
You can use an onclick and use the form.submit() function though.
This is for checking submit button is working or not..
if(@$_POST['Submit'])
{
or
or
try using header("location:abc.php?username=xyz");
You have to make your header() calls before your script outputs anything.
Thanks
Shanti..
There are two ways that I know of and that is ajax with javascript and Curl with PHP.
Ajax has recently gotten a lot of attention and here is some sample code:
Ajax object
do not modify)
Ajax post function
do not modify)
Your event function
modify to fit your needs)
Ajax has recently gotten a lot of attention and here is some sample code:
Ajax object
do not modify) javascript Syntax (Toggle Plain Text)
//the ajax object for all ajax functions function ajaxObject() { var objectsuccess = true; var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { objectsuccess = false; } } } if(objectsuccess == false) { alert("Your browser does not support AJAX!"); return false; } else { return xmlHttp; } }
Ajax post function
do not modify) javascript Syntax (Toggle Plain Text)
/*postVars example variable1=value&variable2=value&variable3=value&variable4=value */ function triggerPost(postVars, url) { var xmlHttp = ajaxObject(); xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { return xmlHttp.responseText; } } xmlHttp.open("POST",url,true); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); xmlHttp.send(postVars); return xmlHttp; }
Your event function
modify to fit your needs) javascript Syntax (Toggle Plain Text)
function ajaxlogin() { //generate variables in query string format leaving out the innitial "?" var postVars = ""; //the script you want to post to ex. forms/submitform.php var url = ""; var xmlHttp = triggerPost(postVars, url); xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { var formOutPut = xmlHttp.responseText; //process the form response } } }
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
![]() |
Similar Threads
- Updated : Simple ASP.Net Login Page (ASP.NET)
- How to print a page from a form details??? (PHP)
- Help with asp form will not display contact information (ASP)
- transfer page (ASP.NET)
- Problems in Dynaform (Form Mail) URGENT HELP (PHP)
- Need help in design and javascript code for Dynamic form (JavaScript / DHTML / AJAX)
- VB6 submit button sends information to BBChat (Visual Basic 4 / 5 / 6)
- How to create a web page with scrolling menus to specific entries (HTML and CSS)
- Populating a fields on a form base on a selected item from a droplist. (PHP)
Other Threads in the PHP Forum
- Previous Thread: how to submit from an parent file to the iframe file
- Next Thread: How to send mails with attachment in php
Views: 1166 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for PHP
ajax apache array box broken buttons cakephp cart check checkbox class cms code combobox cookies css database date delete directory display download dropdown dropdownlist drupal dynamic echo email error file files folder form forms function functions header hosting href htaccess html image include insert ip java javascript joomla limit link login lookup loop mail menu methods mlm mod_rewrite multiple mysql order output parse password paypal php problem query radio random recursion regex remote rows script search select server session sessions sort source speed sql string table unicode update updates upload url user validation variable video web website wordpress xml zend






