How can I extract data from HTML withOUT GET or POST
Moderator: General Moderators
How can I extract data from HTML withOUT GET or POST
Hi,
I have noticed that the Vanilla forum code contain a procedure to extract the html value as below:
<textarea name = "area" value = "'.$this->object->variable.'"/>
Is it possible to get the value using the value in html? I am able to extract the value using the name... Like $variable = $_GET['area']; But I do not need this way...
Anyone can help out?? Many thanks!
I have noticed that the Vanilla forum code contain a procedure to extract the html value as below:
<textarea name = "area" value = "'.$this->object->variable.'"/>
Is it possible to get the value using the value in html? I am able to extract the value using the name... Like $variable = $_GET['area']; But I do not need this way...
Anyone can help out?? Many thanks!
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: How can I extract data from HTML withOUT GET or POST
I have no idea. You're going to have to be much more specific about what you want.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: How can I extract data from HTML withOUT GET or POST
Thanks for all your replies, actually what I mean is what I noticed in Vanilla Forum Code, Please see below how they are taking the value from html to PHP, can you please clarify how can we perform this? I tried but it did not work, I checked all the code of Vainlla forum and I never found $_GET, $_POST or similarities! Below is the form for getting password.
Please see the colored syntax below, they are retreiving data from html just by assigning the value in html tag to their PHP variables!
--- PHP starts
// Note: This file is included from the library/Vanilla/Vanilla.Control.PasswordForm.php class.
if ($this->Context->Session->UserID != $this->User->UserID && !$this->Context->Session->User->Permission('PERMISSION_EDIT_USERS')) {
$this->Context->WarningCollector->Add($this->Context->GetDefinition('PermissionError'));
echo '<div id="Form" class="Account Password">
'.$this->Get_Warnings().'
</div>';
} else {
$this->PostBackParams->Set('PostBackAction', 'ProcessPassword');
$this->PostBackParams->Set('u', $this->User->UserID);
$Required = $this->Context->GetDefinition('Required');
echo '<div id="Form" class="Account Password">
<fieldset>
<legend>'.$this->Context->GetDefinition('ChangeYourPassword').'</legend>';
$this->CallDelegate('PreWarningsRender');
echo $this->Get_Warnings()
.$this->Get_PostBackForm('frmAccountPassword');
$this->CallDelegate('PreInputsRender');
echo '<ul>
<li>
<label for="txtOldPassword">'.$this->Context->GetDefinition('YourOldPassword').' <small>'.$Required.'</small></label>
<input type="password" name="OldPassword" value="'.$this->User->OldPassword.'" maxlength="100" class="SmallInput" id="txtOldPassword" />
<p class="Description">'.$this->Context->GetDefinition('YourOldPasswordNotes').'</p>
</li>
<li>
<label for="txtNewPassword">'.$this->Context->GetDefinition('YourNewPassword').' <small>'.$Required.'</small></label>
<input type="password" name="NewPassword" value="'.$this->User->NewPassword.'" maxlength="100" class="SmallInput" id="txtNewPassword" />
<p class="Description">'.$this->Context->GetDefinition('YourNewPasswordNotes').'</p>
</li>
<li>
<label for="txtConfirmPassword">'.$this->Context->GetDefinition('YourNewPasswordAgain').' <small>'.$Required.'</small></label>
<input type="password" name="ConfirmPassword" value="'.$this->User->ConfirmPassword.'" maxlength="100" class="SmallInput" id="txtConfirmPassword" />
<p class="Description">'.$this->Context->GetDefinition('YourNewPasswordAgainNotes').'</p>
</li>
</ul>';
$this->CallDelegate('PreButtonsRender');
echo '<div class="Submit">
<input type="submit" name="btnSave" value="'.$this->Context->GetDefinition('Save').'" class="Button SubmitButton" />
<a href="'.GetUrl($this->Context->Configuration, "account.php", "", "u", $this->User->UserID).'" class="CancelButton">'.$this->Context->GetDefinition('Cancel').'</a>
</div>
</form>
</fieldset>
</div>';
}
---PHP ends
Please see the colored syntax below, they are retreiving data from html just by assigning the value in html tag to their PHP variables!
--- PHP starts
// Note: This file is included from the library/Vanilla/Vanilla.Control.PasswordForm.php class.
if ($this->Context->Session->UserID != $this->User->UserID && !$this->Context->Session->User->Permission('PERMISSION_EDIT_USERS')) {
$this->Context->WarningCollector->Add($this->Context->GetDefinition('PermissionError'));
echo '<div id="Form" class="Account Password">
'.$this->Get_Warnings().'
</div>';
} else {
$this->PostBackParams->Set('PostBackAction', 'ProcessPassword');
$this->PostBackParams->Set('u', $this->User->UserID);
$Required = $this->Context->GetDefinition('Required');
echo '<div id="Form" class="Account Password">
<fieldset>
<legend>'.$this->Context->GetDefinition('ChangeYourPassword').'</legend>';
$this->CallDelegate('PreWarningsRender');
echo $this->Get_Warnings()
.$this->Get_PostBackForm('frmAccountPassword');
$this->CallDelegate('PreInputsRender');
echo '<ul>
<li>
<label for="txtOldPassword">'.$this->Context->GetDefinition('YourOldPassword').' <small>'.$Required.'</small></label>
<input type="password" name="OldPassword" value="'.$this->User->OldPassword.'" maxlength="100" class="SmallInput" id="txtOldPassword" />
<p class="Description">'.$this->Context->GetDefinition('YourOldPasswordNotes').'</p>
</li>
<li>
<label for="txtNewPassword">'.$this->Context->GetDefinition('YourNewPassword').' <small>'.$Required.'</small></label>
<input type="password" name="NewPassword" value="'.$this->User->NewPassword.'" maxlength="100" class="SmallInput" id="txtNewPassword" />
<p class="Description">'.$this->Context->GetDefinition('YourNewPasswordNotes').'</p>
</li>
<li>
<label for="txtConfirmPassword">'.$this->Context->GetDefinition('YourNewPasswordAgain').' <small>'.$Required.'</small></label>
<input type="password" name="ConfirmPassword" value="'.$this->User->ConfirmPassword.'" maxlength="100" class="SmallInput" id="txtConfirmPassword" />
<p class="Description">'.$this->Context->GetDefinition('YourNewPasswordAgainNotes').'</p>
</li>
</ul>';
$this->CallDelegate('PreButtonsRender');
echo '<div class="Submit">
<input type="submit" name="btnSave" value="'.$this->Context->GetDefinition('Save').'" class="Button SubmitButton" />
<a href="'.GetUrl($this->Context->Configuration, "account.php", "", "u", $this->User->UserID).'" class="CancelButton">'.$this->Context->GetDefinition('Cancel').'</a>
</div>
</form>
</fieldset>
</div>';
}
---PHP ends
Re: How can I extract data from HTML withOUT GET or POST
I did not get you!! Please explain!oggame wrote:php rounded corners
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: How can I extract data from HTML withOUT GET or POST
I'm not familiar with vanilla, but somewhere before this file they are instantiating an object and assigning the $_POST variables to it. If you like this style I would suggest you try the CakePHP framework.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: How can I extract data from HTML withOUT GET or POST
Thank you very much for your reply, I am reading about cakePHP, do you advise me go through it? What other frameworks you think they are good?AbraCadaver wrote:I'm not familiar with vanilla, but somewhere before this file they are instantiating an object and assigning the $_POST variables to it. If you like this style I would suggest you try the CakePHP framework.
Can you hint me how to find the $_POST in vanilla? I tried and I lost my eyes and could not find honestly!!
Thanks once again!
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: How can I extract data from HTML withOUT GET or POST
There are several good frameworks and everyone has their preference. I like Cake.Moderns1 wrote:Thank you very much for your reply, I am reading about cakePHP, do you advise me go through it? What other frameworks you think they are good?AbraCadaver wrote:I'm not familiar with vanilla, but somewhere before this file they are instantiating an object and assigning the $_POST variables to it. If you like this style I would suggest you try the CakePHP framework.
Can you hint me how to find the $_POST in vanilla? I tried and I lost my eyes and could not find honestly!!
Thanks once again!
You can search within the files for $_POST using the windows search or grep the entire dir in linux.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: How can I extract data from HTML withOUT GET or POST
Thanks a lot, please can you advise me how to search using the windows? You know windows provides me searching for files, not for words inside files... Your hints are really appreciatedAbraCadaver wrote:There are several good frameworks and everyone has their preference. I like Cake.Moderns1 wrote:Thank you very much for your reply, I am reading about cakePHP, do you advise me go through it? What other frameworks you think they are good?AbraCadaver wrote:I'm not familiar with vanilla, but somewhere before this file they are instantiating an object and assigning the $_POST variables to it. If you like this style I would suggest you try the CakePHP framework.
Can you hint me how to find the $_POST in vanilla? I tried and I lost my eyes and could not find honestly!!
Thanks once again!
You can search within the files for $_POST using the windows search or grep the entire dir in linux.
Re: How can I extract data from HTML withOUT GET or POST
Hi All,
I have used Grep to search for keyword in whole vainlla forum code.
I searched about $_GET, $_POST, $_REQUEST but I did NOT find any!! I searched on both letter cases...
Any other functions to retrieve data from HTML??
I have used Grep to search for keyword in whole vainlla forum code.
I searched about $_GET, $_POST, $_REQUEST but I did NOT find any!! I searched on both letter cases...
Any other functions to retrieve data from HTML??
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: How can I extract data from HTML withOUT GET or POST
Because I was curious:Moderns1 wrote:Hi All,
I have used Grep to search for keyword in whole vainlla forum code.
I searched about $_GET, $_POST, $_REQUEST but I did NOT find any!! I searched on both letter cases...
Any other functions to retrieve data from HTML??
Code: Select all
$ grep -r \$_POST vanilla-1.1.10/*
vanilla-1.1.10/library/Framework/Framework.Class.ConfigurationManager.php: if (isset($_POST[$Name])) {
vanilla-1.1.10/library/Framework/Framework.Functions.php: $aReturn = ForceSet(@$_POST[$VariableName], $DefaultValue);
vanilla-1.1.10/library/Framework/Framework.Functions.php: $bReturn = ForceSet(@$_POST[$VariableName], $DefaultBool);
vanilla-1.1.10/library/Framework/Framework.Functions.php: $iReturn = ForceSet(@$_POST[$VariableName], $DefaultValue);
vanilla-1.1.10/library/Framework/Framework.Functions.php: } elseif (isset($_POST[$VariableName])) {
vanilla-1.1.10/library/Framework/Framework.Functions.php: return Strip_Slashes(ForceString($_POST[$VariableName], $DefaultValue));
$ grep -r \$_GET vanilla-1.1.10/*
vanilla-1.1.10/library/Framework/Framework.Class.PageList.php: $this->QueryStringParams->DefineCollection($_GET);
vanilla-1.1.10/library/Framework/Framework.Functions.php: $aReturn = ForceSet(@$_GET[$VariableName], $DefaultValue);
vanilla-1.1.10/library/Framework/Framework.Functions.php: $bReturn = ForceSet(@$_GET[$VariableName], $DefaultBool);
vanilla-1.1.10/library/Framework/Framework.Functions.php: $iReturn = ForceSet(@$_GET[$VariableName], $DefaultValue);
vanilla-1.1.10/library/Framework/Framework.Functions.php: if (isset($_GET[$VariableName])) {
vanilla-1.1.10/library/Framework/Framework.Functions.php: return Strip_Slashes(ForceString($_GET[$VariableName], $DefaultValue));
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: How can I extract data from HTML withOUT GET or POST
Man! I really do not know how to thank you!AbraCadaver wrote:Because I was curious:Moderns1 wrote:Hi All,
I have used Grep to search for keyword in whole vainlla forum code.
I searched about $_GET, $_POST, $_REQUEST but I did NOT find any!! I searched on both letter cases...
Any other functions to retrieve data from HTML??
Code: Select all
$ grep -r \$_POST vanilla-1.1.10/* vanilla-1.1.10/library/Framework/Framework.Class.ConfigurationManager.php: if (isset($_POST[$Name])) { vanilla-1.1.10/library/Framework/Framework.Functions.php: $aReturn = ForceSet(@$_POST[$VariableName], $DefaultValue); vanilla-1.1.10/library/Framework/Framework.Functions.php: $bReturn = ForceSet(@$_POST[$VariableName], $DefaultBool); vanilla-1.1.10/library/Framework/Framework.Functions.php: $iReturn = ForceSet(@$_POST[$VariableName], $DefaultValue); vanilla-1.1.10/library/Framework/Framework.Functions.php: } elseif (isset($_POST[$VariableName])) { vanilla-1.1.10/library/Framework/Framework.Functions.php: return Strip_Slashes(ForceString($_POST[$VariableName], $DefaultValue)); $ grep -r \$_GET vanilla-1.1.10/* vanilla-1.1.10/library/Framework/Framework.Class.PageList.php: $this->QueryStringParams->DefineCollection($_GET); vanilla-1.1.10/library/Framework/Framework.Functions.php: $aReturn = ForceSet(@$_GET[$VariableName], $DefaultValue); vanilla-1.1.10/library/Framework/Framework.Functions.php: $bReturn = ForceSet(@$_GET[$VariableName], $DefaultBool); vanilla-1.1.10/library/Framework/Framework.Functions.php: $iReturn = ForceSet(@$_GET[$VariableName], $DefaultValue); vanilla-1.1.10/library/Framework/Framework.Functions.php: if (isset($_GET[$VariableName])) { vanilla-1.1.10/library/Framework/Framework.Functions.php: return Strip_Slashes(ForceString($_GET[$VariableName], $DefaultValue));
Honestly speaking! I am using Grep 2.3 for windows and really I searched for $_POST more than one time and I did not find it!! I do not have paint to make screen shot and show you! :S
Thanks a lot for your hard efforts.