Jump to content
Killersites Forums

jp612

Member
  • Content Count

    69
  • Joined

  • Last visited

Everything posted by jp612

  1. Oops, I didn't turn on the rewrite module in WAMP. My problem is fixed now.
  2. Hi, Just started trying some MVC organisation with PHP but I think theres something wrong with my .htaccess since i get this error: "The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log." My htaccess looks like this: RewriteEngine On RewriteBase /test_mvc/ RewriteCond %{REQUEST_FILENAME
  3. except the title thing. Since the isset $GET['page] failed. Which makes sense since the get page stuff is called later on in the document?
  4. Ahh i saw my error. Used your code now.
  5. ohh yes, I have to use a for loop not just a if statement for the title thing. Now all of a sudden i cant use variables i defined in another function, this is my functons.php which i included into my index: <?php // Navbar top. Use array to add content. function get_mainmenu_array() { $menu = array( "1" => array ( "title" => 'Home', "page" => 'home', "url" => "../content/home.php", "desc_title" => "Web Design Services - Affordable Web And Graphic Design Services | Debes Design" ), "2" => array ( "title" => "Our Services",
  6. since my most of my stuff to do with the $GET['page'] function and the loops variale $i is called later in the document (and has to be) does that mean my function that puts in the title at the top of the html page isnt going to work since almost everything used in it will be defined later? if(isset($GET['page'])) { if($GET['page'] == $menu[$i]['page'] ) { echo $menu[$i]['page']; }else{ die("Error!"); } }else{ die("Error!"); } ?>
  7. ok i made a function containing the script. ahh i seem to have more problems. What I want to create a dynamic html page title which grabs stuff from the array depending on which page is included. So i created this <?php if(isset($GET['page'])) { if($GET['page'] == $menu[$i]['page'] ) { echo $menu[$i]['page']; }else{ echo "Error!"; } }else{ echo "Error!"; } } ?> however the isset already fails since the array is loaded later in the document (I also have no idea if the above script will work). So i figured that i'd give my function some parameters so i can only lo
  8. So if I want to put my array and loop into a class along with the second item. Would i do it something like this? <?php class header_menu { var $menu = array( "1" => array ( "title" => 'Home', "page" => 'home', "url" => "../content/home.php" ), "2" => array ( "title" => "Our Services", "page" => 'services', "url" => "../content/services.php" ), "3" => array ( "title" => 'Portfolio', "page" => 'portfolio', "url" => "../content/portfolio.php" ), "4" => array ( "title" => 'Abo
  9. I have actually stopped using Dreamweaver for several reasons: 1. Its ridiculously expensive 2. Its not even that great (in relation to price) 3. It doesn't run natively on Linux (probably wont be your problem) Some features like the FTP site synchronization and upload don't work well. When i try to upload sites (10+mb) the thing takes all night and constantly has some issue. On top of all of that the thing is pretty flimsy and isn't even a proper integrated development environment. PHP programming is about as complex as it gets. It has no support and debugging tools for Java, C++ e
  10. Cool! I finally get loops now. that opened a lot of php doors for me. BTW: I also had a look at the killerphp OOP PHP tutorial. I just have one question about that and functions in general if i define a function,constant,class in a different file i.e class_lib.php or function_lib.php. If i then call it in another file thats in another folder or on the same level how does it (or does it) know that that function, constant, class was defined in some file in my website folder somewhere?
  11. Thanks. I still have a bit of trouble understanding loops. So the $i is a variable that defines the starting value and by using $i++ makes it go up by one number each time the loop is run. The count function is able to count my array items which are numbers. Is all this correct? But why is it $i <= count($menu)?? why could the above method be a security risk? Is it like the $GET function that presents a security risk because everything has to be put into the url so its possible to manipulate it? also how does the htmlentites know which include file to include??
  12. I have created my menu using a multi dimensional array like so: <?php $menu = array( "1" => array ( "title" => Home, "page" => home, "url" => "../content/home.php" ), "2" => array ( "title" => "Our Services", "page" => services, "url" => "../content/services.php" ), "3" => array ( "title" => Portfolio, "page" => portfolio, "url" => "../content/portfolio.php" ), "4" => array ( "title" => About, "page" => about, "url" => "../content/about.php" ), "5"
  13. Sounds like a good idea. I had a look at the paypal security center and apparently they have alot of buyer and seller dispute assistance etc. So for legal concerns i guess they can help out. I but I think billing in 1/3 is good idea especially if its the first time working with the client. Thanks!
  14. I just got a client who is based overseas. Whats the best method of billing? I like Paypal is that a good idea? Also if I charge upfront, what gives the client piece of mind? How can they protect their initial deposit and be sure that I don't run off with it? on the flip side, if I do some work for a client how can I be sure that I will receive my payment? I obviously don't want to have to charge every 3 minutes. Since a email quote/agreement can be a legally binding contract. Can that help protect me if the client is in a different country? So in essence whats a good quoting
  15. Yeah I think your right. I just like to keep my localhost similar to my production server. oh well the header function does the job well. However since alot of my config files in zencart are different to the localhost files I wonder how i will keep them in sync. I have always used dreamweaver to keep my sites in sync over ftp. But now i need to exclude some files from synchronization. I also dont want to have to manually backup and dump the database all the time. Is there something that can help me with this??
  16. Yeah I was afraid that may be the case. although the chdir function didnt work and i used: chdir("zc-gj/"); I have never used that function before so i was interested to see how it works. Does using a header or any re-direct function that redirects to the zc-gj folder slow down the loading time of the site? The whole thing I'm trying to do seems a bit inefficient.
  17. No errors I have already given that a go. when i go to www.gamecat.co.nz/zc-gj it works fine. Its not even working on my local host when i simulate the situation. right now on godaddy it gives an error which i have already fixed. But godaddy hasnt registred the changes again even though i have cleared cache etc. I know that because it creates the same error even if i change the include code to echo "hello"; code it still gives the function include fail error which i have actually fixed. But on the local host it gives a blank screen now and i have all error reporting on.
  18. I recently shifted a ZenCart site to a godaddy shared hosting server. However it requires me to put the whole site inside a their html folder. However I want to put my ZenCart Folder called "zc-gj" into there with all the stuff inside. But of course it doesnt find the index.php file thats in zc-gj folder. So i thought I would create a index.php in the html folder and write: <?php include("zc-gj/index.php"); ?> but all it does is give a blank screen I've tried it on my localhost and it also gives a blank screen there. I have also tried chdir,require & chroot functions b
  19. I have just created my design website and I have used google adwords to advertise since I had a $100 voucher which came with my domain name. I've let it run for 2 days now on a small budget of $8.00 per day. Which gets me around 19 clicks per day. Now I'm totally new to web advertising but I'm starting to wonder why I'm not getting any enquiries through my site. Is 19 clicks even a lot? Also, should I do put a rough pricing list on my site, since I see a lot of other web design sites selling packages and stuff. But I don't get how its possible. I mean a quote for a site depends a
  20. I have actually contacted Godaddy (my hosting) to ask them if there was something on their end but they said it would be all my browsers fault. I have told my Firefox to never cache sites but it still occasionally happens. Its quite strange because the changes usually register automatically after a while and I often check after reboots (coincidentally). I dont think its the browser because when I clear cache on my localhost test server the changes always register. Its only when I check online.
  21. This is really starting to bug me.... on my localhost when i make large css changes the changes register straight away after clearing cache. However on my www site when I upload the changes to the server it never registers the changes even after I clear cache. Usually after some time period when I check the changes do register. I have noticed this with every browser especially IE. Which does it all the time. Other browsers only do it sometimes. Why does this happen?
  22. The wordpress is much easier to setup and understand. I haven't used Joomla! before but I think its similar to Drupal which is one I use. I use wordpress for simpler sites, but for sites that are more complex I would use something else like Drupal. Wordpress does have a lot of good plugins and themes, if your not into making those yourself. A CMS that is more complex is usually more flexible.
  23. Oh i see. So my command didn't really do anything accept always echo the command. Oh well I put in this: <?php if(isset($_GET['page']) == FALSE || $_GET['page'] == 'home') echo "<link href=\"css/home.css\" rel=\"stylesheet\" type=\"text/css\" />"; ?> which basically says: if the $_GET['page'] function isn't being executed OR if it is and its getting the page 'home'. Then echo my css link? It works, great!
  24. For some strange reason one of my php if statements isnt working for opera. Which is odd since the browser has nothing to do with the php right? this is my index.php: <?php session_start(); ?> <!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"> <head> <title> <?php if($_GET['page'] == "design") { echo "Website Design Services - Affordable Website Design | Debes Design"; }else if($_GET['page'] == "graphic") { echo "Graphic Desig
×
×
  • Create New...