Ancient Temple City

2019

There are 2 methods to send HTML form data from 1 Page to another or HTML page to server side in PHP.

POST
It is a method in which data gets sent using packet which is not visible to any user on web-browser. it is secured compared to GET method.

GET
It is a method in which data gets sent with URL which is visible to user in address-bar of any web-browser. So, it’s not secure as POST method.


Now, There are total three methods to catch this data in PHP.

POST: It can catch the data which is sent using POST method.
GET: It can catch the data which is sent using GET method.
REQUEST: It can catch the data which is sent using both POST & GET methods.

Use the following code to check the sent status of php mail function.


<?php
$to = "xyz@somedomain.com";
$subject = "This is subject";

$message = "This is HTML message.";
$message .= "This is headline.";

$header = "From:abc@somedomain.com \r\n";
$header .= "Cc:afgh@somedomain.com \r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html\r\n";

$retval = mail ($to,$subject,$message,$header);

if( $retval == true ) {
echo "Message sent successfully...";
}else {
echo "Message could not be sent...";
}

?>

Question:

What would be a good way to convert hex color values like #ffffff into the single RGB values 255 255 255 using PHP?


Solution:

Example 1:
Check out PHP's hexdec() and dechex() functions.

<?php
$value = hexdec('ff'); // $value = 255
?>


Example 2:
If you want to convert hex to rgb you can use sscanf.

<?php
$hex = "#ff9900";
list($r, $g, $b) = sscanf($hex, "#%02x%02x%02x");
echo "$hex -> $r $g $b"; // #ff9900 -> 255 153 0
?>

The label itself may be positioned before, after or around the associated control.

Example 1:

<label for="lastname">Last Name</label>
<input type="text" id="lastname" />


Example 2:

<input type="text" id="lastname" />
<label for="lastname">Last Name</label>


Example 3:

<label>
   <input type="text" name="lastname" />
   Last Name
</label>


Note that the third technique cannot be used when a table is being used for layout, with the label in one cell and its associated form field in another cell.

Either one is valid. I like to use either the first or second example, as it gives you more style control.

Have a look at $_SERVER['REQUEST_URI'], i.e.

$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
(Note that the double quoted string syntax is perfectly correct)

If you want to support both HTTP and HTTPS, you can use

$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";

Editor’s note: using this code has security implications. The client can set HTTP_HOST and REQUEST_URI to any arbitrary value it wants.

MKRdezign

{facebook#http://www.facebook.com/GTVCreations} {twitter#http://www.twitter.com/GTVCreations} {google-plus#http://www.google.com} {pinterest#http://www.pinterest.com} {youtube#http://www.youtube.com} {instagram#http://www.instagram.com}

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget