This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
login_page.php | |
<form action="verify.php" method="post"> | |
User Name:<br> | |
<input type="text" name="username"><br><br> | |
Password:<br> | |
<input type="password" name="password"><br><br> | |
<input type="submit" name="submit" value="Login"> | |
</form> | |
verify.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(isset($_POST['submit'])){ | |
# connect to the database here | |
# search the database to see if the user name has been taken or not | |
$query = sprintf("SELECT * FROM users WHERE user_name='%s' LIMIT 1",mysql_real_escape_string($_POST['user_name'])); | |
$sql = mysql_query($query); | |
$row = mysql_fetch_array($sql); | |
#check too see what fields have been left empty, and if the passwords match | |
if($row||empty($_POST['user_name'])|| empty($_POST['fname'])||empty($_POST['lname'])|| empty($_POST['email'])||empty($_POST['password'])|| empty($_POST['re_password'])||$_POST['password']!=$_POST['re_password']){ | |
# if a field is empty, or the passwords don't match make a message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
if (isset($_REQUEST["id"]) && ($_REQUEST["id"]<>"")) { | |
$data1=mysql_query("SELECT * FROM your_table WHERE id=".$_REQUEST["id"]); | |
$data=mysql_fetch_array($data1); | |
$from =mymail@mydomain.com; | |
$to = $data["email_field"]; | |
$user = $data["name_field"]; | |
$subject = "Enter your subject line here"; /*or if it comes from the table*/ $subject = $data["subject_field"]; | |
$header="From:" . $from . "\r\n " ."Reply-To:". $from ; | |
$body="Hello ". $user .",\n\nFirst line\n\nYour message goes here, \nbest regards,\nyour_name and such\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
if ($_REQUEST['action']=="add"){ | |
$userfile = $HTTP_POST_FILES['photo']['tmp_name']; | |
$userfile_name = $HTTP_POST_FILES['photo']['name']; | |
$userfile_size = $HTTP_POST_FILES['photo']['size']; | |
$userfile_type = $HTTP_POST_FILES['photo']['type']; | |
///////////////////////// | |
//GET-DECLARE DIMENSIONS // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:-webkit-input-placeholder { | |
font-size: 12px; | |
font-style: italic; | |
color: #CCC; | |
} | |
:-moz-placeholder { | |
font-size: 12px; | |
font-style: italic; | |
color: #CCC; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'the_password_form', 'custom_password_form' ); | |
function custom_password_form() { | |
global $post; | |
$label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID ); | |
$o = '<form class="protected-post-form" action="' . get_option('siteurl') . '/wp-pass.php" method="post"> | |
' . __( "This post is password protected. To view it please enter your password below:" ) . ' | |
<label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" /> | |
</form> | |
'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load up the theme options. Put this line in your functions.php file | |
require_once ( get_template_directory() . '/theme-options.php' ); | |
<?php | |
add_action( 'admin_init', 'theme_options_init' ); | |
add_action( 'admin_menu', 'theme_options_add_page' ); | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fb_add_custom_user_profile_fields( $user ) { | |
?> | |
<h3><?php _e('Extra Profile Information', 'your_textdomain'); ?></h3> | |
<table class="form-table"> | |
<tr> | |
<th> | |
<label for="address"><?php _e('Address', 'your_textdomain'); ?> | |
</label></th> | |
<td> | |
<input type="text" name="address" id="address" value="<?php echo esc_attr( get_the_author_meta( 'address', $user->ID ) ); ?>" class="regular-text" /><br /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* =WordPress Core | |
-------------------------------------------------------------- */ | |
.alignnone { | |
margin: 5px 20px 20px 0; | |
} | |
.aligncenter, div.aligncenter { | |
display:block; | |
margin: 5px auto 5px auto; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE `wp_users` SET `user_pass` = MD5( 'new_password_here' ) WHERE `wp_users`.`user_login` = "admin_username"; |