PHP Registration Form

about: "When you login into a website or into your mail box, you are interacting with a form.\n\nForms are used to get input from the user and submit it to the web server for processing.\n\nLearn PHP Registration Form using GET, POST Methods with Example and code."
codetype: '3'
thecode: "<html>\n\n<head>\n\n<title>Registration Form</title>\n\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n\n</head>\n\n<body>\n\n<?php if (isset($_POST['form_submitted'])): ?> //this code is executed when the form is submitted \n\n<h2>Thank You \n\n<?php echo $_POST['firstname']; ?>\n\n</h2> \n\n<p>You have been registered as <?php echo $_POST['firstname'] . ' ' . $_POST['lastname']; ?> </p> \n\n<p>Go <a href=\"/registration_form.php\" >back</a> to the form</p> \n\n<?php else: ?> \n\n<h2>Registration Form</h2> \n\n<form action=\"registration_form.php\" method=\"POST\"> \n\nFirst name: <input type=\"text\" name=\"firstname\"><br> \n\nLast name: <input type=\"text\" name=\"lastname\"> <br> \n\n<input type=\"hidden\" name=\"form_submitted\" value=\"1\"/> \n\n<input type=\"submit\" value=\"Submit\"> \n\n</form> \n\n<?php endif; ? > \n\n</body> \n\n</html>"
additionalinfo: ''
viewdemo: 'https://www.guru99.com/php-forms-handling.html'
originalurl: 'https://www.guru99.com/php-tutorials.html'
licenseinfo: ''

Start Up an App using Ruby on Rails

about: "Just a quick Ruby on Rails code/reminder that gets your app started. Feel free to type in your Rails command prompt rails, which is used to display the full options for the rails command.\n\nI will be adding new snippets of Ruby on Rails coding once I'm near finished with my knowledge of Ruby (I want to make these posts right for everyone! Being Ruby is a difficult language to learn…). I figured this would help certain users like myself start up an app quickly.\n\nEventually I will be adding a tutorial on how to build a Rails app from the ground up. Stay tuned in the future for that one!\n\nThe Rails snippet/command to get you started:"
codetype: '10'
thecode: '$ rails new MyMainApp'
additionalinfo: "That's it!\n\nIf you have trouble running bundle install while the app is compiling on a Windows OS feel free to comment below and I'll help you solve your issue.\n\nDisclaimer: This tutorial is assuming you have beginner knowledge of Ruby on Rails."
viewdemo: ''
originalurl: 'http://www.icondeposit.com/code:7'
licenseinfo: 'Free to use'

Hide Image Errors via CSS/HTML (Broken Image Handling)

about: "= hich.png\n\nHere is a fix for hiding image errors (Broken Images) using just a little bit of CSS (granted you are using DocType XHTML 1.0 Transitional or greater in your source code). This is the way to hide the error WITHOUT the use of Javascript!\n\nAs you may have noticed on each IconDeposit Member Profile, we do not hide the image error using Javascript, we use CSS to hide the image error. Using the DocType XHTML 1.0 Transitional or greater and a little bit of CSS you will be able to pull this off. This is the easy way to do this for people who aren't too tech savy with Javascript.\n\nNext just add the \"alt\" attribute to your img html like so:\n[[code type=\"HTML\"]]\n<img src=\"#\" href=\"#\" alt=\"foo-bar\" />\n[[/code]]\n\nAnd finally here is the CSS code that does the trick (snippet from demo version):"
codetype: '2'
thecode: "img.error-not-fixed, img.error-fixed{\n\tdisplay:inline-block;\n\tposition:relative;\n\twidth:128px;\n\theight:128px;\n\tborder:15px solid #fff;\n\tborder-radius:1px;\n\tmargin:0px;\n\tbackground:#fff!important;\n}\nimg.error-fixed {\n\tbackground: #CCC url(../YOUR-IMAGE-HERE.PNG) 0 0 no-repeat!important;\n\ttext-indent: -9999px;\n\tborder: 15px solid #fff;\n\tcolor: transparent!important;\n\t-webkit-appearance: none!important;\n}"
additionalinfo: "* Keep in mind, you will need to add the \"alt\" attribute to your image. This would be the only thing besides the DocType as far as HTML goes that you would need to change/add.\n\nAs far as I know, this is the only CSS image error handling trick out there that works without Javascript."
viewdemo: 'http://www.icondeposit.com/local--files/start/Hide%20Image%20Errors%20via%20CSS.html'
originalurl: 'http://www.icondeposit.com/code:5'
licenseinfo: 'Creative Commons Attribution 3.0'

How to Universally Show the Featured Image in the Buddypress Activity Excerpt

codetype: '3'
about: "I came across this problem while I was coding one of my Buddypress installs. One of my installs is completely custom PHP code and I had a situation where the featured image would not show up in the activity stream associated with a blog post.\n\nThis Literally took me a year to find/mess with and code the official thing. This code will 100% get the featured image in the specific post id to show up in the associated Buddypress Activity Stream Item's excerpt/content.\n\nPlace the Following code in your functions.php file and this will work universally:"
thecode: "// Here is the fix\nfunction icondeposit_bp_activity_entry_meta() {\n\n if ( bp_get_activity_object_name() == 'blogs' && bp_get_activity_type() == 'new_blog_post' ) {?>\n <?php\n global $wpdb, $post, $bp;\n $theimg = wp_get_attachment_image_src( get_post_thumbnail_id( bp_get_activity_secondary_item_id() ) );\n ?>\n <img src=\"<?php echo $theimg[0]; ?>\" >\n\n <?php }\n \n}\nadd_action('bp_activity_excerpt_append_text', 'icondeposit_bp_activity_entry_meta');\n"
additionalinfo: "Just like my freebie posts, you are required to link back to this site any time you use this code.\n\nupdate: since the latest Buddypress 1.7 update this code will not work unless you manually edit it."
viewdemo: ''
originalurl: 'http://www.icondeposit.com/code:4'
licenseinfo: 'Creative Commons Attribution 3.0'

How To Create Knob And Dial Scratches Using Photoshop (Tutorial)

How to create knob and dial scratches using photoshop

This is an extremely useful, well very useful Photoshop tutorial. In this Photoshop tutorial, I will show you how to make some elegant and highly detailed Knob and or Dial scratches. This is a beginner, to intermediate photoshop trick, so you kind of have to know your way around photoshop to create this stylish effect. This tutorial is also for creating a knob or dial (more than just the scratches).

Step 1

Lets start this tutorial by creating a new photoshop document. Make the width 400px and make the height 300px with 72ppi and in RGB color like so:

Step 2

Next, lets create some new guides to keep everything centered, tutorials usually lack to say what guides to make, so in this one I will show you what guides to make. Go to View>New Guide. Then create a vertical guide of 50%, and create a horizontal guide of 50%. This will keep everything in line and in the center. Lastly, go to View, then make sure the Snap is checked. Then you will get something looking like this:

Step 3

Next, grab the Ellipse tool (U) and create a circle shape to about this size:

Step 4

Next, we will double click on the shape's color (next to the shape in your layers palette), and make the shape the following color: #CCCCCC, the color is used in image for the step above:

Step 5

Now to create the knob or you can call it a dial if you'd like to. Okay, so lets double click on your shape in the layers palette, bringing up the Blending Options, or you can go to Layer>Layer Style>Blending Options. For step 5, click on the Drop Shadow layer style. Make the Blending Mode normal, then make the opacity 15%. Next, when changing the Angle, Make Sure you uncheck the Global light, once you have done that you can make the angle at 56deg (degrees). Next, you will need to make the distance of the drop shadow to 2px (pixels). Then keep the Spread at 0%, then make the Size to 10px. Then make the Contour similar to the one in the picture below. Keep the Anti-aliased unchecked, and then keep the noise at 0%. Make sure the color is at #000000 (black) Your Drop Shadow Layer Style should look like this:

Step 6

We will make the next layer style, for this one, make sure the Inner Glow layer style is checked. To style the Inner Glow, we will need to make the Blending Mode normal, keep the Opacity at 100% and the Noise at 0%, then make the color #FFFFFF (white). Keep the Technique at Softer, have the Source at Edge. Then keep the Choke at 0%, and make the Size 3px. Then keep Contour normal like the one in the photo below, and keep the Anti-aliased unchecked. Then make the Range at 50% and the Jitter at 0%. Your Inner glow should look like this:

Step 7

Now to create a nice Bevel and Emboss. You need to make the Style and Inner Bevel, make the Technique Smooth, keep the depth at 100%, make the Direction Up, make the size 1px, and keep the soften at 0px. For the Shading, make sure the Global Light is unchecked, then make the Angle 111deg, and the Altitude 42deg. For the Contour, make it normal like the one in the image below, the Anti-aliased should be unchecked. For the Highlight Mode keep it Normal, make it a white color (#FFFFFF) and slide it to 100%. For the Shadow Mode keep it Normal, make it a black color (#000000), and slide it to 32%. Your Bevel and Emboss Layer Style should look like this:

Step 8

Lets now finish the knob layer style with creating an elegant Gradient Overlay. Keep the Blending mode Normal, and make the Opacity 100%. Next, to create this specific gradient you must copy the following. This is read from Left to Right so pay close attention. There should be 9 total Color Stops for this gradient. The First (1st) color stop should be color #AAAAAA (grey) and have a location of 0%. The Second (2nd) color stop should be color #f7f7f7 (light grey) and have a location of 9%. The Third (3rd) color stop should be color #C8C8C8 (gray) and have a location of 14%. The Fourth (4th) color stop should be color #F7F7F7 (light grey) and have a location of 31%. The Fifth (5th) color stop should be color #C5C5C5 (gray) and have a location of 51%. The Sixth (6th) color stop should be color #FFFFFF (white) and have a location of 57%. The Seventh (7th) color stop should be color #BBBBBB (grey) and have a location of 63%. The Eighth (8th) color stop should be color #F2F2F2 (light grey) and have a location of 75%. The Ninth (9th) color stop should be color #AAAAAA (grey) and have a location of 100%. Lastly, let's keep the reverse unchecked, the Style should be at an Angle, align it with the layer, and make the angle at -132deg and scale the gradient to 100%. In the end, your Gradient Overlay should look like this:

Step 9

Now that the knob/dial is done, we can finally create the Scratches (scratched/etched effect). You will need to go to the tab "Paths", this should be above your Knob/Dial layer. After you click on the Paths tab, select the knob layer by Loading the Path as a Selection, this will select the knob layer. Next (wile keeping the selection, Do not deselect it, if you do happen to deslect it just reselect Shif+Ctrl+D), create a New Layer (Shift+Ctrl+N). Then grab the Bucket tool (G) and fill the layer (inside the selection) with the foreground color #FFFFFF (white), and make sure it's at 25% when you do the Bucket Fill, keep the blending mode normal before you fill it.You should get a light white transparent layer like so:

Step 10

Then go to Filter>Noise>Add Noise. You will need to make the noise amount 400% and make the distribution, Uniform. Make sure the Monochromatic is checked. Your noise layer should end up like this:

Step 11

Now to make the Noise "Spin". You will now have to go to Filter>Blur>Radial Blur. Make the Amount 30, for the Blur Method select Spin, and for the Quality, keep it at best.You should end up with this:

Step 12

For the Grand Finale, let's add some better detail and polish it up a bit, it's very quick, nothing long. For the Scratch layer, make the Opacity 80% (not the Fill opacity, just the regular layer opacity). Then Switch the Blending mode (for the layer) from Normal to "Color Burn". You should end up with this:

That about sums it up, I hope you enjoyed my tutorial on How To Create Knob And Dial Scratches Using Photoshop! Please comment and let me know if you liked this tutorial or if this helped you out in some way.

License: Creative Commons Attribution 3.0

- Re-sale and or Re-distribution is forbidden.

- Remember to link back to Icondeposit.com or this post if you are using this elswhere.

The file for this includes the whole tutorial as well as the PSD for the finished image.

Head over to the "Design Category" to download the file: https://www.icondeposit.com/design:dial-version-3-includes-tutorial

How To Properly Smooth Font Using CSS3

I've came across some people usually wondering how some websites have such crisp and clear font. There are two reasons for this:

1. They are most likely using the -webkit-font-smoothing hack. This type of hack is mostly used for mobile browsers, as well as the Apple Safari and Google Chrome Browsers.

2. To really smooth the font and not have anything too blurry websites usually use the text-shadow effect. This is also used so the font will look smooth on all browsers (Opera, Firefox, Safari, Chrome and others alike) except internet explorer.

When you apply the font smoothing hack to your stylesheet and you want it applied to your whole site, make sure we write the following code.

Lets start off by adding the font smoothing hack to your stylesheet:
html, html a {
    -webkit-font-smoothing: antialiased !important;

Here is the definition of anti-aliased: http://en.wikipedia.org/wiki/Spatial_anti-aliasing

Now for the text shadow effect to really smooth out the font:
html, html a {
    text-shadow: 1px 1px 1px rgba(0,0,0,0.004);
Here is the code all put together:
html, html a {
    -webkit-font-smoothing: antialiased;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.004);

To really see what I am talking about, here are a couple of demo's that shows it's smoothing.

If you have a good eye for this kind of design, you will notice the difference:

Here is how it looks when the font is not smoothed:

Hello World!

Here is how it looks when the font is smoothed:

Hello World!

page 1 of 3123next »

About Us:

Here at the Icon Deposit, we give you the opportunity to post your icons, designs, code, and screenshots to promote your work and gain new clients. We feature Hundreds of Free PSD's, Icons, Icon Sets, UI/UX design, Illustrator/Vector graphics, CSS, CSS3, JQuery, Photoshop tutorials and tons more.

Popular Tutorials:

Copyright © 2011-2019 Icon Deposit - All rights Reserved