create an HTML button that acts like a Link

This is quiet simple

Put it in a <form> wherein you specify the desired target URL in the action attribute.

<form action="http://google.com">
    <input type="submit" value="Go to Google">
</form>

 

here is another veriation but didn’t test it yet..

<a href="http://www.ajayadas.com/">
    <button>click me</button>
</a>

 

how to align – div – tag middle in wordpress

Like normal Html align=center wont work on wordpress so you have to use

<div id=”content”>

 

<div id="content"> is just the opening tag for the content div, which is the container in which all the content goes. The styling for it goes in the theme’s style.css stylesheet. For every opening div there needs to be a corresponding closing </div>, if the closing div is missing it would definitely cause display problems.

 

php-tips-insert-href-link-in-a-php-code

If the link needs to be inside of the PHP you have two options. Option one is to end the PHP and then reopen it. Here is an example:
<?php
—– My PHP Code—-
?>
<a href=”https://twitter.com/angela_bradley”>My Twitter</a>
<?php
—– My PHP Code—-
?>

The other option is to print or echo the HTML code inside of the PHP. Here is an example:
<?php
Echo “<a href=https://twitter.com/angela_bradley>My Twitter</a>”
?>

html-tip-using-quotes-in-form-input-tags

In (X)HTML, attribute values should be enclosed by double or single quotes. But a common source of errors and confusion arises when those values themselves contain double or single quotes. This is especially common for form input fields, where the values might contain data obtained from a database or supplied previously by the user.

Yes, using &quot; works:

<input type="text" name="last_name" value="&quot;My quote!&quot;" />


but another fix is using PhP - i found this with google search

Consider the case of an input text field for last name:

<input type=’text’ name=’last_name’ value=” />

Usually, attribute values are surrounded by double quotes, but single quotes are also allowed, and serve to highlight the pitfall here. Say that the value of the last name text field is taken from a database of users, and this particular user’s last name is “O’Reilly” – the PHP code will be:

<input type=’text’ name=’last_name’ value='<?php print $lastName; ?>’ />

And the HTML output will be:

<input type=’text’ name=’last_name’ value=’O’Reilly’ />

This will make the last name appear as just “0” in a browser, and will be sent as that when submitting the form. This is because the single quote in “O’Reilly” is taken as marking the end of the value. What we want is to encode the quote character so that HTML understands what we mean is the literal character for a single quote. The encoded version of a single quote is “&#39;”. The encoding can be done in a number of ways. For example, we can use the function str_replace() to replace all occurrences of “‘” with “&#39;”. But the most convenient and complete way is to use thehtmlentities() function on the $lastName variable, as in the following PHP code:

<input type=’text’ name=’last_name’ value='<?php print htmlentities($lastName, ENT_QUOTES); ?>’ />

Which will output:

<input type=’text’ name=’last_name’ value=’O&#39;Reilly’ />

Although “O’Reilly” is now not in its literal form in the HTML code, it will be displayed and sent properly from a form on an HTML page as seen in a browser.



How Do I Parse HTML Pages As PHP?

You can tell apache to treat your .html pages as .php pages by adding the following line of code to your .htaccess file:

AddHandler application/x-httpd-php5 .php .htm .html 

The above code will parse your .html pages using php5, if you would like to use php4 instead, please use the line of code below:

AddHandler application/x-httpd-php4 .php .htm .html 

WP Twitter Auto Publish Powered By : XYZScripts.com