Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
Share
LinkBack Thread Tools
Old 09-24-2012, 02:42 PM   #1
TNT
 
otfromtot's Avatar
 
Join Date: Sep 2012
Location: florida
Posts: 20
Thanks: 16
Thanked 0 Times in 0 Posts
Tip Form posting to multiple locations

Trying to get this form to post to my db with process.php and to another website using POST. Right now it will only load the second f.action. If I remove the first f.submit() it only does the first f.action. Any idea on getting this to work?


<script type="text/javascript">
<!--
function newWin(f)
{

f.target="_blank";
f.action="process.php?mobile_no=";
f.submit()
f.target="_blank";
f.actuon="secondsite"
f.submit();
return true;



}
//-->
</script>



</head>

<body>


<div data-role="page" id="page">


<form method="POST" action="secondsite" onsubmit="newWin(this)">



<div data-role="content">




<center>
<p><input type="text" id="mobile_no" name="mobile_no" placeholder="Phone Number"></p>


</center>
<p><input type="submit" value="Submit"></p>


</div>



</form>


</div>
otfromtot is offline   Reply With Quote
Old 09-24-2012, 02:49 PM   #2
HyperActive Warrior
War Room Member
 
dwoods's Avatar
 
Join Date: Sep 2012
Location: Ohio, USA
Posts: 140
Thanks: 8
Thanked 35 Times in 31 Posts
Contact Info
Send a message via Skype™ to dwoods
Default Re: Form posting to multiple locations

Use ajax to push the data into your own local database, and let the form submit as normal.

Need a way to drive traffic to your new site?
-- Check out HelpMyHits.com!
dwoods is offline   Reply With Quote
Old 09-24-2012, 06:44 PM   #3
Digital Carpenter
War Room Member
 
FirstSocialApps's Avatar
 
Join Date: Aug 2012
Location: Pennsylvania
Posts: 923
Thanks: 187
Thanked 229 Times in 189 Posts
Social Networking View Member's FaceBook Profile 
Default Re: Form posting to multiple locations

do it with JQUERY $.POST() .. easy.

FirstSocialApps is offline   Reply With Quote
Old 09-25-2012, 12:15 AM   #4
Active Warrior
 
Join Date: Mar 2012
Posts: 38
Thanks: 0
Thanked 4 Times in 4 Posts
Default Re: Form posting to multiple locations

By using Ajax, you can do it, just get the mobile_no value using document. getElementById("mobile_no") .value. and using xmlHttp.open("GET",url,true); you can save in your database.
url will be contains ur file name with path.in that file u can get the value and save it.

eswariseo is offline   Reply With Quote
Old 09-25-2012, 12:27 AM   #5
HyperActive Warrior
War Room Member
 
ussher's Avatar
 
Join Date: Sep 2010
Location: Tokyo
Posts: 299
Thanks: 24
Thanked 40 Times in 39 Posts
Social Networking View Member's Twitter Profile 
Default Re: Form posting to multiple locations

Its not supposed to be possible to do that.

with javascript you will find you will have problems posting to/from the www. and non-www. version of the site because javascript considers THAT cross-domain.

better to re-think your plans.

Perhaps open a window on the other site with a unique identifier that tells that site that your site has new info for it, then transfer via xml or json the data that you want with the server that its going to reading the information instead of your server sending it.

ussher is offline   Reply With Quote
Old 09-25-2012, 02:03 AM   #6
eCommerce + mCommerce
War Room Member
 
SteveSRS's Avatar
 
Join Date: May 2012
Location: NL & Peru & USA
Posts: 345
Blog Entries: 2
Thanks: 25
Thanked 80 Times in 68 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile  View Member's YouTube Profile
Default Re: Form posting to multiple locations

you can use PHP.. when processing the $_POST array just first process it to your own database when you have done that make a CURL post to the other db. You don't even have to leave your url / page!

Public Beta Relased: 100% Free SRS Easy Android Root software launch. Mainly Samsung but also HTC, ZTE and more. 1-Click Android Root and Unroot!

[SOOOON]
My new -ALL FREE- Premium eBook website
SteveSRS is offline   Reply With Quote
Old 09-25-2012, 08:25 AM   #7
TNT
 
otfromtot's Avatar
 
Join Date: Sep 2012
Location: florida
Posts: 20
Thanks: 16
Thanked 0 Times in 0 Posts
Default Re: Form posting to multiple locations

Quote:
Originally Posted by FirstSocialApps View Post
do it with JQUERY $.POST() .. easy.
would that be like this?
$.post('process.php', function(data),'site2', function(data) { $('.result').html(data); });
or
$.post('process.php','site2' function(mobile_no) { $('.result').html(mobile_no); });
I'm not too familiar with jquery and have light work with ajax. Thanks for all the replies guys!
Oh, I forgot in the original post that I was also trying to have "site2" open either in _self or _blank and all I need for process.php is for it to submit

Or would I be able to add some type of forwarder into process.php?
<?
$mobile_no=$_POST['mobile_no'];

mysql_connect("localhost", "dbuser", "dbpass) or die(mysql_error());
mysql_select_db("dbname") or die(mysql_error());
mysql_query("INSERT INTO `data` VALUES ('$mobile_no')");
Print "Your information has been successfully added to the database.";

?>
otfromtot is offline   Reply With Quote
Old 09-26-2012, 04:25 PM   #8
TNT
 
otfromtot's Avatar
 
Join Date: Sep 2012
Location: florida
Posts: 20
Thanks: 16
Thanked 0 Times in 0 Posts
Default Re: Form posting to multiple locations

I managed to get it with this in my process.php file. and just had the form submit to it with the GET method.

<?php
$phone = $_GET['phone'];
header("Location: site?=&phone=$phone");
?>
<?
$phone=$_GET['phone'];

mysql_connect("localhost", "db_user", "db_pass) or die(mysql_error());
mysql_select_db("db_name") or die(mysql_error());
mysql_query("INSERT INTO `data` VALUES ('$phone')");
Print "Your information has been successfully added to the database.";

?>
otfromtot is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Bookmarks

Tags
form, locations, multiple, posting

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 03:58 AM.