Category: Scripts

Get current URL in PHP 0

Get current URL in PHP

Sometime, you need to get a current page URL that is shown in the browser address bar. Here is a small code to get the current url. $url = (!empty($_SERVER[‘HTTPS’])) ? “https://”.$_SERVER[‘SERVER_NAME’] .$_SERVER[‘REQUEST_URI’] :...

Change iframe url using javascript 0

Change iframe url using javascript

If you want to change the iframe url from the iframe window, you can use this small function to change the url of the iframe. <script type=”text/javascript”> $(document).ready(function() { $(‘#clickToClose’).click( function() { window.parent.frames[“myframe”].location.href=’frame.php’; return...

Add custom or extra fields on registration page in wordpress 0

Add custom or extra fields on registration page in wordpress

Open your theme’s function.php file and drag this PHP code in. <?php // This function shows the form fiend on registration page add_action(‘register_form’,’show_first_name_field’);   // This is a check to see if you want...

Adding custom user profile fields in wordpress 0

Adding custom user profile fields in wordpress

Open your theme’s “functions.php” file and this PHP code in your file. <?php add_action( ‘show_user_profile’, ‘show_extra_profile_fields’, 1 ); add_action( ‘edit_user_profile’, ‘show_extra_profile_fields’, 1 ); function show_extra_profile_fields( $user ) { ?> <h3><?php _e(‘Your Hotel Address’, ‘frontendprofile’);...

Calculate week in PHP 0

Calculate week in PHP

Use this script to calculate a week in PHP <?php $date = mktime(0, 0, 0, 01,27, 2011); $week = (int)date(‘W’, $date); ?>