Showing posts with label Php. Show all posts
Showing posts with label Php. Show all posts

Sunday, October 20, 2013

How Stop CPU Limit Exceeded on your Websites

We've Received alot of Complaints on this. Normally, in Youhosting, when your Website's CPU is above 70%, this Error Shows up!
Here's a to Control it.. Just addthis Code to the Header Path of your Script..

Php date function

<?php
$timezone
="+6";$jam=gmdate("H:i",time()+3600*($timezone));$d=gmdate("d",time()+3600*($timezone));$m=gmdate("m",time()+3600*($timezone));$y=gmdate("Y",time()+3600*($timezone));

How to create PHP based email form with file attachment

The HTML form with file upload box

The code for an HTML form with a file upload box is given below. User can click on the ‘Browse’ button to select the file from his/her local machine.
 
Code: [Select]
<form method="POST" name="email_form_with_php"
action="php-form-action.php" enctype="multipart/form-data">

<label for='name'>Name: </label>
<input type="text" name="name" >

<label for='email'>Email: </label>
<input type="text" name="email" >

<label for='message'>Message:</label>
<textarea name="message"></textarea>

<label for='uploaded_file'>Select A File To Upload:</label>
<input type="file" name="uploaded_file">

<input type="submit" value="Submit" name='submit'>
</form>
The form will look like this:

Verifying email address

1. signup.php
2. signup_ac.php
3. confirmation.php
4. config.php 

We have to create 2 databases
1. temp_members_db 
2. registered_members

What to do
1. When users sign up. Random a set of confirmation code.

Friday, June 21, 2013

PHP - Echo

  1. As you saw in the previous lesson, the PHP function echo
  2. is a means of outputting text to the web
  3. browser. Throughout your
  4. PHP career you will be using the echo function more than any other.
  5. So
  6. let's give it a solid perusal!
  7. Outputting a String

“Go Back” Button

  1. Browsers already have "back" buttons, so you'd better have a darn good reason for needing to put one on your page!
  2.  
  3. Input button with inline JavaScript
  4. <input type="button" value="Go Back From Whence You Came!" onclick="history.back(-1)" />
  5.  
  6. This is totally obtrusive, but you could fix that by only appending this button through JavaScript.
  7.  
  8. PHP
  9.  
  10. If JavaScript isn't a possibility, you could use the HTTP_REFERER, sanitize it, and echo it out via PHP.

  11. <?php
  12. $url = htmlspecialchars($_SERVER['HTTP_REFERER']);
  13. echo "<a href='$url'>back</a>";
  14. ?>