Skip to content

WebPostPHP is a PHP library to build HTML form to send POST request.

License

Notifications You must be signed in to change notification settings

BaseMax/WebPostPHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Web Post PHP

WebPostPHP is a PHP library to build HTML form to send POST request.

Purpose of Web Post PHP

Usually POST Requests are better then GET.

Easily convert <a href="index.php?name=adam&city=Berlin&Age=30">Click</a> as GET request to POST request.

Using Web Post PHP

<?php
$WebPost=new WebPostPHP();

$WebPost->add("index.php?name=adam&city=Berlin&Age=30", "Click");

$WebPost->add("index.php", "name=adam&city=Berlin&Age=30", "Click here");

$values=[
  "name"=>"adam",
  "city"=>"Berlin",
  "Age"=>30,
];
$WebPost->add("index.php", $values, "Click here");
?>

HTML Output

<form method="POST" action="index.php" id="web-post-php-1">
<input type="hidden" name="name" value="adam">
<input type="hidden" name="city" value="Berlin">
<input type="hidden" name="Age" value="30">
<button style="background:transparent;border:0px;">Click</button>
</form>

<form method="POST" action="index.php" id="web-post-php-2">
<input type="hidden" name="name" value="adam">
<input type="hidden" name="city" value="Berlin">
<input type="hidden" name="Age" value="30">
<button style="background:transparent;border:0px;">Click here</button>
</form>

<form method="POST" action="index.php" id="web-post-php-3">
<input type="hidden" name="name" value="adam">
<input type="hidden" name="city" value="Berlin">
<input type="hidden" name="Age" value="30">
<button style="background:transparent;border:0px;">Click here</button>
</form>

Max Base

My nickname is Max, Programming language developer, Full-stack programmer. I love computer scientists, researchers, and compilers. (Max Base)

Asrez Team

A team includes some programmer, developer, designer, researcher(s) especially Max Base.

Asrez Team

Releases

No releases published

Packages

No packages published

Languages