Jump to content

Love2c0de

Members
  • Posts

    364
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Love2c0de

  1. Good evening, I see so it is possible but would require some setup. I've been developing live for the last few weeks but is handy to know when I need to go local! Kind regards, L2c.
  2. Good evening, Where are those values generated from? Database, file, javascript, hard-coded? Kind regards, L2c.
  3. Awesome, figured it out. This works: RewriteEngine on RewriteBase / RewriteRule ^/?([a-zA-Z_]+)$ index.php?page=$1 [L] Kind regards, L2c.
  4. I've also just done the exact same thing but using JavaScript. Better to go for server-side though! Kind regards, L2c.
  5. Hi there, I bought a domain and would like to use the mod_rewriting on this site. I noticed from previous help hat we used RewriteBase /Gardenable/ as the base url for http://www.labtec.0fees.net/Gardenable/?page=Home But, on my new domain, it's just http://www.tspv-websites.co.uk/?page=Home I tried all kinds of values to use as the base url on my new domain and have even taken it out but it's returning an error that it cannot find the specified URL. Can anyone see what I need to do? The .htaccess fie is in the root public_html. Here is the .htaccess file as it stands: RewriteEngine on RewriteRule ^/?([a-zA-Z_]+)$ index.php?page=$1 [L] Thank you for your time. Kind regards, L2c.
  6. Good afternoon, I'm on Windows 8 Pro. Thank for your reply. Kind regards, L2c.
  7. Good evening, I seem to remember not being able to send emails on localhost. Is there a possible workaround? I've got no internet at home and want to test an email script. Kind regards, L2c.
  8. Good evening, I believe you are executing the query twice. Here: $con->query($sql); and Here: if (!mysqli_query($con,$sql)) I'd guess you were meant to be checking the return value of query instead of running the query again. Kind regards, L2c.
  9. Thanks for all your inputs. I will just get to work on studying and trying to pull a decent porfolio together. Last question, how many personal sites could you class as a portfolio - 3,4,5? Kind regards, L2c.
  10. Thank you for all the input. Due to having 2 children and a decent job already, going to University is totally out of the question for my situation which is why I was opting for an Open Uni degree where you study at home in your own time but still come out with a degree at the end of it. Looking at Open University website yesterday, I found a Computer Science degree but they wanted £15,000 which quite frankly is far too much. Even if I had that kind of money to spend on a course, I wouldn't. What other options can I explore in terms of getting a qualification which employers will 'recognise' as being worthy enough? Who is the professional body that deals with website based qualifications? Kind regards, L2c.
  11. Thank you all very much for your answers. I'd like to get my foot on the ladder as I have no previous experience within the field. I work for an online company at the moment and realize the dedication you need to have to do a decent job as a developer as I'm always emailing ours asking him to change things and revert back to previous ways of doing things. I can develop a site to a 'workable' standard I suppose but my design skills are terrible. I can't seem to design something which looks slick, always appears to be very basic. I'm more interested in actually developing websites rather than designing as I've grown fonder of developing over the last 2 or so years. What do you guys and gals actually do? Are you more design oriented or moreso the other way and what would you suggest would be the 'easiest' to get into? I suppose it could just be a case of actually getting some kind of portfolio together in which the sites displayed would be very slick and dynamic but at the same time I think half of my trouble is coming up with an idea for a good website which people would actually use and visit. I seem to get maybe 25% through a project only to find something pretty similar on the net (with better design). I always do some research before starting any project but always seem to stumble across similar sites once started coding. Thanks again, I'll check in when I get a chance! Regards, L2c.
  12. Good afternoon all, I've been looking at Open Uni Degrees and noticed it's mainly 'Computer Science' degrees but I would like something more pertinent to web design & development. Can anyone advise on the best route to becoming qualified in web design and development? When I search for Web Development jobs in the UK, they only request for relevant experience and preview of code, they never really ask for qualifications. Are they really needed within this industry or is it a case of 'if you can prove your ability, you have a good chance'. Not sure if I'm barking up the wrong tree here. Can anyone advise? Kind regards and thanky ou for your time. L2c.
  13. Good morning, Sorry for the late reply. Well, I've fixed the problem of the second div moving when the first div is hovered. Add clear: right to the #secondmenu div before the float declaration. That's fixed but it seems to shift the 2nd div down the page quite a bit. Hope it helps you. Regards, L2c.
  14. Good morning, I can only see 1 div - the second one. Regards, L2c.
  15. That's great, thank you for your advice. I think I will process the form data within the template page so that I am not forced to redirect the user and use sessions. Kind regards, L2c.
  16. PHP number plate! :)

  17. Thank you requinix, Is it bad practice to use the session for the data or is it something which is accepted to use? When you say 'sticky', if I was to do the form processing within the same file, could I create that affect and would it be a more efficient way to do it? Thank for reply. Kind regards, L2c.
  18. Good morning, I have a simple 1 page website which I'm working on and I'd like to be able to fill the input/textarea field(s) with any $_POST data should they get re-directed back to the form. I've tried adding: <input type="text" value="<?php if(isset($_POST['name'])){ print($_POST['name']); } ?>" /> but it doesn't seem to be working. I'm using header("Location: ../index.php#contact_form"); within my action script if any of the required fields are empty. Here is my full code: <form id="contact_form" method="post" action="core/process_form.php"> <p><label for="name">Name:</label><input type="text" name="name" id="name" />* <span class="error">Cannot be empty!</span></p> <p><label for="number">Number:</label><input type="text" name="number" id="number" /><span>( Optional )</span></p> <p><label for="email">Email:</label><input type="text" name="email" id="email" />* <span class="error">Cannot be empty!</span></p> <p class="textarea"><label for="comment">Comment:</label><textarea name="comment" id="comment" cols="35" rows="10"></textarea></p> <p class="input"><input type="submit" value="Send" onclick="return process_form()" /><input type="reset" value="Clear" /></p> </form> Action Script //get post data echo "<pre>"; print_r($_POST); echo "</pre>"; foreach($_POST as $k => &$v) { $v = trim($v); } if($_POST['name'] == "" || $_POST['email'] == "") { header("Location: ../index.php#contact_form"); die(); } Thank you in advance for any info! Regards, L2c.
  19. I'll sit down tonight when I get a minute and try researching this. It's much better after your help though and it will help SEO with the links which is good. Kind regards, L2c.
  20. Absolutely fantastic, thank you so much. Finally got there in the end. - well nearly! How would I now deal with multiple $_GET values in a URL string? For example when I click on a link on my products page for example "Planters", it reloads but it shows the URL as http://www.labtec.0fees.net/Gardenable/Products?page=products&order=planters and it doesn't only show the Planters, it shows Planters and Bird Housing still (this is default). It's as if my $_GET['order'] value isn't being read. Kind regards, L2c.
  21. Good evening, I have a main index.php script which uses php at the very top to determine which template file to load into my #container div, depending on the $_GET value passed. Here it is: <?php include("core/init.inc.php"); //array containing the possible values of the form select lists, also used to select a specific product to display only information relating to //that product (on the products page). $get_values = array("bird_housing","planters","default_product","default_service","decking", "fencing","exterior_buildings","furniture_repairs","jet_washing"); if(isset($_POST['name'])){ require("core/process_form.php"); } if (isset($_GET['page']) && $_GET['page'] == "products") { if (isset($_GET['order'])){ if(in_array($_GET['order'],$get_values)){ require("core/get_products.php"); } else{ header("Location: index.php?page=products"); die(); } } else{ require("core/get_products.php"); } } if(isset($_GET['page']) && $_GET['page'] == "display"){ if(!empty($_GET['id'])){ require("core/get_specific_product.php"); } else{ header("Location: index.php?page=home"); die(); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?php echo "Gardenable - ".$title; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" type="text/css" href="css/style.css" /> <link rel="stylesheet" type="text/css" href="css/font_style.css" /> <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> </head> <body> <div id="container"> <!--HEADER CONTENT--> <div id="header"> <img src="images/gardenable1.fw.png" alt="Gardenable Logo" title="Gardenable" id="logo" name="top" border="0" /> <div id="navigation_div"> <img src="images/flowerbed.fw.png" alt="Navigation Image" id="flowerbed_img" border="0" /> <ul> <li><a href="?page=home">Home</a></li> <li><a href="?page=about">About</a></li> <li><a href="?page=products">Products</a></li> <li><a href="?page=services">Services</a></li> <li><a href="?page=contact_us">Contact Us</a></li> </ul> </div> </div> <!--END HEADER CONTENT--> <!--BREADCRUMB DIV--> <div id="breadcrumb_div"> <?php print("<p id='crumb'>".$crumb."</p>"); ?> </div> <!--END BREADCRUMB--> <!--MAIN CONTENT--> <?php include($include_page); ?> <!--END MAIN CONTENT--> <!--FOOTER CONTENT--> <div id="footer"> <p id="copyright"> <span class="yellow">Tel:</span> 01255 722 960<br /> <span class="yellow">Email:</span><a href="mailto:[email protected]"> [email protected]</a><br /> <span class="yellow">Gardenable.com</span> <span style="font-size: 18px;">©</span> Copyright 2013</p> <p id="footer_content"> <img src="images/css_validated.jpg" alt="CSS Validated" title="This site is CSS Validated." id="css_icon" /> <img src="images/html_validated.jpg" alt="HTML Validated" title="This site is HTML Validated." id="html_icon" /> </p> <hr class="form_hr" style="margin: 0%;" /> </div> <!--END FOOTER CONTENT--> </div> <p id="pageviews"><?php echo "Page Hits: ".$page_views; ?></p> <div id="sidebar"> <a href="#top">Back to top</a> </div> </body> </html> The very first line is an include() statement. That init.inc.php file is what sets up the page to display, the breadcrumb effect, the page views and the title. Here is the code: <?php if(empty($_GET['page'])){ header("Location: ?page=home"); die(); } $dir = dirname(__FILE__); $pages = scandir("{$dir}/pages"); unset($pages[0],$pages[1]); foreach ($pages as &$page){ $page = substr($page, 0, strpos($page, '.')); } if(in_array($_GET['page'], $pages)){ $title = $_GET['page']; $uri = $_SERVER['REQUEST_URI']; $uri = substr_replace($uri, $title, strrpos($uri, "/") + 1); $include_page = "{$dir}/pages/{$title}.template.htm"; } else { header("Location: ?page=home"); die(); } $title = ucwords(str_replace("_", " ", $title)); //everytime this file is accessed, I class it as a page hit. $page_views = file_get_contents("{$dir}/page_views.txt"); $page_views++; file_put_contents("{$dir}/page_views.txt", $page_views); //breadcrumb effect below........ //gets rid of the first / in the directory string $uri = substr_replace($_SERVER['REQUEST_URI'],"",0,strpos($_SERVER['REQUEST_URI'],"?")+1); //explodes string into an array $root_array = explode("&",$uri); if($_GET['page'] == "display") { array_unshift($root_array, "=products"); } if(in_array("ref=".$_GET['ref'],$root_array)) { array_pop($root_array); } //counts array length $len = count($root_array); foreach($root_array as $k => &$v) { if(substr_count($v, ".")) { $v = substr_replace($v, "", strpos($v, ".")); } $v = substr($v,strpos($v,"=")+1); $v = ucwords(str_replace("_"," ",$v,substr_count($v,"_"))); $v = "<span class='bread'>".$v."</span>"; } $crumb = "You are here: ".implode(" -> ",$root_array); ?> So you can see where I set the content to display. My directory is like so: <Gardenable> index.php <core> init.inc.php <pages> home.template.htm about.template.htm products.template.htm etc etc I put the .htaccess file in every directory but it had the same effect. I think it's the actual mod_rewrite statement for sure. Thank you for your time. Kind regards, L2c.
  22. What I mean is that I will have to change the RegExp to accommodate the underscore in contact_us? I'm not quite sure where I'm going wrong and still haven't got to grips with it. Can i activate this on localhost so I can test it locally? It's a pain navigating through my host. Kind regards, L2c.
  23. Good evening, Thank you for your reply. I put that in my .htaccess but it keeps taking me to a securesignup page @ http://securesignupoffers.org/g/ One of the template files are called contact_us, do I have to compensate for that within the reg exp? Regards, L2c.
  24. Awesome, it is enabled. When I add your code to the .htaccess file in htdocs, the string in the URL is: http://labtec.0fees.net/Gardenable/home?page=home Any thoughts? Kind regards, L2c
  25. ^^ That could be a good idea... I will, I just thought it was disabled or not allowed as when I put your code in my .htaccess file, it gave an error. Will report back! Regards, L2c.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.