function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
FastSnailFastSnail 

Issues with passing Field values from an <apex:form> to a PHP program

Hello everyone,
I have been struggling on this for 2 days. It looks simple and still I can not figured it out. Thanks in advance for your help.
I want to feed a PHP program from a VF page, and in particular from an <apex:form> / <apex:commandButton>
Thanks in advance for your help,
Jerome
The PHP program:
--------------------------
<?php
session_start();
$_SESSION['ndfsession']="";
?>
<html><head>
<title>nomdefamillephp</title>
</head>
<body>
<?php
$nomDeFamille =$_POST['PersonvNomDeFamille'];
?>
nomDeFamille is : <?php echo $nomDeFamille; ?>
</body>
</html>
------------------------------
My controller:
public with sharing class CCNPersonContExt {
Id id = ApexPages.currentPage().getParameters().get('id');
private Person__c Personv;
public Person__c getPersonM() {
if (Personv == null) { Personv = new Person__c() ;
personv = [SELECT Name, id, Nom_de_Famille__c FROM Person__c WHERE Id = :ApexPages.currentPage().getParameters().get('id') ]; }
return Personv;
}
public PageReference actionphp(){
PageReference actionphp = new PageReference('http://www.thehardyfamily.fr/ccnfrsb/php/nomdefamille.php');
return actionphp.setRedirect(true);
}
}
----------------------------
The VF page that works fine as long as the PHP is launched from a pure HTML form
<apex:page controller="CCNPersonContExt" sidebar="no" showHeader="no" id="CNbropersphp" >
<apex:outputField value="{!personM.Nom_De_famille__c}" id="of"/>
<form action="http://www.thehardyfamily.fr/ccnfrsb/php/nomdefamille.php" method="post" id="fmhtml">
<input name="PersonvNomDeFamille" value="{!personM.Nom_de_Famille__c}" type="hidden" id="ihhtml"/>
<input value="PHP" type="submit" id="suhtml" />
</form>
</apex:page>
------------------------------
The VP page that I would like to work but does not pass the value to the PHP priogram. What am I missing?
<apex:page controller="CCNPersonContExt" sidebar="no" showHeader="no" id="CNbropersphp" >
<apex:outputField value="{!personM.Nom_De_famille__c}" id="of"/>
<apex:form id="fm">
<input name="PersonvNomDeFamille" value="{!personM.Nom_de_Famille__c}" type="hidden" id="ihhtml"/>
<apex:commandButton action="{!actionphp}" value="PHP" id="btnphp" />
</apex:form>
</apex:page>
-------------------------------
Thanks again for your help.
Jerome

 

arizonaarizona
FastSnailFastSnail

Thank tou for the lead. I honestly have not yet looked at this. Let me dig further. Thank you again.