Reputation Activity
-
irn3rd reacted to Daz in How to create an Under Construction Page with jqueryGuys guys guys,
NOT TRUE.
In regards to a live website which is getting a facelift, leaving the old site running and then instantly launching into the new is the best way to go about things.
HOWEVER
A brand new website SHOULD have a 'holding' page made for it, this holding page may or may not say "under construction" with a fancy countdown if you wish, but it should also have at least a paragraph of "about us" text on it too. Why? Because Google likes mature domains compared to new ones and so it gives you a head start on the very basic SEO. I've seen holding pages for websites with a page rank of 2 or 3. Which isn't much for a website but for a simple holding page that is only a few months old is great!
-
irn3rd reacted to Dizi in Dreamweaver css syntax highlighting within .phpI don't know of a correct way to do it, but you could cheat if you need the css to be highlighted the way dreamweaver does it. Wrap the entire code with <style>, this way both the css and the php will keep their syntax highlighting.
As it is a cheat way of doing it and it is just for an easy way to identify code, remember to remove the <style> tags once you have finished coding
-
irn3rd got a reaction from mebo in isit possible to...From what you've said there it looks like you are going to have to use jQuery.
I'm not that experianced in jquery, just started learning how to use the bae liberary propperly(just learnt how to use the animate function ). But it should be possible to be honest, your just need one parent cotainer with two child containers that overlap depending on what action is active.
Hopefully im reading what you want correctly. If im still understanding in-correctly would you be able to do a mock up of what you want done? say you have it coded but as you said in your OP it would be text above the image, then i can try and crack it out from that, as i can work/understand things better when i have a physical copy to play with.
Ben
-
irn3rd reacted to dmpinder in Side scrolling siteHey Ben,
Do you mean something like this? http://www.queness.com/resources/html/scrollto/index.html
Darren
-
irn3rd reacted to . Jordan . in Side scrolling siteHere's another which explains it
http://woork.blogspot.com/2009/02/useful-tips-to-design-horizontal.html
-
Your image changer on the main page doesn't work in IE8. I guess you haven't tested in it?
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 3.0.30618; .NET CLR 3.5.21022; Media Center PC 5.0; SLCC1; .NET4.0C)
Timestamp: Sun, 5 Sep 2010 13:12:31 UTC
Message: Expected identifier, string or number
Line: 128
Char: 4
Code: 0
URI: http://www.theoldbearinn.com/
Quite rightly it is reporting the error and I suspect strongly you have a comma on the end of line 127 that shouldn't be there.
Like the layout but it's a bit pale and doesn't match the 'warm and friendly'. Additionally the text and headings get lost with each other.
-
irn3rd reacted to Synjyn in Jquery plugin update.Without digging through the code or using something like http://jsfiddle.net/ I expect you will need to be pretty proficient with jQuery.
Why do you need to update it to 1.4? Are you trying to use it on a page with a plugin that requires 1.4?
That seems like the only reason you would want to update it, and if so you can use techniques such as this:
http://web.enavu.com/daily-tip/using-multiple-versions-of-jquery-on-the-same-page/
-
irn3rd reacted to SniderDK in PHP header warningline 1 of /mounted-storage/home125/sub004/sc69689-QJBX/bencleverly.co.uk/qa/login.php is a new line
its mentions it in this part of the error "(output started at /mounted-storage/home125/sub004/sc69689-QJBX/bencleverly.co.uk/qa/login.php:1" FILE:LINE_NUMBER
sorry i dint really read the error, my bad
/* header example */ header('Location: http://localhost/index.php');
-
irn3rd reacted to Jay Gilford in Procedural to OOPOOP is a way of encapsulating related properties and methods together, ultimately to make your life as a programmer easier and faster to create an application
A classic example of a class is a "person" class - Below is a simple one
class person { /* THESE ARE THE CLASS PROPERTIES (ie it's attributes) */ // The persons age private $_age; // The persons name public $name; /* THESE ARE THE CLASS METHODS (functions are called methods in classes) */ // Public method accessible outside of the class to show the persons age public function showage() { echo $this->_age; } // Public method to output hello by the current person public function say_hello() { // Here we call the _getname() method, accessible only within the // class itsself echo 'Hello I\'m '.$this->_getname(); } // This is not accessible outside of the object code private function _getname() { return $this->name; } // The __construct method is always public and is called when the // object is initially created function __construct($age = 20) { // Assign the passed age to the person property $this->age = $age; } }
To create a new person we call it with the new keyword and pass parameters if required (this calls the __construct method in the code above). In this example the $age is optional as it has a default value of 20, so it will assign 20 to the objects age unless we give a value. I've used 25 in the example below.
Next I directly assign a name to the $name property of Jay Gilford. Note that you cannot do this with private variables (like the $_age) - private variables are only manipulated by the class code itself using the $this->_age
$jay = new person(25); $jay->name = 'Jay Gilford';
Note that the syntax to access the properties is $object->property. Methods are similar, only they have parentheses after them, and work just like your average function does
$jay->say_hello(); This runs the say_hello method that would output Hello I'm Jay Gilford. Since the _getname() method is private, you cannot do
echo $jay->_getname(); as again it's only accessible within the class itself
The real benefit of objects is you create a "blueprint" of the object, and can make multiple objects from that object with different properties. Say for example I then go ahead with
$irn3rd = new person(); // Creates a new person with an age of 20 as no age specified $irn3rd->name = 'irn3rd'; // Assigns the name // Show both ages echo 'Jay is'.$jay->showage().'<br />'; echo 'irn3rd is '.$irn3rd->showage(); Which as you can see although they run through the same class, they both show independent values in their properties (25 and 20)
There is far more to objects but this should get you started with the basics
Other than that, I would suggest you look into tutorialized for OOP PHP tutorials for more advanced articles
As a final note, you will notice that I put an underscore before the names of properties and methods that are private. This is NOT a requirement nor does it automatically assign them as being private, it's merely a way of separating the two visually which many programmers adopt in their coding, and I would advise you do the same with your code
Hope that gives you some better understanding and I've not just wasted 25 minutes of my life writing this
Jay Gilford
-
irn3rd reacted to davewilly in Procedural to OOPHey Ben, what is it you are struggling with? Understanding classes & objects or applying it?
btw, did you get your .htaccess working? I replied again, to that thread.
Dave
-
irn3rd reacted to webdeveloper93 in Learning to create a basic forum systemPART 2- Creating Login And Logout Files
LOGIN.PHP
<?php session_start(); //Check to see if session is present if($_SESSION['uid']){ header("Location:index.php"); exit(); } //Include globals and database files require("includes/config.php"); require("includes/global.php"); //Create main php variables for login $user = (isset($_POST['uid'])) ? protect($_POST['uid']) : FALSE; $pass = (isset($_POST['pass'])) ? $_POST['pass'] : FALSE; $error_tri = FALSE; $errors = array(); if($user && $pass){ $sql_check = "SELECT * FROM users WHERE uid = '".$user."' AND pass='".md5($pass)."'"; $rel_check = mysqli_query($con,$sql_check) or die (mysqli_error($con)); if(mysqli_num_rows($rel_check) < 1){ $errors[] = "The username or password you entered is not correct!"; }else{ if(count($errors) == 1 ){ $error_tri = TRUE; }else{ //Create member variable and user session $member = mysqli_fetch_array($rel_check); $_SESSION['uid'] = $member['id']; mysqli_close($con); //Call page redirect redirect(); } } } ?> <html> <head> <title>Login</title> <style type="text/css"> body{ background-color:#CCCCCC; padding:0; margin:0; font-size:12pt; font-family:aral; } .loginbox{ margin:30px 40px 30px 40px; padding:10px 10px 10px 10px; } .login{ border:1px #990000 solid; padding:10px 20px 10px 20px; width:660px; } .login a{ text-decoration:none; padding:15px; margin:4px; color:#993333; font-family:tahoma; font-weight:bold; } </style> </head> <body> <div class="loginbox"> <?php //Include nav function nav(); ?> <!--Login form--> <?php if($error_tri === TRUE){ foreach($errors AS $error){ echo "$error <br />"; } } ?> <form method="POST" action="<?php echo "".$_SERVER['PHP_SELF'].""; ?>"> <p>User Id<br /><input type="text" name="uid" size="33" /></p> <p>Password<br /><input type="password" name="pass" size="33" /></p> <p><input type="submit" name="login" value="login" /></p> </form> </div><!--Login box--> </body> </html>
LOGOUT.PHP
<?php session_start(); if($_SESSION['uid']){ session_destroy(); header("location:login.php"); }else{ header("location:login.php"); } ?>
Thats the end of part 2 i'll have part 3 up tommorow
-
irn3rd reacted to webdeveloper93 in Learning to create a basic forum systemWell i thought i'd show everyone how to build a basic forum system on here i've created one awhile back but it was not to advance so imma show you a more advance one including simple profiles,login,and registration. I won't be able to put the entire thing here now so what i'll do is as i build on it i'll add the new parts to this same post. I must stress though this forum is for learning purposes only cause there are much more powerful forums then this out there already built such as PhpBB.
PART 1-The Registration And The Config And Globals File
First off create a database called forum or you can name it whatever u like
Create a table called users with 9 fields
1. id
2. uid
3. email
4. pass
5. yahoo
6. aim
7. msn
8.admin
9. date_joined
10. ip
Next create a database config file inside a folder called includes
CONFIG.PHP
<?php #DEFINE MYSQL VARIABLES define("HOST","localhost"); define("USER","root"); define("PASS",""); define("DB","forum_tut"); //Connect to mysql $con = mysqli_connect(HOST,USER,PASS,DB) or die("Can't connect to database"); ?>
Next create a file called global inside the includes folder this is where all your functions will be held at.
GLOBAL.PHP
<?php //Protect function function protect($value){ //Make connection variable global global $con; return mysqli_real_escape_string($con,trim(strip_tags($value))); } //Nav function function nav(){ //Show links for when user is not logged in global $con; echo "<div class='nav'>"; if(!$_SESSION['uid']){ echo "<a href='register.php'>Sign up</a>"; echo "<a href='login.php'>Login</a>"; }else{ //Show links for when user is logged in echo "<a href='profile.php'>View profile</a>"; echo "<a href='edit.php'>Edit profile</a>"; $sql1 = "SELECT admin,uid,id FROM users WHERE id = '".$_SESSION['uid']."'"; $rel1 = mysqli_query($con,$sql1) or die (mysqli_error($con)); $member2 = mysqli_fetch_array($rel1); //Check to see if user is an admin if($member2['admin'] == 1){ echo "<a href='admin.php'>Admin Cp</a>"; } echo "<a href='logout.php'>Logout ".$member2['uid']."</a>"; } echo "</div>"; } //Html redirect function function redirect(){ echo "<meta HTTP-EQUIV='REFRESH' content='0; url=index.php'>"; } ?>
Lastly for this part of the forum we will create our register.php file
REGISTER.PHP
<?php session_start(); //Check to see if cookie is present if($_SESSION['uid']){ header("Location:index.php"); exit(); } //Include globals and database files require("includes/config.php"); require("includes/global.php"); //Create some main php variables $username = (isset($_POST['username'])) ? protect($_POST['username']) : FALSE; $email = (isset($_POST['email'])) ? protect($_POST['email']) : FALSE; $password = (isset($_POST['password'])) ? $_POST['password'] : FALSE; $pass_cof = (isset($_POST['pass_cof'])) ? $_POST['pass_cof'] : FALSE; $yahoo = (isset($_POST['yahoo'])) ? protect($_POST['yahoo']) : FALSE; $aim = (isset($_POST['aim'])) ? protect($_POST['aim']) : FALSE; $msn = (isset($_POST['msn'])) ? protect($_POST['msn']) : FALSE; $ip = protect($_SERVER['REMOTE_ADDR']); $submit = (isset($_POST['register'])) ? TRUE : FALSE; $error_tri = FALSE; $success = FALSE; $errors = array(); //--------------VALIDATION------------------- if($submit){ if(!$username){ $errors[] = "Please enter a username!"; } if(!$email){ $errors[] = "Please enter your email address!"; } if(!$password){ $errors[] = "Please choose a password!"; } if($password){ if($password !== $pass_cof){ $errors[] = "Passwords do not match!"; } if(strlen($password) < 6 ){ $errors[] = "Password must be atleast 6 characters long!"; } if(strlen($password) > 64 ){ $errors[] = "Password can not be longer then 64 characters long!"; } } if(count($errors) > 0){ $error_tri = TRUE; }else{ $success = TRUE; $sql = "INSERT INTO users (`uid`,`email`,`pass`,`yahoo`,`aim`,`msn`,`admin`,`date_joined`,`ip`) VALUES ('".$username."','".$email."','".md5($password)."','".$yahoo."','".$aim."','".$msn."','0',now(),'".$ip."')"; $rel = mysqli_query($con,$sql) or die (mysqli_error($con)); mysqli_close($con); } } ?> <html> <head> <title>Register</title> <style type="text/css"> body{ background-color:#CCCCCC; padding:0; margin:0; font-size:12pt; font-family:aral; } .register{ margin:30px 40px 30px 40px; padding:10px 10px 10px 10px; } .nav{ border:1px #990000 solid; padding:10px 20px 10px 20px; width:660px; } .nav a{ text-decoration:none; padding:15px; margin:4px; color:#993333; font-family:tahoma; font-weight:bold; } </style> </head> <body> <div class="register"> <?php //Include nav function nav(); ?> <!--Register form--> <?php if($error_tri === TRUE && $success === FALSE){ foreach($errors AS $error){ echo "• $error <br />"; } } if($success === TRUE && $error_tri === FALSE){ echo "<h2>THANK YOU: For creating an account you may now login</h2><a href='login.php'>Login</a>"; } ?> <form method="POST" action="<?php echo "".$_SERVER['PHP_SELF'].""; ?>"> <p>Username<br /><input type="text" name="username" size="33" /></p> <p>E-mail<br /><input type="text" name="email" size="33" /></p> <p>Password<br /><input type="password" name="password" size="33" /></p> <p>Confirm password<br /><input type="password" name="pass_cof" size="33" /></p> <p>YAHOO<br /><input type="text" name="yahoo" size="33" /></p> <p>AIM<br /><input type="text" name="aim" size="33" /></p> <p>MSN<br /><input type="text" name="msn" size="33" /></p> <p><input type="submit" name="register" value="Sign Up" size="33" /></p> </form> </div><!--Register--> </body> </html>
This finishes part 1 i will have part 2 up tommorow if you enjoyed this part please give me a +1 cheers
-
irn3rd got a reaction from terydinho in Whta is the best way to make .ico filesMy link
Photoshop plugin to save as .ico files :)what i use
Ben
-
irn3rd reacted to Mindprobe Sven in Feedback on my Flash Chat FrameworkHi everybody,
I created a professional Actionscript 3 and XML based Flash Chat framework with looooads of features for developers always wanting to create their own Flash Chat.
I bet up until now I have invested over a 1000 hours of work into this chat. It sort of has become my new hobby
Demo Chat >>
Looking forward to your comments.
Note: If you are interested in this Flash Chat framework and operate a community / portal / news website or a blog / forum, you migh eligible for a free sponsored license of the chat. Email me the URL to your site. Please no porn or warez related sites.
-
irn3rd reacted to Stevo in Recommend a graphics tabletI got one of the smaller Wacom Bamboo tablets, it works fine, and feels nice, but it was too small (I think I pretty much got the smallest one), and since I have a 22" screen I ended up just not using it.
I should have just forked out the bit extra for the slightly bigger model.
-
irn3rd reacted to Dizi in Recommend a graphics tabletIt depends on what you mean by expensive, but the best advice is to get a Wacom tablet, there are other markers and I have tried a couple of them but nothing can compare to the wacom as even their budget range is well made
The cheapest ones are the bamboo series, these can range between £40 to £120 depending on the one you get, they are good well crafted and can be nice to use, but they are the budget range so while nice they do have their limitations.
The sort of mid range would be something like the Intuos which range between £200 and £400 depending on the size you get. This is my dream tablet having used one on a few occasions, one day I will buy one for myself.
Then there is the top end ones of cintiq, which range between £900 and £2000, I think there might be more expensive ones, but this is the sort of graphics tablet most designers just look at and drool over..so worth a mention for you to start drooling too
Anyway a Wacom tablet is a good investment, I got mine about 8 years ago and its still going strong and it was one of the budget ones. So it really depends on what you are wanting to use it for, but my advice if you can afford to go to mid range then do, as there is a big difference between budget and midrange and they can last years and years and years.
-
irn3rd reacted to ElanMan in Little problemTo quote from the php manual regarding the parameter you pass to mysqli_affected_rows():
In other words, assuming $dbc is the variable for mysqli_connect, use $dbc instead of $r as the parameter for mysqli_affected_rows.
-
irn3rd reacted to andylyon87 in Mysql errorHi Ben
$sql = 'INSERT INTO category (id, cat_name, cat_desc) VALUES (NULL, "'.$cat_name.'", "'.$cat_desc.'")';
As you have used single quotes at the beginning of your string you need to use them to escape any variables within it, the full stop is used as a string / variable joiner. Then the double quotes just encapsulate the variable you require inserting.
Try that
Andy
-
irn3rd got a reaction from BritZin in Digital Camera Recycle?I haven't seen one for digital cameras,
Check the manufacturers website?
That might have a policy if you want to recycle it.
Ben
-
irn3rd reacted to traxor in Some wierd problemSee if this works:
body, html { width:100%; height:100%; padding:0; margin:0; } body { background:url(images/background.jpg) #ffffdb bottom right no-repeat; }
-
irn3rd reacted to traxor in Some wierd problemTested it and it works! :
<html> <head> <title>Luke</title> <style type="text/css"> body, html { padding:0; margin:0; width:100%; height:100%; } body { background:url(background.jpg) #ffffdb bottom right no-repeat; } </style> </head> <body> </body> </html>
-
irn3rd reacted to traxor in Some wierd problemYou haven't uploaded the css that I showed you buddy .
-
irn3rd reacted to traxor in Some wierd problemworks fine for me now