Page 1 of 1

How can I extract data from HTML withOUT GET or POST

Posted: Mon Mar 08, 2010 3:18 pm
by Moderns1
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!

Re: How can I extract data from HTML withOUT GET or POST

Posted: Mon Mar 08, 2010 4:43 pm
by AbraCadaver
I have no idea. You're going to have to be much more specific about what you want.

Re: How can I extract data from HTML withOUT GET or POST

Posted: Tue Mar 09, 2010 12:20 am
by Moderns1
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

Re: How can I extract data from HTML withOUT GET or POST

Posted: Tue Mar 09, 2010 3:53 am
by oggame

Re: How can I extract data from HTML withOUT GET or POST

Posted: Tue Mar 09, 2010 5:03 am
by Moderns1
oggame wrote:php rounded corners
I did not get you!! Please explain!

Re: How can I extract data from HTML withOUT GET or POST

Posted: Tue Mar 09, 2010 7:34 am
by AbraCadaver
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.

Re: How can I extract data from HTML withOUT GET or POST

Posted: Tue Mar 09, 2010 7:40 am
by Moderns1
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.
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?

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!

Re: How can I extract data from HTML withOUT GET or POST

Posted: Tue Mar 09, 2010 10:05 am
by AbraCadaver
Moderns1 wrote:
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.
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?

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!
There are several good frameworks and everyone has their preference. I like Cake.

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

Posted: Tue Mar 09, 2010 10:21 am
by Moderns1
AbraCadaver wrote:
Moderns1 wrote:
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.
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?

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!
There are several good frameworks and everyone has their preference. I like Cake.

You can search within the files for $_POST using the windows search or grep the entire dir in linux.
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 appreciated :):)

Re: How can I extract data from HTML withOUT GET or POST

Posted: Tue Mar 09, 2010 1:08 pm
by Moderns1
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??

Re: How can I extract data from HTML withOUT GET or POST

Posted: Tue Mar 09, 2010 2:01 pm
by AbraCadaver
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??
Because I was curious:

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));
 

Re: How can I extract data from HTML withOUT GET or POST

Posted: Tue Mar 09, 2010 2:12 pm
by Moderns1
AbraCadaver wrote:
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??
Because I was curious:

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));
 
Man! I really do not know how to thank you!

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.