jeffkab Posted November 7, 2007 Share Posted November 7, 2007 So I've just taken up PHP and have been hooked on the learning process. I've just got done working a few hours on getting familiar with databases, etc, but now I have a question... I am working on a project in class that has to do with the logic of creating a navigation generator. I've been working around with a flowchart on how to create a horizontal navigation bar with a few links that will be generated via PHP. I will have an .html page where a user can input a specific hexadecimal color code for the color of the buttons, border color, font size, font family, font color, hover stage, etc. Now, as far as I understand, I would create a normal php form that would input this information into specific tables in a database. From here, I would also create a function that outputted the code to the user after he/she inputs the data. Am I on the right track on tackling this project down? Is/Are there any tutorials online similar to creating something along the lines of a generator that plugs information back? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted November 7, 2007 Share Posted November 7, 2007 A simple form can regenerate a new look, navigation buttons, whatever. The saving to a DB isn't necessary to pull this off, but if it's part of the class project, then it shouldn't be much more work. So, for the user input, you'll need to be able to create a form in HTML, then learn how to capture the input into PHP variables and act on them. Start there and don't stress over any database stuff right now. Get the form to work, and echo out locally the variables once you process the form. Then move on to the database stuff if you want. A lot of new coders try to learn both at the same time, and honestly, it's a bit much. Take it one step at a time, and you'll retain the information you learn much better. Please take the time and patience to understand code formatting. You will reap the rewards of this every time you have an error that you need to track down, and it will help you formulate logic and actually see the flow. It will also help us answer your questions when you post code that is easy to read. Welcome to PHP! PhREEEk Quote Link to comment Share on other sites More sharing options...
farkewie Posted November 7, 2007 Share Posted November 7, 2007 If you just want to display the result in the browseryou could try comething like this... <style type="text/css"> <!-- .Text { font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; font-color:#<?php echo $_GET['textcolor']?>; } .button { font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; width:<?php echo $_GET['buttonwidth']?>px; color:#<?php echo $_GET['buttoncolor']?>; } .textfield { font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; } --> </style> this isnt all working just an example Quote Link to comment Share on other sites More sharing options...
jeffkab Posted November 7, 2007 Author Share Posted November 7, 2007 Awesome! Thanks for the help so far guys. Well, the assignment is to understand the logic of the language and to understand why we take certain approaches at certain projects. So for this specific assignment, we were given a basic horizontal navigation bar. The purpose is to create a navigation bar via PHP and to be able to customize is anytime by having it flexible, expandable, etc. Anything else I should look at? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.