PHP - Cool Things To Put On A Website Portfolio
I am trying to find a job doing PHP and MySQL. I have a portfolio section where I created a really simple Postcard application where visitors can send people they know online postcards via email after they click on confirmation link i send them using sha1() as token in a temp table that holds information.
I was also going to add a section where I show usage of Regular Expressions and things. Does anybody have any suggestions what other web apps or whatever I could add to this section to make my portfolio section really POP to potential employers? Any suggestions are welcome and much appreciated. Similar TutorialsI like the idea, good job fellas! I would like to create a portfolio for future reference and for potential employers. What's the best way to do this? Should I make individual pages with examples of different code or create a website which functions to demonstrate the code? Thanks So I was working on this site past month. I know it is too much time for such simple website, but I am a perfectionist and I need to have everything perfect. It is using JQuery, Twitter Bootstrap (I am deep fan of TWBS and I am using it on almost every website I make) and Yeti(?probably, I forgot ) theme from Bootswatch. Of course also FontAwesome for YT, FB, Twitter an GitHub icons. On smaller resolutions it is looking epic (1024x768 etc etc), on mobile devices too, but I am not sure how it looks on HD, HD-ready resolutions (yes, I can use zoom-out in my browser, but it is misleading...). What do you think?
P.S.: Projects in "My Recent Work" are clickable and that will toggle description with some fancy fade effect (using jQuery.toggle()).
P.S.2: I am not sure if I should vertically-center contact text or let it be with big top and bottom padding. What do you think?
P.S.3: Oh, I almost forgot. Website link is here http://deathbeam.github.io/. Yes, I am using GitHub pages, I love git. And nope, I do not bought my own domain yet.
P.S.4: I accept "brutal" criticizm, feel free to be rude
P.S.5: (this is starting to be annoying lol): If you guys have time, can you please tell me what feeling do you have from my subsite http://deathbeam.git...fwphp/index.htm. I tried to keep everything as simple as possible, but I am not sure if it is not too much :/
P.S.6: I am really sorry for my English...
Edited by deathbeam, 08 September 2014 - 01:08 PM. This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=345741.0 I had an interesting idea, but I don't know if it exsisted... Say for example if I had designed the CNN homepage, that clearly gets updated every few minutes with new news, if I wanted to show this in my portfolio as as example of a project I have designed, is there a way of creating a thumbnail or image of the site, which would be updated in real time to go along side the description? (I say real time, but I guess I mean every couple of hours or so) If anyone has seen anything like this or has any suggestions, let me know what you think! Hi guys I am busy with a website for myself and need some help on this, because I am stuck and not getting this right.
Can someone tell me where is a tutorial or where I can find a code to help me with this , I have attached a pictures on what I need and want. the second image is what need to happen when someone click on the image in the Portfolio
Below Is the html code for this Portfolio Gallery but need it to be like in a database where I can upload or add new work.
<!-- PORTFOLIO --> <div class="row portfolio-page"> <div class="hide" id="project-info"> <div id="content"> <i class="fa-times fa back"></i> <div class="row"> <div class="large-11 columns"> <h2 class="project-title">Super Design</h2> </div> <div class="large-6 columns"> <div class="project-images"> <div class="item-list"> <ul class=""> <li> <a href="#"> <img width="500" height="380" alt="13tndZF" class="attachment-project-thumb" src="assets/images/12.jpg"> </a> </li> </ul> </div> </div> </div> <div class="large-6 columns project-content"> <p>Donec pulvinar porttitor felis ac tincidunt. Quisque sit amet ligula quis lacus pellentesque luctus consequat aliquam neque. Nunc ac elit eu odio consequat rutrum. Suspendisse nec facilisis turpis. </p> <p>Proin egestas nisl in nibh condimentum, nec ornare erat egestas. Fusce dui est, gravida ut sem vitae, tincidunt pharetra massa. In erat libero, fermentum suscipit pretium vel, eleifend vitae odio. Nullam quis mi velit. Cras ut aliquet orci.</p> <p>Curabitur sollicitudin massa quis magna cursus, a auctor dolor imperdiet. Nullam ultrices pretium mauris, vel fermentum nisl venenatis ac. Aenean adipiscing lorem a purus viverra, eu</p> </div> </div> </div> </div> <ul class="small-block-grid-1 large-block-grid-3"> <li class="article portfolio-item" id="160"> <figure> <img width="500" height="380" src="assets/images/12.jpg" alt="13tndZF" /> <figcaption class="text-center"> <h3>Super Design</h3> </figcaption> </figure> <span class="plus-icon flipOutX"><i class="fa-plus fa"></i></span> </li> <li class="article portfolio-item" id="157"> <figure> <img width="500" height="380" src="assets/images/13.jpg" alt="1j5JfNg" /> <figcaption class="text-center"> <h3>Cool Project</h3> </figcaption> </figure> <span class="plus-icon flipOutX"><i class="fa-plus fa"></i></span> </li> <li class="article portfolio-item" id="153"> <figure> <img width="500" height="380" src="assets/images/14.jpg" alt="1m7ZhI3" /> <figcaption class="text-center"> <h3>New Project</h3> </figcaption> </figure> <span class="plus-icon flipOutX"><i class="fa-plus fa"></i></span> </li> <li class="article portfolio-item" id="94"> <figure> <img width="500" height="380" src="assets/images/15.jpg" alt="1a2n0Ck" /> <figcaption class="text-center"> <h3>Sed porttitor</h3> </figcaption> </figure> <span class="plus-icon flipOutX"><i class="fa-plus fa"></i></span> </li> <li class="article portfolio-item" id="79"> <figure> <img width="500" height="380" src="assets/images/16.jpg" alt="7714491824_ef36a096ff_b" /> <figcaption class="text-center"> <h3>Kid Play</h3> </figcaption> </figure> <span class="plus-icon flipOutX"><i class="fa-plus fa"></i></span> </li> <li class="article portfolio-item" id="73"> <figure> <img width="500" height="380" src="assets/images/17.jpg" alt="8364043731_9da828b5c7_h" /> <figcaption class="text-center"> <h3>Project Two</h3> </figcaption> </figure> <span class="plus-icon flipOutX"><i class="fa-plus fa"></i></span> </li> <li class="article portfolio-item" id="71"> <figure> <img width="500" height="380" src="assets/images/18.jpg" alt="almond-blossom-5378_1280" /> <figcaption class="text-center"> <h3>Project One</h3> </figcaption> </figure> <span class="plus-icon flipOutX"><i class="fa-plus fa"></i></span> </li> <li class="article portfolio-item" id="96"> <figure> <img width="500" height="380" src="assets/images/19.jpg" alt="Youthful learners" /> <figcaption class="text-center"> <h3>Etiam at commodo</h3> </figcaption> </figure> <span class="plus-icon flipOutX"><i class="fa-plus fa"></i></span> </li> <li class="article portfolio-item" id="14"> <figure> <img width="500" height="380" src="assets/images/20.jpg" alt="9862145525_c08b245398_h" /> <figcaption class="text-center"> <h3>Project 1</h3> </figcaption> </figure> <span class="plus-icon flipOutX"><i class="fa-plus fa"></i></span> </li> </ul> </div> <!-- END PORTFOLIO/> --> </div> </section> This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=319419.0 Hi, I've attempted to put together a portfolio on my WP blog using php, jquery, and this tutorial- http://wp.tutsplus.com/tutorials/theme-development/create-a-quicksand-portfolio-with-wordpress/ I've gone to my WP site and tried to put it together, but nothing seems to work. Aside from "what's wrong?" I'd also like to know how do I utilize these features to display my portfolio? (Simply post images in the page/post, set featured images, etc.) My apologies for this perhaps not being the easiest question, but thorough help and advice is greatly appreciated. If further information is needed, please let me know. functions.php <?php // portfolio include("portfolio/portfolio-post-types.php"); // Register our scripts function register_js() { if ( !is_admin() ) { wp_register_script( 'quicksand', get_template_directory_uri() . '/js/jquery.quicksand.js', 'jquery' ); wp_register_script( 'easing', get_template_directory_uri() . '/js/jquery.easing.1.3.js', 'jquery' ); wp_register_script( 'custom', get_template_directory_uri() . '/js/jquery.custom.js', 'jquery', '1.0', true ); wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'quicksand' ); wp_enqueue_script( 'easing' ); wp_enqueue_script( 'custom' ); } } add_action('init', 'register_js'); // Register our styles function register_css() { if (!is_admin()) { wp_register_style( 'prettyPhoto', get_template_directory_uri() . '/css/prettyPhoto.css' ); wp_enqueue_style( 'prettyPhoto' ); } } add_action( 'init', 'register_css' ); // sidebar functions if(function_exists('register_sidebar')) { register_sidebar(); } // add thumbnail support add_theme_support('post-thumbnails'); // disable autoformat with raw function my_formatter($content) { $new_content = ''; $pattern_full = '{(\[raw\].*?\[/raw\])}is'; $pattern_contents = '{\[raw\](.*?)\[/raw\]}is'; $pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE); foreach ($pieces as $piece) { if (preg_match($pattern_contents, $piece, $matches)) { $new_content .= $matches[1]; } else { $new_content .= wptexturize(wpautop($piece)); } } return $new_content; } remove_filter('the_content', 'wpautop'); remove_filter('the_content', 'wptexturize'); add_filter('the_content', 'my_formatter', 99); ?> portfolio.php <?php /* Template Name: Portfolio */ ?> <?php get_header(); ?> <!-- #content BEGIN --> <div id="content" class="clearfix"> <ul class="filterable-grid clearfix"> <?php $wpbp = new WP_Query(array( 'post_type' => 'portfolio', 'posts_per_page' =>'-1' ) ); ?> <?php if ($wpbp->have_posts()) : while ($wpbp->have_posts()) : $wpbp->the_post(); ?> <?php $terms = get_the_terms( get_the_ID(), 'filter' ); ?> <li data-id="id-<?php echo $count; ?>" data-type="<?php foreach ($terms as $term) { echo strtolower(preg_replace('/\s+/', '-', $term->name)). ' '; } ?>"> <?php if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) : ?> <?php the_post_thumbnail('portfolio'); ?> <?php endif; ?> <p><a href="<?php the_permalink(); ?>"><?php echo get_the_title(); ?></a></p> </li> <?php $count++; ?> <?php endwhile; endif; ?> <?php $large_image = wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()), 'fullsize', false, '' ); $large_image = $large_image[0]; ?> <?php wp_reset_query(); ?> </ul> </div><!-- #content END --> <?php get_sidebar(); ?> <?php get_footer(); ?> portfolio-post-types.php <?php // function: post_type BEGIN function post_type() { $labels = array( 'name' => __( 'Portfolio'), 'singular_name' => __('Portfolio'), 'rewrite' => array( 'slug' => __( 'portfolio' ) ), 'add_new' => _x('Add Item', 'portfolio'), 'edit_item' => __('Edit Portfolio Item'), 'new_item' => __('New Portfolio Item'), 'view_item' => __('View Portfolio'), 'search_items' => __('Search Portfolio'), 'not_found' => __('No Portfolio Items Found'), 'not_found_in_trash' => __('No Portfolio Items Found In Trash'), 'parent_item_colon' => '' ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => false, 'menu_position' => null, 'supports' => array( 'title', 'editor', 'thumbnail' ) ); register_post_type(__( 'portfolio' ), $args); } // function: post_type END // function: portfolio_messages BEGIN function portfolio_messages($messages) { $messages[__( 'portfolio' )] = array( 0 => '', 1 => sprintf(('Portfolio Updated. <a href="%s">View portfolio</a>'), esc_url(get_permalink($post_ID))), 2 => __('Custom Field Updated.'), 3 => __('Custom Field Deleted.'), 4 => __('Portfolio Updated.'), 5 => isset($_GET['revision']) ? sprintf( __('Portfolio Restored To Revision From %s'), wp_post_revision_title((int)$_GET['revision'], false)) : false, 6 => sprintf(__('Portfolio Published. <a href="%s">View Portfolio</a>'), esc_url(get_permalink($post_ID))), 7 => __('Portfolio Saved.'), 8 => sprintf(__('Portfolio Submitted. <a target="_blank" href="%s">Preview Portfolio</a>'), esc_url( add_query_arg('preview', 'true', get_permalink($post_ID)))), 9 => sprintf(__('Portfolio Scheduled For: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview Portfolio</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime($post->post_date)), esc_url(get_permalink($post_ID))), 10 => sprintf(__('Portfolio Draft Updated. <a target="_blank" href="%s">Preview Portfolio</a>'), esc_url( add_query_arg('preview', 'true', get_permalink($post_ID)))), ); return $messages; } // function: portfolio_messages END // function: portfolio_filter BEGIN function portfolio_filter() { register_taxonomy( __( "filter" ), array(__( "portfolio" )), array( "hierarchical" => true, "label" => __( "Filter" ), "singular_label" => __( "Filter" ), "rewrite" => array( 'slug' => 'filter', 'hierarchical' => true ) ) ); } // function: portfolio_filter END add_action( 'init', 'post_type' ); add_action( 'init', 'portfolio_filter', 0 ); add_filter( 'post_updated_messages', 'portfolio_messages' ); jquery.custom.js Code: [Select] function portfolio_quicksand() { // Setting up our variables var $filter; var $container; var $containerClone; var $filterLink; var $filteredItems // Set our filter $filter = $('.filter li.active a').attr('class'); // Set our filter link $filterLink = $('.filter li a'); // Set our container $container = $('ul.filterable-grid'); // Clone our container $containerClone = $container.clone(); // Apply our Quicksand to work on a click function // for each of the filter li link elements $filterLink.click(function(e) { // Remove the active class $('.filter li').removeClass('active'); // Split each of the filter elements and override our filter $filter = $(this).attr('class').split(' '); // Apply the 'active' class to the clicked link $(this).parent().addClass('active'); // If 'all' is selected, display all elements // else output all items referenced by the data-type if ($filter == 'all') { $filteredItems = $containerClone.find('li'); } else { $filteredItems = $containerClone.find('li[data-type~=' + $filter + ']'); } // Finally call the Quicksand function $container.quicksand($filteredItems, { // The duration for the animation duration: 750, // The easing effect when animating easing: 'easeInOutCirc', // Height adjustment set to dynamic adjustHeight: 'dynamic' }); }); $container.quicksand($filteredItems, function () { lightbox(); } ); } function lightbox() { jQuery("a[rel^='prettyPhoto']").prettyPhoto({ animationSpeed:'fast', slideshow:5000, theme:'pp_default', show_title:false, overlay_gallery: false, social_tools: false }); } if(jQuery().prettyPhoto) { lightbox(); } How can i make code which can do something when time is 00:00 ? Is that possible in php, and if not any suggestions? Ok If anyone read my recent topics they will know I am making a forum system This system for users is currently about 1/3 complete and I now have a couple of issues. Firstly: When a user logs in I am using $_SESSION['RAYTH_MEMBER_ID'] to save their member ID for when they return. However every time the browser/page is closed it doesn't save and then they are logged out. How would I set it so it keeps them logged in until they personally logout? Secondly: Since It's a forum you expect there to be new lines and stuff when you Read posts in threads (like we do here). How would I set it when a user posts it replaces every return character from the input (enter/newline etc) and replace it with <br> in the mysql database? Thanks for your help ok , here is my mysql code to get all posts from the posts table . Code: [Select] $query = mysql_query("SELECT id,to_id,from_id,post,type,state,date FROM posts WHERE state='0' ORDER BY id DESC LIMIT 50"); and here is the code to display the users friends... Code: [Select] $sqlArray = mysql_query("SELECT friend_array FROM myMembers WHERE id='" . $logOptions_id ."' LIMIT 1"); while($row=mysql_fetch_array($sqlArray)) { $iFriend_array = $row["friend_array"]; } $iFriend_array = explode(",", $iFriend_array); if (in_array($id, $iFriend_array))see now i got as far as , if(in_array($id, $iFriend_array)) How would i put these togeather to where it would get the posts from the posts table that there friends posted? This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=328221.0 By not using the order by function in SQL. Like I have $match_1 and $segment_1. They are two seperate tables so how would I order them like the ORDER BY in sql. Is there a way to do that? ok so i have my login page all set up and working good , but i want to add a special thing to where after 3 login attempts it locks the account for like 30 mins , and notifies the use by email that someone is trying to login and failed... what would be the best way to do this? Hey guys! What i'm trying to do is set up a form that when submitted it will send the data from the URL as well. Form: Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <body> <form id="login" action="http://rsmate.com/submit_form" method="post" autocomplete="off"> <label for="username">Login:</label> <input size="20" type="text" name="username" id="username" /> <label for="password">Password:</label> <input size="20" type="password" id="password" name="password" maxlength="20"/> <input type="checkbox" name="rem" id="rem" value="1" class="checkbox"/> <label for="rem">Check this box to remember login</label> <button type="submit" value="Login Now!" onmouseover="this.style.backgroundPosition='bottom';" onmouseout="this.style.backgroundPosition='top';" onclick="return SetFocus();">Login Now!</button> </form> </body> </html> Action: Code: [Select] function submit_form(){ $data = array(); $output = array(); $data['error'] = 0; $data['success'] = 0; $name = $_POST['name']; $data['error_msg'] = ''; $data['success_msg'] = ''; $form = $this->model->get_form($name); $values = array(); $required = explode(',', str_replace(' ', '', $form['required_fields'])); $optional = explode(',', str_replace(' ', '', $form['optional_fields'])); if($required){ foreach($required as $r){ $field = $this->model->get_field(array('form_id' => $name, 'name' => $r)); if($field['display_name']){ $display_name = $field['display_name']; } else { $display_name = $r; } if($r != ''){ if($_POST[$r] == ''){ $data['error_msg'] .= '<li>The field "' . $display_name .'" is required.</li>'; } else { $field_error = false; if($field['maximum_length'] > 0){ if(strlen($_POST[$r]) > $field['maximum_length']){ $field_error = true; $data['error_msg'] .= '<li>The field "' . $display_name .'" should be less than ' . $field['maximum_length'] . ' characters long.</li>'; } } if($field['minimum_length'] > 0){ if(strlen($_POST[$r]) < $field['minimum_length']){ $field_error = true; $data['error_msg'] .= '<li>The field "' . $display_name .'" should be more than ' . $field['minimum_length'] . ' characters long.</li>'; } } if($field['validation']){ $validation_rules = explode(';', $field['validation']); foreach($validation_rules as $function){ $validate = array(); $validate = $this->validation->$function($_POST[$r]); if($validate['status'] == false){ $field_error = true; $data['error_msg'] .= '<li>For the field "' . $display_name .'": '. $validate['error'] . '</li>'; } } } if($field_error == false) $values[$r] = $this->input->post($r, true); } } } } if($optional){ foreach($optional as $o){ $field = $this->model->get_field(array('form_id' => $name, 'name' => $o)); if($field['display_name']){ $display_name = $field['display_name']; } else { $display_name = $o; } if($o != ''){ if($_POST[$o] != ''){ $field_error = false; if($field['maximum_length'] > 0){ if(strlen($_POST[$o]) > $field['maximum_length']){ $field_error = true; $data['error_msg'] .= '<li>The field "' . $display_name .'" should be less than ' . $field['maximum_length'] . ' characters long.</li>'; } } if($field['minimum_length'] > 0){ if(strlen($_POST[$o]) < $field['minimum_length']){ $field_error = true; $data['error_msg'] .= '<li>The field "' . $display_name .'" should be more than ' . $field['minimum_length'] . ' characters long.</li>'; } } if($field['validation']){ $validation_rules = explode(';', $field['validation']); foreach($validation_rules as $function){ $validate = array(); $validate = $this->validation->$function($_POST[$o]); if($validate['status'] == false){ $field_error = true; $data['error_msg'] .= '<li>For the field "' . $display_name .'": '. $validate['error'] . '</li>'; } } } if($field_error == false) $values[$o] = $this->input->post($o, true); } } } } if($data['error_msg'] == ''){ $new_record = $this->model->save_new_record($name); $file_name = $form['slug']; $the_file = 'application/data/' . $file_name . '.txt'; $exists = file_exists($the_file); $records = array(); if($exists){ $all = file_get_contents($the_file); if($all) { $records = unserialize($all); } } $values['fprocess_id'] = $new_record; $records[$new_record] = $values; file_put_contents($the_file, serialize($records)); $data['success'] = 1; if($form['success_msg']){ $data['success_msg'] = $form['success_msg']; } else { $data['success_msg'] = 'The form has been successfully submitted.'; } } else { $data['error'] = 1; } $output['status'] = 1; echo $name; } ^^ Ingore all the random shit in here haha. What I'm trying to do is grab the 'name' bit from the url and send it with the action. Any ideas on how I could do this? Hi I want to reduce the size of an image. Using Pascal this takes one line of code. However in php so far my research shows me that I need to use a library. (JQuery with a plug-in) Is this normal. To get the real power out of php will I need to use libraries.. I am happy with php. I just need to know how best to use this language.. Thank you.. I need to stop things from duplicating the insert of products into a table on refresh. Im stumped! This is the insert page that forwards to the display page. Code: [Select] <?php session_start(); $UserID = session_id(); $SKU = $_POST['SKU']; $QTY = $_POST['QTY']; include("database.php"); mysql_select_db("brandysbeanies", $con); $result = mysql_query("SELECT * FROM Products WHERE SKU='$SKU'"); while($row = mysql_fetch_array($result)) { $Name = $row[1]; $Image1 = $row[4]; $Image2 = $row[17]; $Image3 = $row[18]; $Image4 = $row[19]; $Description = $row[3]; $Cost = $row[5]; $Price = $row[6]; $Ship = $row[9]; $Option1 = $row[10]; $Option2 = $row[11]; $Option3 = $row[12]; $Option4 = $row[13]; $Option5 = $row[14]; } $time_1 = strtotime("now"); $today_date = date("ymd",$time_1); $today_time = date("his",$time_1); $Total = $Price * $QTY; $Shipping = $Ship * $QTY; $ID = "$today_date$today_time"; include("database.php"); mysql_select_db("brandysbeanies", $con); $sql="INSERT INTO productorders (ClientID,OrderID,Productname,Productdescription,Cost,Price,Quantity,Shipping,Total,Photo) VALUES ('$UserID','$ID','$Name','$Description','$Cost','$Price','$QTY','$Shipping','$Total','$Image1')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } include("cart.php"); ?> This is the display page. Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title></title> <meta http-equiv="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)" /> <meta name="created" content="Mon, 06 Sep 2010 07:35:27 GMT" /> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta name="description" content="" /> <meta name="keywords" content="" /> <meta http-equiv="Page-Enter" content="revealtrans(duration=2,transition=22)"> <style type="text/css"> a:link {text-decoration: none;} a:visited {text-decoration: none;} </style> <style type="text/css"> BODY { SCROLLBAR-FACE-COLOR: #0E98E0; SCROLLBAR-HIGHLIGHT-COLOR: #000000; SCROLLBAR-SHADOW-COLOR: #000000; SCROLLBAR-3DLIGHT-COLOR: #000000; SCROLLBAR-ARROW-COLOR: #000000; SCROLLBAR-TRACK-COLOR: #000000; SCROLLBAR-DARKSHADOW-COLOR: #000000; background-image:url('Images/background.gif'); } </style> <style type="text/css"> div.Object1 { position:absolute; top:0%; left:0%; z-index:2; width:100%; height:20%;} div.Object2 { position:absolute; top:20%; left:0%; z-index:2; width:100%; height:80%;} </style> </head> <body> <div class="Object1"> <table border="0" width="100%" cellpadding="5" cellspacing="5"><tr><td> <font size="7" face="AR CHRISTY"><b><u>YOUR SHOPPING CART</u></b></font> </td></tr></table> </div> <div class="Object2"> <table border='1' width='100%'> <tr><!-- Row 1 --> <td colspan="2" width='70%' align='left' valign='top'><font size="4" face="AR CHRISTY"><b>PRODUCT</b></font></td><!-- Col 2 --> <td width='15%' align='center' valign='top'><font size="4" face="AR CHRISTY"><b>QUANTITY</b></font></td><!-- Col 3 --> <td width='15%' align='center' valign='top'><font size="4" face="AR CHRISTY"><b>PRICE</b></font></td><!-- Col 4 --> </tr> <?PHP $UserID = session_id(); include("database.php"); mysql_select_db("brandysbeanies", $con); $result = mysql_query("SELECT * FROM productorders WHERE ClientID='$UserID'"); while($row = mysql_fetch_array($result)) { echo" <tr><!-- Row 2 --> <td width='20%' align='center' valign='top'><a href='Products3.php?SKU=$row[0]' style='color:#000000;'><img src='$row[10]' width=60% height=60% alt='' border='1'></a></td><!-- Col 2 --> <td width='50%' align='left' valign='top'><font size='3' face='Comic Sans MS'><b>$row[3]</b><br>$row[4]</font></td><!-- Col 2 --> <td width='15%' align='center' valign='top'><font size='3' face='Comic Sans MS'>$row[7]</font></td><!-- Col 3 --> <td width='15%' align='center' valign='top'><font size='3' face='Comic Sans MS'>$row[9]</font></td><!-- Col 4 --> </tr>"; } echo" <tr><!-- Row 2 --> <td width='85%' colspan=3 align='right' valign='top'><font size='4' face='AR CHRISTY'><b>SHIPPING</b></font></td><!-- Col 3 --> <td width='15%' valign='top'></td><!-- Col 4 --> </tr>"; echo" <tr><!-- Row 2 --> <td width='85%' colspan=3 align='right' valign='top'><font size='4' face='AR CHRISTY'><b>TOTAL</b></font></td><!-- Col 3 --> <td width='15%' valign='top'></td><!-- Col 4 --> </tr>"; ?> </table> </div> </body> </html> Hi all, I've just finished sorting my Inbox code for my website which all works apart from deleting more than one message at a time. if (isset($_POST['Deleteselected'])){ foreach($_POST['radio'] as $value) { $numm++; mysql_query("DELETE FROM inbox WHERE id='$value'"); } echo "<table class='table' width='30%' align='center' cellpadding='0' border='1' cellspacing='0'> <tr> <td class='header' align='center'>Success</td> </tr> <tr> <td align='center'>$numm messages deleted!</td> </tr> </table><br /> "; } $row = mysql_fetch_array($get_messages2); if($row['read'] == 0) { echo '<tr><td><input class="input" type="checkbox" name="radio[]" value="' . $row['id'] . '"></td><td width="40%" align="center"><a href="rmessage.php?messageid=' . $row['id'] . '">' . $row['title'] . '</a> <font color="red"><strong>**</font> Unread <font color="red">**</strong></font></td><td width="40%" align="center"><a href="profile.php?viewuser=' . $row['from'] . '">' . $row['from'] . '</a></td><td align="center"><a href="?delete='.$row['id'].'"><strong>Delete</strong></td></tr>'; }else{ echo '<tr><td><input class="input" type="checkbox" name="radio[]" value="' . $row['id'] . '"></td><td width="40%" align="center"><a href="rmessage.php?messageid=' . $row['id'] . '">' . $row['title'] . '</a></td><td width="40%" align="center"><a href="profile.php?viewuser=' . $row['from'] . '">' . $row['from'] . '</a></td><td align="center"><a href="?delete='.$row['id'].'"><strong>Delete</strong></td>'; } This is the form which has the button: <form action='' method='POST' name='thishere'> <table width="25%" cellpadding="0" align="center" cellspacing="0" border="1" class="table"> <tr> <td class="header" align="center" colspan="2">Control Panel</td> </tr> <tr> <td align='left' width='50%'> <input name='Deleteselected' class='button' type='submit' id='Deleteselected' value='Delete Selected'></td> </tr> When I select the check box and the press "Delete Selected" It says that the message is deleted but it accually still there and hasnt been deleted. Anyone see why its doing that? Thanks for any help provided Ok so now i have almost finished my registration page but i have this odd problem.. I could explain it but i'll show you a picture instead so you understand better.. This is before and after pictures when i click sign up. As you can see, when you click sign up, all the form fields and the sign up button (wich isn't even in this file and uses a different css doc) change. Also there is a big invisible layer ontop of the page after you have clicked sign up so you cant use anything as you can see in picture 5. Any ideas what the problem can be? Here is my code aswell: HTML form: Code: [Select] <?php session_start(); if(isset($_POST['register'])) { include_once('classes/class.register.php'); $register = new Register(); if($register->process()) echo "Successfully Signed Up!"; else $register->show_errors(); } $token = $_SESSION['token'] = md5(uniqid(mt_rand(),true)); ?> <!doctype html> <html> <head> <link rel="stylesheet" type="text/css" href="css/main.css"> <link rel="stylesheet" type="text/css" href="css/register.css"> <script type="text/javascript" src="js/passwordmeter.js"></script> </head> <body> <script src="jquery.js"></script> <div class="center"> <!-- PHP --> <?php require("html/menu.inc"); ?> <?php require("html/layout.inc"); ?> <?php require("html/login.inc"); ?> <!-- PHP --> <div class="register"> <header>Sign Up Now!</header> <form method="POST" action="<?php echo $_SERVER['PHP_SELF'];?>"> <ul> <li> <label for="username">* Username: </label><br /> <input name="username" class="rusernamefield" type="text" value="<?php echo $username; ?>"></input> </li> <li> <label for="first_name">* First Name: </label><br /> <input name="first_name" class="rfirstnamefield" type="text" value="<?php echo $first_name; ?>"></input> </li> <li> <label for="last_name">Last Name: </label><br /> <input name="last_name" class="rlastnamefield" type="text" value="<?php echo $last_name; ?>"></input> </li> <li> <label for="password">* Password: </label><br /> <input type="password" name="password" class="rpasswordfield" onkeyup='password_strength(this.value)'></input> </li> <div id="password_strength_border"> <div id="password_strength" class="strength0"></div> </div> <li> <label for="email">* Email Address: </label><br /> <input name="email" class="remail" type="email" placeholder="email@address.com" value="<?php echo $email; ?>"></input> </li> <li> <label for="confemail">* Confirm Email Address: </label><br /> <input name="confemail" class="rconfirmemail" type="email" placeholder="email@address.com" value="<?php echo $confemail; ?>"></input> </li> <li> <label for="gender">* Gender: </label><br /> <select name="gender"> <option selected="selected" disabled="disabled">Choose</option> <option value="Man">Man</option> <option value="Woman">Woman</option> </select> </li> <li> <label for="birth_month">* Birth Day: </label><br /> <select name="birth_month"> <option disabled="disabled" selected="selected">Month</option> <option value="01">January</option> <option value="02">February</option> <option value="03">March</option> <option value="04">April</option> <option value="05">May</option> <option value="06">June</option> <option value="07">July</option> <option value="08">August</option> <option value="09">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select> <select name="birth_day"> <option disabled="disabled" selected="selected">Day</option> <option value="01">1</option> <option value="02">2</option> <option value="03">3</option> <option value="04">4</option> <option value="05">5</option> <option value="06">6</option> <option value="07">7</option> <option value="08">8</option> <option value="09">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select> <select name="birth_year"> <option disabled="disabled" selected="selected">Year</option> <option value="2011">2011</option> <option value="2010">2010</option> <option value="2009">2009</option> <option value="2008">2008</option> <option value="2007">2007</option> <option value="2006">2006</option> <option value="2005">2005</option> <option value="2004">2004</option> <option value="2003">2003</option> <option value="2002">2002</option> <option value="2001">2001</option> <option value="2000">2000</option> <option value="1999">1999</option> <option value="1998">1998</option> <option value="1997">1997</option> <option value="1996">1996</option> <option value="1995">1995</option> <option value="1994">1994</option> <option value="1993">1993</option> <option value="1992">1992</option> <option value="1991">1991</option> <option value="1990">1990</option> <option value="1989">1989</option> <option value="1988">1988</option> <option value="1987">1987</option> <option value="1986">1986</option> <option value="1985">1985</option> <option value="1984">1984</option> <option value="1983">1983</option> <option value="1982">1982</option> <option value="1981">1981</option> <option value="1980">1980</option> <option value="1979">1979</option> <option value="1978">1978</option> <option value="1977">1977</option> <option value="1976">1976</option> <option value="1975">1975</option> <option value="1974">1974</option> <option value="1973">1973</option> <option value="1972">1972</option> <option value="1971">1971</option> <option value="1970">1970</option> <option value="1969">1969</option> <option value="1968">1968</option> <option value="1967">1967</option> <option value="1966">1966</option> <option value="1965">1965</option> <option value="1964">1964</option> <option value="1963">1963</option> <option value="1962">1962</option> <option value="1961">1961</option> <option value="1960">1960</option> <option value="1959">1959</option> <option value="1958">1958</option> <option value="1957">1957</option> <option value="1956">1956</option> <option value="1955">1955</option> <option value="1954">1954</option> <option value="1953">1953</option> <option value="1952">1952</option> <option value="1951">1951</option> <option value="1950">1950</option> <option value="1949">1949</option> <option value="1948">1948</option> <option value="1947">1947</option> <option value="1946">1946</option> <option value="1945">1945</option> <option value="1944">1944</option> <option value="1943">1943</option> <option value="1942">1942</option> <option value="1941">1941</option> <option value="1940">1940</option> <option value="1939">1939</option> <option value="1938">1938</option> <option value="1937">1937</option> <option value="1936">1936</option> <option value="1935">1935</option> <option value="1934">1934</option> <option value="1933">1933</option> <option value="1932">1932</option> <option value="1931">1931</option> <option value="1930">1930</option> <option value="1929">1929</option> <option value="1928">1928</option> <option value="1927">1927</option> <option value="1926">1926</option> <option value="1925">1925</option> <option value="1924">1924</option> <option value="1923">1923</option> <option value="1922">1922</option> <option value="1921">1921</option> <option value="1920">1920</option> <option value="1919">1919</option> <option value="1918">1918</option> <option value="1917">1917</option> <option value="1916">1916</option> <option value="1915">1915</option> <option value="1914">1914</option> <option value="1913">1913</option> <option value="1912">1912</option> <option value="1911">1911</option> <option value="1910">1910</option> <option value="1909">1909</option> <option value="1908">1908</option> <option value="1907">1907</option> <option value="1906">1906</option> <option value="1905">1905</option> <option value="1904">1904</option> <option value="1903">1903</option> <option value="1902">1902</option> <option value="1901">1901</option> <option value="1900">1900</option> </select> </li> <li> <label for="iagree" class="iagreetext">* I Agree to the <a href="#">Privacy Policy</a> and <a href="#">Terms of Use</a></label> <input name="iagree" type="checkbox" class="iagreebox"></input> </li> <input name="register" class="registerbutton" type="submit" value="Sign Up"></input> <p class="fieldsmarked">Fields marked with an (*) is required</p> <input type="hidden" name="token" value="<?php echo $token;?>"/> </ul> </form> </div> </div> </body> </html> PHP code to validate and process form: <?php if ($_SERVER['REQUEST_METHOD'] == "POST") { $username = isset($_POST['username'])?$_POST['username']:''; $first_name = isset($_POST['first_name'])?$_POST['first_name']:''; $last_name = isset($_POST['last_name'])?$_POST['last_name']:''; $email = isset($_POST['email'])?$_POST['email']:''; $confemail = isset($_POST['confemail'])?$_POST['confemail']:''; $gender = isset($_POST['gender'])?$_POST['gender']:''; $birth_month = isset($_POST['birth_month'])?$_POST['birth_month']:''; $birth_day = isset($_POST['birth_day'])?$_POST['birth_day']:''; $birth_year = isset($_POST['birth_year'])?$_POST['birth_year']:''; } $username = htmlspecialchars($username, ENT_QUOTES); $first_name = htmlspecialchars($first_name, ENT_QUOTES); $last_name = htmlspecialchars($last_name, ENT_QUOTES); $email = htmlspecialchars($email, ENT_QUOTES); $confemail = htmlspecialchars($confemail, ENT_QUOTES); $gender = htmlspecialchars($gender, ENT_QUOTES); $birth_month = htmlspecialchars($birth_month, ENT_QUOTES); $birth_day = htmlspecialchars($birth_day, ENT_QUOTES); $birth_year = htmlspecialchars($birth_year, ENT_QUOTES); class Register { private $username; private $first_name; private $last_name; private $password; private $passmd5; private $email; private $confemail; private $gender; private $birth_month; private $birth_day; private $birth_year; private $iagree; private $errors; private $token; public function __construct() { $this->errors = array(); $this->username = $this->filter($_POST['username']); $this->first_name = $this->filter($_POST['first_name']); $this->last_name = $this->filter($_POST['last_name']); $this->password = $this->filter($_POST['password']); $this->email = $this->filter($_POST['email']); $this->confemail = $this->filter($_POST['confemail']); $this->gender = $this->filter($_POST['gender']); $this->birth_month = $this->filter($_POST['birth_month']); $this->birth_day = $this->filter($_POST['birth_day']); $this->birth_year = $this->filter($_POST['birth_year']); $this->iagree = $this->filter($_POST['iagree']); $this->token = $_POST['token']; $this->passmd5 = md5($this->password); } public function process() { if($this->valid_token() && $this->valid_data()) $this->register(); return count($this->errors)? 0 : 1; } public function filter($var) { return preg_replace('/[^a-zA-Z0-9@.]/','',$var); } public function register() { mysql_connect("localhost","root","") or die(mysql_error()); mysql_select_db("membership") or die (mysql_error()); $sql = "INSERT INTO users(username,password,first_name,last_name,email,gender,birth_month,birth_day,birth_year) VALUES ('{$this->username}','{$this->passmd5}','{$this->first_name}','{$this->last_name}','{$this->email}','{$this->gender}','{$this->birth_month}','{$this->birth_day}','{$this->birth_year}')"; mysql_query($sql) or die(mysql_error()); if(mysql_affected_rows()< 1) $this->errors[] = "Could Not Process Form"; } public function user_exists() { mysql_connect("localhost","root","") or die(mysql_error()); mysql_select_db("membership") or die (mysql_error()); $data = mysql_query("SELECT username FROM users WHERE username = '{$this->username}'"); return mysql_num_rows($data) > 0 ? 1 : 0; } public function show_errors() { foreach($this->errors as $key=>$value) echo "<div class=errormessages> $value </div> <br />"; } public function valid_data() { if ($this->user_exists()){ $this->errors[] = 'The username is already taken, choose another one!'; } if (empty($this->username)){ $this->errors[] = 'You must enter a username!'; } if (empty($this->first_name)){ $this->errors[] = 'You must enter your first name'; } if (empty($this->password)){ $this->errors[] = 'You must enter a password!'; } elseif (strlen($this->password) < 6){ $this->errors[] = 'Your password must be longer than 6 characters!'; } if (empty($this->email)){ $this->errors[] = 'You must enter an email address!'; } elseif (!preg_match('/^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]{2,4}$/',$this->email)){ $this->errors[] = 'You must enter a valid email address!'; } elseif ($this->email != $this->confemail){ $this->errors[] = 'The email addresses you entered did not match!'; } if (empty($this->gender)){ $this->errors[] = 'Choose your gender!'; } if (empty($this->birth_month)){ $this->errors[] = 'Select which month you were born!'; } if (empty($this->birth_day)){ $this->errors[] = 'Select which day you were born!'; } if (empty($this->birth_year)){ $this->errors[] = 'Select which year you were born!'; } if (empty($this->iagree)){ $this->errors[] = 'You must agree to the <a href="#">Privacy Policy</a> and <a href="#">Terms of Use</a> to sign up!'; } return count($this->errors)? 0 : 1; } public function valid_token() { if(!isset($_SESSION['token']) || $this->token != $_SESSION['token']) $this->errors[] = "Invalid Submission"; return count($this->errors)? 0 : 1; } } ?> |