Jump to content


Highest Reputation Content


#34105 CSS for web developers

Posted by Andrea on 18 September 2012 - 10:03 AM

CSS will surely take more than a week time to learn, but the thing is you should be perfect in all concepts of CSS to enter into PHP development. Then only you can come to know about PHP.


I totally disagree - CSS is essential for the layout of websites, and directly connected to HTML, but has nothing to do with programming.
  • 2


#52368 Archiving The Forum

Posted by Eddie on 25 July 2016 - 09:15 AM

Too bad. I know I will remember that little ol' frog forever. Frogs Lives Matter!
  • 1


#52085 Proper Usage Of Session

Posted by Ben on 15 November 2014 - 09:39 AM

This link has all the info on creating a library, including the basic template for a library file, loading the library (you can either use load->library(), or you probably want to consider autoloading it), and calling a method within the library: https://ellislab.com..._libraries.html

 

Basically, you just need to create a "load" method that will accept the view parameter. For example:

 

public function load($view) {   }

 

Inside that method, you determine whether or not the user is an admin user, and then load the appropriate views. So you'd call it something like this:

 

$this->Template->load('containt/home');

 

and then within the method, it would check if you are an admin user, and load all the appropriate views for either situation. This way, you reduce repetition and have one central location that controls what header/footer views are displayed. In your controllers, you'd just need one Template->load line, rather than multiple $this->load->view.


  • 1


#52066 Opinion On Portfolio Site

Posted by Andrea on 23 October 2014 - 06:06 AM

I guess it depends on where you look. But from here: http://www.w3schools...ew_elements.asp and here https://developer.mo...L5_element_list I'd take it a bit differently.Also, I would hope that the actual meaning of the word section and article was considered during the development of html5.


  • 1


#52059 Proper Usage Of Session

Posted by Ben on 22 October 2014 - 03:21 AM

I suppose technically, it would be put in the libraries folder. But I wouldn't consider it a helper, since my undertstanding is that most helpers are there to add minor functionality within the views. In this case, you'd want to build out a template library that controls how/what views are displayed.


  • 1


#51659 Site Hacking

Posted by Lita on 10 June 2014 - 10:32 AM

How do you know that your site has been hacked? What do you do if your site has been hacked? Also, what does it really mean that your site has been hacked? Just that someone has gotten into your database?

 

Thanks! 

xoxo

Lita


  • 1


#51610 Bluehost Dedicated Hosting Any Good?

Posted by beermantm on 06 June 2014 - 07:25 PM

Thank you, Andrea, but I'm well aware of Google and how to use it. I had already read through dozens of mixed reviews and am also aware that some of them are fake (as often times happens with online "reviews") and were posted by people who have a vested interest in the success of their business. Apparently asking for some real world reviews by real people who have used this hosting service was too much to ask. If you feel my original post was inappropriate please feel free to delete it. 

 

I wouldn't go with godaddy either. I would stay as far away from fatcow as I could. Fatcow is garbage with their perl ran servers. You know if you want fast and reliable there is rackspace which might be overkill depending. You could always try a block for free at dotblock, amazon web service or google. Dotblock has ssd drives which would definitely serve up pages quicker. Time to first byte seems to be a problem with any shared hosting and some higher cost servers. 

 

I'd probably go with a cloud service like amazon that will expand along with your site and you might pay a bit extra but virtual servers like AWS have great upsides for the extra but smaller premiums they charge. 

 

All hosting companies get mixed reviews, however your best bets are virtual cloud based servers in my opinion.

 

Just read your new post. maybe go with AWS. you can even consider using NGINX as your server. I've heard people dropping huge dollars on dedicated hosting and still being very upset. 


  • 1


#51327 How Old Is Stef!

Posted by Eddie on 30 April 2014 - 10:28 AM

When Stef uses a photo to make himself look younger you have to know for certain that dirt is younger than he is. :)


  • 1


#51263 Ie7 Not Displaying Menu Properly - Stacked Instead Of Horizontal

Posted by Stefan on 22 April 2014 - 11:24 PM

Now I am sure someone will try to answer your questions directly regarding the IE7 bug ... but you have to ask yourself if it's worth even bothering with this old buggy browser that very, very few people use today.

 

Take for example web browser user stats from Wikipedia - probably a very accurate and even account of what is going on in the broader Web:

 

http://stats.wikimed...portClients.htm

 

... And in their samples, IE7 is used 0.98% of the time! On the W3C ... it is 0%.

 

If it works on IE 10-11 and the other browsers, I think you are good.

 

Stef


  • 1


#51118 Php Form

Posted by Ben on 03 April 2014 - 03:28 PM

I'd suggest watching the "PHP and Javascript Form Validation" series. While it covers building a contact form, rather than a survey form, you'll be using the exact same approach and techniques when building your form.


  • 1


#50996 New (Validating) Members - Read This!

Posted by Stefan on 26 March 2014 - 01:09 PM

Hi!

 

If you did not get your validation email, just email me directly at:

 

stefan@killersites.com

 

... And I will update your account so you can use the forum.

 

PS: remember to include your forum user ID.

 

Thanks,

 

Stefan


  • 1


#50684 Php Framework Vs Cms

Posted by Ben on 13 February 2014 - 07:36 PM

Sorry, you're going to have to rephrase the question, since I'm not sure what you are asking.

But my original point still stands. A CMS is a web application. A framework is a pre-built structure that you can use to build web applications quicker/easier than starting from scratch. Think of it this way: a CMS is a fully built house. A framework is the plans for the house.
  • 1


#50680 Php Framework Vs Cms

Posted by Ben on 13 February 2014 - 01:24 PM

They are different things.

-- A CMS is a web application for content management -- usually to do with an informational website, ecommerce store or blog, allowing a user to edit the content without needing to know HTML/CSS or to code by hand.

-- A PHP framework is used to build web applications, quicker and easier than by starting from scratch. You could use a PHP Framework to build a CMS, an ecommerce platform, a social networking platform, etc.

Basically, a CMS is a web application, and a framework can be used to build web applications. For example, Expression Engine CMS is built on a version of the CodeIgniter framework.
  • 1


#50668 Laravel

Posted by Ben on 11 February 2014 - 09:43 AM

As far as I understand it, that code allows you to automatically determine where the site is running, and what environment it is running in. For example, you may be running it in several places -- perhaps locally on your computer, on a hosted development site, or live online for anyone to view -- an in each case, you're likely to have a different database setup, and perhaps certain code (logging, for example) would run only under your development environment. The environment variable allows automatic switching between environments based on the host name, and you can then use

App::environment()

to determine which environment you're running under and thus perform specific actions.

See http://laravel.com/d...t-configuration for more, or do a Google search for "laravel environment".
  • 1


#50644 Codeigniter

Posted by Ben on 08 February 2014 - 11:18 AM

Which book are you talking about?

And no, CI_Controller can't simply be replaced. Where are you trying to use "Controller"? Have you tried using "CI_Controller", in instances where you would use "Controller" based on your book?

...one thing to note though... The future of CodeIgniter is a bit up in the air at the moment (see http://ellislab.com/...for-codeigniter). Much of the community has switched over to Laravel (http://laravel.com/), so if you are considering learning a PHP framework, that's the one I'd suggest. The learning curve is a little steeper, but give you shorter, better, more manageable code. For some tutorial options (there are a lot of resources out there!), check out:

-- Online documentation: http://laravel.com/docs
-- Video tutorials (free): http://hub.tutsplus....laravel&button=
-- More video tutorials (free:) http://code.tutsplus...tery--net-31233
-- Video tutorials ($9/month): https://laracasts.com/
-- Book ($29, you might be able to find places to download it online?) https://leanpub.com/codebright
  • 1


#50625 E-Commerce

Posted by Eddie on 06 February 2014 - 09:13 AM

Well yes if you plan on making a ecommerce from scratch or want to do extensive programming. Otherwise, I would use one of the many ready-made open source shopping cart that are out there, ZenCart, osCommerce, etc. There are also paid versions which could run from just a few dollars into the several hundred dollars.

Finally, you can use a online shopping cart which is where you create a account and purchase a plan that varies in monthly/yearly cost but you will have just about everything and updates are always taken care of for you. There might be some limitations to customization or programming but a good online service will give you adequate access to make some modifications.
  • 1


#50107 Basic Php System: View/edit/delete/add Records

Posted by Ben on 18 December 2013 - 11:30 AM

Problem is when i click on edit file in view-page.php it shows all the data as "Array"


Check this section of your code, and compare it with my code -- specifically, the "get data from db" section.

// check that the 'id' matches up with a row in the databse
 if($row)
 {
 
 // get data from db
        $Volunteer=['Volunteer'];

My impression is that these lines: $Volunteer=['Volunteer']; need to be something like this: $Volunteer=$row['Volunteer']; (Check my code -- this is just off the top of my head.) The way you currently have it, you are passing in an array element, not giving those variables values from the database.

As for search, that's a little outside the scope of the tutorial. You might want to check out http://www.webrefere...arch/index.html, or do a web search for "php database search" or similar, and you should find some direction.
  • 1


#43628 If Returns False Even Though True

Posted by terrence on 04 May 2013 - 04:08 AM

This morning I tried:
if ('290662176e3fece19eba2b3c1a032ee3' != '290662176e3fece19eba2b3c1a032ee3')
And this worked as expected. I did wonder if the problem was due to the single quotes, however removing them with the above example generates a blank page with an error, unlike when using the variables and then my own error is displayed as it should, NOT equal, when they are.
Below is the page in question:

if (isset($_POST['new_pass_submit']))
{
	// if any blank then send alert redirect
	if ($_POST['current_password'] == '' || $_POST['new_passw'] == '' || $_POST['new_passw2'] == '')
	{
		if ($_POST['current_password'] = ''){$Temp->set_data('error_current_pass', 'isrequired');}
		if ($_POST['new_passw'] == ''){$Temp->set_data('error_new_passw', 'isrequired');}
		if ($_POST['new_passw2'] == ''){$Temp->set_data('error_new_passw2', 'isrequired');}
		
		$Temp->set_alert('Please fill in all required fields', 'app_error');
		
		// set data so any fields filled in are displayed, clean first!
		$Temp->set_data('log_current_pass', $_POST['current_password'], TRUE);
		$Temp->set_data('log_new_passw', $_POST['new_passw'], TRUE);
		$Temp->set_data('log_new_passw2', $_POST['new_passw2'], TRUE);
		
		// load view and exit
		$Temp->load('app/views/v_change_pass.php', 'Change Password');
		exit();
	}
	if ($_POST['current_password'] != '' || $_POST['new_passw'] != '' || $_POST['new_passw2'] != '')
	// check all fields are between 8 and 20 chars, if not set alert
	{
		/*// set data so any fields filled in are displayed, clean first!
		$Temp->set_data('log_current_pass', $_POST['current_password'], TRUE);
		$Temp->set_data('log_new_passw', $_POST['new_passw'], TRUE);
		$Temp->set_data('log_new_passw2', $_POST['new_passw2'], TRUE);*/
		
		if (strlen($_POST['current_password']) < 8 || strlen($_POST['current_password']) > 20)
		{
		$Temp->set_data('error_current_pass', 'isrequired');
		// set alert load view and exit
		$Temp->set_alert( 'Your password must be between 8 and 20 characters long', 'app_error');
		$Temp->load('app/views/v_change_pass.php', 'Change Password');
		exit();
		}
		if (strlen($_POST['new_passw']) < 8 || strlen($_POST['new_passw']) > 20)
		{
		$Temp->set_data('error_new_passw', 'isrequired');
		// set alert load view and exit
		$Temp->set_alert( 'Your password must be between 8 and 20 characters long', 'app_error');
		$Temp->load('app/views/v_change_pass.php', 'Change Password');
		exit();
		}
		if (strlen($_POST['new_passw2']) < 8 || strlen($_POST['new_passw2']) > 20)
		{
		$Temp->set_data('error_new_passw2', 'isrequired');
		// set alert load view and exit
		$Temp->set_alert( 'Your password must be between 8 and 20 characters long', 'app_error');
		$Temp->load('app/views/v_change_pass.php', 'Change Password');
		exit();
		}
	}
	//  if passwords dont match - (new and confirmed new)
	if ($_POST['new_passw'] !== $_POST['new_passw2'])
	{
		// set errors and  alert
		$Temp->set_data('error_new_passw', 'isrequired');
		$Temp->set_data('error_new_passw2', 'isrequired');
		$Temp->set_alert('New Password fields do not match!', 'app_error');
	
		// redirect back
		$Temp->load('app/views/v_change_pass.php', 'Change Password');
		exit();
	}
	else
	{
		//  else everything ok so first check pass in db matches with current pass
		//  so only user can change pass

                // i did start with a method in the if()which was passed the md5 of post current pass and the user id ,
                /*  function check_current_passw($id, $cp)
	            {
		          $dbp = $this->get_current_passw($id);
		          if ($dbp != $cp)
		          {
			     do stuff;
		          }
	            }
                */ 
                // this method used $Acc->get_current_pass() to get pass from database using the id
                // this is when problem started, I originally thought that method held the problem so I removed it and added whats below
                 
		$cp = md5($_POST['current_password'].'1may2013');      //salt added directly - change later
		$db_cp = $Acc->get_current_passw($_SESSION['the_id']);
		
		if ($cp != $db_cp)
		{
				// error , passes dont match
				// set alert, error class, and redirect
				$Temp->set_data('error_current_pass', 'isrequired');
				$Temp->set_alert('Current password is incorrect!<br/>'.$cp.'<br/>'.$db_cp.'', 'app_error');
				$Temp->load('app/views/v_change_pass.php', 'Change Password');
		}
		else 
			// passwords match, change password
		{
			$Temp->set_data('clean_new_pass', md5($_POST['new_passw'].'1may2013'), TRUE);
			if($Acc->enter_new_pw($Temp->get_data('clean_new_pass',FALSE), $_SESSION['the_id']))
			{
				//if value changed successfully alert redirect
				$Temp->set_alert('Password has been changed!');
				// clear values
				//$Temp->set_data('clean_new_pass') = '';
				$Temp->load('app/views/v_temp_success.php', 'Change Password');
			}
			else
			{
				$Temp->set_data('error_current_pass', 'isrequired');
				$Temp->set_alert('Could not update password! Please try later');
				$Temp->load('app/views/v_change_pass.php', 'Change Password');
			}
			
		}
	}
}
else
{
// form not submitted load form view
$Temp->load('app/views/v_change_pass.php', 'Change Password');
}

This could probably be done a lot better, however I am still learning and this is for a college assignment so please excuse me.
  • 1


#28417 Basic PHP System: View, Edit, Add, Delete records with MySQLi

Posted by Ben on 21 October 2011 - 08:01 PM

the $row[0] is a variable that holds the id of the record, creating a url that includes the id, like this: "records.php?id=12". On the records page, you can use $_GET[] to get the id and know which record you want to edit.
  • 1


#22 I think we should make both of these well known.

Posted by PicnicTutorials on 19 December 2008 - 05:36 PM

These are both free screencast programs that run in the browser (no software download required). I looked into all of them, and these two seem to be the easiest and most appropriate for forum questions. I believe either of these services would cut down on the confusion we've all experienced with some of the more visual based questions. See for yourself. I made a test video for each. They were both equally easy to produce.

SceenToaster and Test Video

Screen-O-Matic and Test Video
  • 1


★★★★★ 5 Star Rated Web Developer Course - check it out now!