Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6640419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:40:12+00:00 2026-05-25T23:40:12+00:00

Hi I’m trying to migrate my HTML/PHP/JS/XML page into one php file. I was

  • 0

Hi I’m trying to migrate my HTML/PHP/JS/XML page into one php file. I was able to successfully make my application using the 4 files seperately but when i put them into one it seems my js and php are in conflict, also if there is a way i can make radio buttons set to no options by default, because I’m guessing that’s where the problem lies.

Hmm i already solved the problem regarding the radio buttons, anyway I’m trying to have them all on one page because I’m trying to mimic the output of a local program, i realized this one when i saw the output of my first attempt. so what I’m trying to do right now is after running the php code i want to put them in a div so they won’t fly all over the place. I already solved this part but my problem right now is when i select the next radio button in my options, the result of previous request is still there unless I click on my submit button. I’m guessing that it has something to do with the js I passed on the body of my html. attempting to fix the div issue in js however was ok but it only showed the div for a split second.

Here is my code:

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Globe2Smac</title>
  <link rel="stylesheet" href="css/mycss.css" type="text/css">
  <script src="js/hide.js" type="text/javascript"></script>
  </head>
  <body onLoad="">
  <h2>Globe to SMAC Function</h2>
          <form method="post" action="">
          <div>
          <ul style="list-style:none">
              <li><input id="smember" type ="radio" name ="option" value = "SmacMembers" onChange="SMmember()" checked/>SMAC MEMBERS</li>
              <li><input  id="sbalance"type ="radio" name ="option" value = "SmacBalance" onChange="SMbalance()" checked/>SMAC BALANCE QUERY</li>
              <li><input id="saward" type ="radio" name ="option" value = "SmacAward" onChange="SMaward()" checked/>SMAC AWARD</li>
              <li><input id="sredemption" type ="radio" name ="option" value = "SmacRedeem" onChange="SMredeem()" checked/>SMAC REDEMPTION</li>
          </ul>
              <div>Globe XML RPC Request:</div>
              <div id="smmember" class="div-border" style="display:none"><textarea id="areamember" name="gmember" value="Member" spellcheck="false">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
<methodCall>
<methodName>smac.members</methodName>
<params>
<param>
<value>
<string>
&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;globetosmac&amp;gt;
&amp;lt;functioncode&amp;gt;smac_members&amp;lt;/functioncode&amp;gt;
&amp;lt;cardnumber&amp;gt;8880999521960565&amp;lt;/cardnumber&amp;gt;
&amp;lt;transaction_id&amp;gt;12345678&amp;lt;/transaction_id&amp;gt;
&amp;lt;/globetosmac&amp;gt;
</string>
</value>
</param>
</params>
</methodCall></textarea></div>
              <div id="smbalancequery"class="div-border" style="display:none"><textarea id="areabalance" name="gbalance" value="Balance" spellcheck="false">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
<methodCall>
<methodName>smac.balance_query</methodName>
<params>
<param><value><string>
&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;globetosmac&amp;gt;
&amp;lt;functioncode&amp;gt;smac_balance_query&amp;lt;/functioncode&amp;gt;
&amp;lt;cardnumber&amp;gt;8880999521960565&amp;lt;/cardnumber&amp;gt;
&amp;lt;transaction_id&amp;gt;1441795&amp;lt;/transaction_id&amp;gt;
&amp;lt;birthday&amp;gt;01011900&amp;lt;/birthday&amp;gt;   
&amp;lt;transactiondatetime&amp;gt;2011-09-16 13:43:58&amp;lt;/transactiondatetime&amp;gt;
&amp;lt;/globetosmac&amp;gt;
</string></value></param>
</params>
</methodCall>
</textarea></div>
              <div id="smaward" class="div-border"style="display:none"><textarea id="areaward" name="gaward" value="Award" spellcheck="false">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
<methodCall>
<methodName>smac.award_points</methodName>
<params>
<param>
<value>
<string>
&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;globetosmac&amp;gt;
&amp;lt;functioncode&amp;gt;smac_award_points&amp;lt;/functioncode&amp;gt;
&amp;lt;cardnumber&amp;gt;8880999521060440&amp;lt;/cardnumber&amp;gt;
&amp;lt;transaction_id&amp;gt;1441795&amp;lt;/transaction_id&amp;gt;
&amp;lt;transaction_amount&amp;gt;100&amp;lt;/transaction_amount&amp;gt;
&amp;lt;transaction_code&amp;gt;OFLN-GLOBE&amp;lt;/transaction_code&amp;gt;
&amp;lt;transactiondatetime&amp;gt;2011-09-22 16:20:58&amp;lt;/transactiondatetime&amp;gt;
&amp;lt;/globetosmac&amp;gt;
</string>
</value>
</param>
</params>
</methodCall></textarea></div>
              <div id="smredemption" class="div-border"style="display:none"><textarea id="arearedeem" name="gredeem" value="Redeem" spellcheck="false">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
<methodCall>
<methodName>smac.redemption_points</methodName>
<params>
<param>
<value>
<string>
&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;globetosmac&amp;gt;
&amp;lt;functioncode&amp;gt;smac_redemption_points&amp;lt;/functioncode&amp;gt;
&amp;lt;cardnumber&amp;gt;8880999521060440&amp;lt;/cardnumber&amp;gt;
&amp;lt;transaction_id&amp;gt;1441795&amp;lt;/transaction_id&amp;gt;
&amp;lt;transaction_amount&amp;gt;10&amp;lt;/transaction_amount&amp;gt;
&amp;lt;transaction_code&amp;gt;OFLN-GLOBE&amp;lt;/transaction_code&amp;gt;
&amp;lt;transactiondatetime&amp;gt;20110921 16:20:58&amp;lt;/transactiondatetime&amp;gt;
&amp;lt;/globetosmac&amp;gt;
</string>
</value>
</param>
</params>
</methodCall></textarea></div>
<div id="submit"><input type="submit" name="Submit" value="Submit Query"></div>
<div>Globe XML Response:</div>
<div class="div-border"><?php
  if($_POST['option'] == "SmacMembers"){
  $member = $_POST['gmember'];
  $URL = 'https://localhost/globe2smac-fh3/api/';
  $ch = curl_init($URL);
  //curl_setopt($ch, CURLOPT_URL, "https://localhost/globe2smac-fh3/api");
  curl_setopt($ch, CURLOPT_MUTE, 1);
  curl_setopt($ch, CURLOPT_USERPWD, "michael:kel");
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/html'));
  curl_setopt($ch, CURLOPT_POSTFIELDS, $member);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 2);
  $MemResult = curl_exec($ch);
  curl_close($ch);
  }
  else if($_POST['option'] == "SmacBalance"){
  $balance= $_POST['gbalance'];
  echo $balance; 
  $URL = "https://localhost/globe2smac-fh3/api/";

  $ch = curl_init($URL);
  curl_setopt($ch, CURLOPT_MUTE, 1);
  curl_setopt($ch, CURLOPT_USERPWD, "michael:kel");
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
  curl_setopt($ch, CURLOPT_POSTFIELDS, "$balance");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $BalResult= curl_exec($ch);
  curl_close($ch);

  echo $output;

  }
  else if($_POST['option'] == "SmacAward"){
  $award=$_POST['gaward'];
  echo $award;
  $URL = "https://localhost/globe2smac-fh3/api/";

  $ch = curl_init($URL);
  curl_setopt($ch, CURLOPT_MUTE, 1);
  curl_setopt($ch, CURLOPT_USERPWD, "michael:kel");
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
  curl_setopt($ch, CURLOPT_POSTFIELDS, "$award");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $output = curl_exec($ch);
  curl_close($ch);

  echo $output;
  }
  else if($_POST['option'] == "SmacRedeem"){
  $redeem=$_POST['gredeem'];
  echo $redeem;
  $URL = "https://localhost/globe2smac-fh3/api/";

  $ch = curl_init($URL);
  curl_setopt($ch, CURLOPT_MUTE, 1);
  curl_setopt($ch, CURLOPT_USERPWD, "michael:kel");
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
  curl_setopt($ch, CURLOPT_POSTFIELDS, "$redeem");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $RedResult = curl_exec($ch);
  curl_close($ch);

  echo $output;
  }
  else{
  echo('Option not Found');
}
?></div>
              </div>
            </form>
      </body>
  </html>

re-updated my code to this:

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Globe2Smac</title>
  <link rel="stylesheet" href="css/mycss.css" type="text/css">
  <script src="js/hide.js" type="text/javascript"></script>
  </head>
  <body onLoad="siteLoad();">
  <h2>Globe to SMAC Function</h2>
          <form method="post" action="">
          <div>
          <ul style="list-style:none">
              <li><input id="smember" type ="radio" name ="option" value = "SmacMembers" onChange="SMmember()" />SMAC MEMBERS</li>
              <li><input  id="sbalance"type ="radio" name ="option" value = "SmacBalance" onChange="SMbalance()"/>SMAC BALANCE QUERY</li>
              <li><input id="saward" type ="radio" name ="option" value = "SmacAward" onChange="SMaward()"/>SMAC AWARD</li>
              <li><input id="sredemption" type ="radio" name ="option" value = "SmacRedeem" onChange="SMredeem()"/>SMAC REDEMPTION</li>
          </ul>
              <div>Globe XML RPC Request:</div>
              <div id="smmember" class="div-border" style="display:none"><textarea id="areamember" name="gmember" value="Member" spellcheck="false">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
<methodCall>
<methodName>smac.members</methodName>
<params>
<param>
<value>
<string>
&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;globetosmac&amp;gt;
&amp;lt;functioncode&amp;gt;smac_members&amp;lt;/functioncode&amp;gt;
&amp;lt;cardnumber&amp;gt;8880999521960565&amp;lt;/cardnumber&amp;gt;
&amp;lt;transaction_id&amp;gt;12345678&amp;lt;/transaction_id&amp;gt;
&amp;lt;/globetosmac&amp;gt;
</string>
</value>
</param>
</params>
</methodCall></textarea></div>
              <div id="smbalancequery"class="div-border" style="display:none"><textarea id="areabalance" name="gbalance" value="Balance" spellcheck="false">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
<methodCall>
<methodName>smac.balance_query</methodName>
<params>
<param><value><string>
&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;globetosmac&amp;gt;
&amp;lt;functioncode&amp;gt;smac_balance_query&amp;lt;/functioncode&amp;gt;
&amp;lt;cardnumber&amp;gt;8880999521960565&amp;lt;/cardnumber&amp;gt;
&amp;lt;transaction_id&amp;gt;1441795&amp;lt;/transaction_id&amp;gt;
&amp;lt;birthday&amp;gt;01011900&amp;lt;/birthday&amp;gt;   
&amp;lt;transactiondatetime&amp;gt;2011-09-16 13:43:58&amp;lt;/transactiondatetime&amp;gt;
&amp;lt;/globetosmac&amp;gt;
</string></value></param>
</params>
</methodCall>
</textarea></div>
              <div id="smaward" class="div-border"style="display:none"><textarea id="areaward" name="gaward" value="Award" spellcheck="false">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
<methodCall>
<methodName>smac.award_points</methodName>
<params>
<param>
<value>
<string>
&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;globetosmac&amp;gt;
&amp;lt;functioncode&amp;gt;smac_award_points&amp;lt;/functioncode&amp;gt;
&amp;lt;cardnumber&amp;gt;8880999521060440&amp;lt;/cardnumber&amp;gt;
&amp;lt;transaction_id&amp;gt;1441795&amp;lt;/transaction_id&amp;gt;
&amp;lt;transaction_amount&amp;gt;100&amp;lt;/transaction_amount&amp;gt;
&amp;lt;transaction_code&amp;gt;OFLN-GLOBE&amp;lt;/transaction_code&amp;gt;
&amp;lt;transactiondatetime&amp;gt;2011-09-22 16:20:58&amp;lt;/transactiondatetime&amp;gt;
&amp;lt;/globetosmac&amp;gt;
</string>
</value>
</param>
</params>
</methodCall></textarea></div>
              <div id="smredemption" class="div-border"style="display:none"><textarea id="arearedeem" name="gredeem" value="Redeem" spellcheck="false">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
<methodCall>
<methodName>smac.redemption_points</methodName>
<params>
<param>
<value>
<string>
&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;globetosmac&amp;gt;
&amp;lt;functioncode&amp;gt;smac_redemption_points&amp;lt;/functioncode&amp;gt;
&amp;lt;cardnumber&amp;gt;8880999521060440&amp;lt;/cardnumber&amp;gt;
&amp;lt;transaction_id&amp;gt;1441795&amp;lt;/transaction_id&amp;gt;
&amp;lt;transaction_amount&amp;gt;10&amp;lt;/transaction_amount&amp;gt;
&amp;lt;transaction_code&amp;gt;OFLN-GLOBE&amp;lt;/transaction_code&amp;gt;
&amp;lt;transactiondatetime&amp;gt;20110921 16:20:58&amp;lt;/transactiondatetime&amp;gt;
&amp;lt;/globetosmac&amp;gt;
</string>
</value>
</param>
</params>
</methodCall></textarea></div>
<div id="submit"><input type="submit" name="Submit" value="Submit XML Request"></div>
<div>Globe XML Response:</div>
<div class="div-border"><?php
  if($_POST['option'] == "SmacMembers"){
  $member = $_POST['gmember'];
  $URL = 'https://localhost/globe2smac-fh3/api/';
  $ch = curl_init($URL);
  //curl_setopt($ch, CURLOPT_URL, "https://localhost/globe2smac-fh3/api");
  curl_setopt($ch, CURLOPT_MUTE, 1);
  curl_setopt($ch, CURLOPT_USERPWD, "michael:kel");
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/html'));
  curl_setopt($ch, CURLOPT_POSTFIELDS, $member);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 2);
  $MemResult = curl_exec($ch);
  curl_close($ch);
  echo $MemResult;
  }
  else if($_POST['option'] == "SmacBalance"){
  $balance= $_POST['gbalance'];
  $URL = "https://localhost/globe2smac-fh3/api/";

  $ch = curl_init($URL);
  curl_setopt($ch, CURLOPT_MUTE, 1);
  curl_setopt($ch, CURLOPT_USERPWD, "michael:kel");
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
  curl_setopt($ch, CURLOPT_POSTFIELDS, "$balance");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $BalResult= curl_exec($ch);
  curl_close($ch);
  echo $BalResult;

  }
  else if($_POST['option'] == "SmacAward"){
  $award=$_POST['gaward'];
  echo $award;
  $URL = "https://localhost/globe2smac-fh3/api/";

  $ch = curl_init($URL);
  curl_setopt($ch, CURLOPT_MUTE, 1);
  curl_setopt($ch, CURLOPT_USERPWD, "michael:kel");
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
  curl_setopt($ch, CURLOPT_POSTFIELDS, "$award");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $Awresult= curl_exec($ch);
  curl_close($ch);

  echo $Awresult;
  }
  else if($_POST['option'] == "SmacRedeem"){
  $redeem=$_POST['gredeem'];
  echo $redeem;
  $URL = "https://localhost/globe2smac-fh3/api/";

  $ch = curl_init($URL);
  curl_setopt($ch, CURLOPT_MUTE, 1);
  curl_setopt($ch, CURLOPT_USERPWD, "michael:kel");
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
  curl_setopt($ch, CURLOPT_POSTFIELDS, "$redeem");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $RedResult = curl_exec($ch);
  curl_close($ch);

  echo $RedResult;
  }
  else{
  echo('Processing Requests...');
}
?></div>
              </div>
            </form>
      </body>
  </html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:40:13+00:00Added an answer on May 25, 2026 at 11:40 pm

    Well right now you have set all of your radio buttons to checked;

    <input type="radio" ... checked />
    

    First of all the right syntax is:

    <input type="radio" ... checked="checked" />
    

    Furthermore be sure only ONE radio button is checked (it’s in the nature of the radio button :)) or use checkboxes

    Just a question; why would you want to merge everything into one file? for maintainability most of the times separating your code is a pretty good idea!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm making a simple page using Google Maps API 3. My first. One marker
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.