-
Posts
322 -
Joined
-
Last visited
Everything posted by CyberShot
-
<?php require_once("includes/functions.php") ?> <?php require_once("includes/connection.php") ?> <?php if(isset($_GET['subj'])) { $sel_subj = $_GET['subj']; $sel_page = ""; } elseif(isset($_GET['page'])){ $sel_subj = ""; $sel_page = $_GET['page']; } else { $sel_page = ""; $sel_subj = ""; } ?> <?php include("includes/header.php"); ?> <table cellpadding="0" cellspacing="0" id="structure"> <tr> <td id="navigation"> <ul class="subjects"> <?php // 4. Use returned data $subject_set = get_all_subjects(); while($subject = mysql_fetch_array($subject_set)) { echo "<li"; if($subject["id"] == $sel_subj) { echo "class=\"selected\""; } echo "><a href=\"content.php?subj=" . urlencode($subject["id"]) . "\"> {$subject["menu_name"]} </a></li>"; $page_set = get_pages_for_subjects($subject["id"]); // 4. Use returned data echo "<ul class=\"pages\">"; while($page = mysql_fetch_array($page_set)) { echo "<li"; if($page["id"] == $sel_page) { echo "class=\"selected\""; } echo "><a href=\"content.php?page=" . urlencode($page["id"]) ."\"> {$page["menu_name"]}</a> </li>"; } echo "</ul>"; } ?> </ul> </td> <td id="page"> <h2>Content Area</h2> <?php echo $sel_subj; echo $sel_page; ?> </td> </tr> </table> <?php require("includes/footer.php"); ?>
-
I am following a tutorial and I can not figure out why my css class isn't working. I have class set to make a link bold when you select it. but it doesn't work for me. $subject_set = get_all_subjects(); while($subject = mysql_fetch_array($subject_set)) { echo "<li"; if($subject["id"] == $sel_subj) { echo "class=\"selected\""; } echo "><a href=\"content.php?subj=" . urlencode($subject["id"]) . "\"> {$subject["menu_name"]} </a></li>";
-
well a big thank you for that. Man that was bugging me. I can't believe I couldn't fix it with css. Thanks again my friend.
-
For the life of me I can not figure out why there is a space around the sidebar on the left. it is seperating itself from the header, footer and left side of the page. I want the sidebar to be flush with everything. I have been trying to over an hour to fix this and can't. Can you give it a shot. I am following a tutorial on making a cms in php. I used a table because the person who made the tutorial used it. <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Widget Corp</title> <link href="style/styles.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="header"> <h1>Widget Corp</h1> </div> <div id="main"> <table id="structure"> <tr> <td id="navigation"> </td> <td id="page"> <h2>Staff Menu</h2> <p>Welcome to the staff area.</p> <ul> <li><a href="content.php">Manage Website Content</a></li> <li><a href="new_user.php">Add Staff User</a></li> <li><a href="logout.php">Logout</a></li> </ul> </td> </tr> </table> </div> <div id="footer">Copywrite 2009, widget Corp</div> </body> </html> body { margin: 0; } #header { height: 70px; margin: 0px; padding: 1em; text-align: left; background: #1A446c; color: #D4e6f4; } #main { margin: 0; padding: 0; height: 600px; width: 100%; background: #EEE4B9; } #structure { height: 600px; width: 100%; } #footer { height: 2em; margin: 0px; padding: 1em; text-align: center; background: #1A446c; color: #D4E6F4; } /* navigation */ #navigation { width: 150px; padding: 1em 2em; color: #d4e6f4; background: #8D0D19; } #navigation a { color: #d4e6f4; text-decoration: none; } ul.subjects { padding-left: 0; list-style: none; } ul.pages { padding-left: 2em; list-style: square; } .selected { font-weight: bold; } /* Page Content */ #page { padding-left: 2em; vertical-align: top; background: #EEE4B9; } #page h2 { color: #8D0D19; margin-top: 1em; } #page h3 { color: #8D0D19; } A huge thank you to anyone who can figure this out. It's bugging me
-
I want to be able to put a box into a standard html website that will allow non coders to update a post into their site without using wordpress or any other content management system. For them to be able to just go to a page on their website, enter a username, password and then have a box appear that they can type into and hit submit have that info pop up into their site. Does anyone know of a tutorial that might exist for this?
-
that's not bad, but javascript can be disabled and thus the password program becomes inefective
-
How hard is it to code a password script to protect an html page? This isn't high security I am talking about. Just a simple password program
-
the new version..dreamweaver cs4. does write better code. It writes css shorthand even. I will also put the css into the external stylesheet. I don't like using dreamweaver to write my code. I do all the code writing. I think people who design a website with dreamweaver only can not call themselves web designers. It is almost insulting to think that they would even try. What I really do like about dreamweaver is the support for ftp, and code writing. If I open a document that has scripts attached to the document, cs4 will automatically open that document is a sub window. That way I can make my changes to the code without having to leave the main page. It will also render code in design view now. If you press the live view button, it will show you your javascript right in the window. I love the ability to hit control + s to save and send my documents to the web server. Then all I have to do is refresh a browser to see how it looks. In the old days, using notepad, I had to minimize the window, find the file on the desktop, open the ftp window, drag and drop, click yes to overwrite then refresh. wow! Dreamweaver took all that away. So yes, I do like dreamweaver for those functions. As for code writing. I do all of it myself.
-
I have wamp installed. I set up dreamweaver to use the wamp as a test server. I have it set on split view right now. I am using dreamweaver cs4 and it rocks. I can enter code and then press the live view button and it displays the results in the design view. No uploading, no entering addy's in the browser, just one press of a button. It also gives me the errors when there are errors. How can you not use dreamweaver?
-
I did buy a book. I am also watching video's on www.lynda.com and testing the code out in dreamweaver using wamp. It's working very good. Then when I get stuck or have trouble understanding something, my plan is to come here to get it sorted properly. I am working hard to learn proper coding skills.
-
as someone who is learning php. I would say that learning to make themes for wordpress is a very good way to learn how to use php. It's growing in popularity amongst web designers for many reasons. One of which is that is has so many plugins that can be added to it. I am going to use wordpress to sharpen my php skills. Maybe when I learn a lot more I will be able to agree with you on it's level of coding. But for now, I can't tell if it's bad.
-
I am not exactly looking for good code there. But the example I posted was perfect for my question. I am learning php so that I can work with wordpress more. Do you think they are bad coders or that the code is just hacked apart by the people who make custom themes?
-
well your input type in your html says test, I do believe it should be text
-
How do I display the latest uploaded picture on a page?
CyberShot replied to pneudralics's topic in PHP Coding Help
are you using any kind of cms? What is your site? -
You're using the 'post' method to post to frmJobApp, so you need to use $_POST[applicant] rather than $_GET (or use method="get" rather than method="post").
-
that chunk of code was taken right out of a wordpress theme. One that comes with the install. I was trying to make sense out of why they would do that.
-
well i can see from what you posted that the style tag is incomplete. I don't know for sure that it matters. but it is suppose to be <style type="text/css"> </style> You should also put those styles in an external stylesheet. that could help you track down some problems. I also noticed that a lot of your rules at the end are missing semi-colons. You really should include them. It is considered sloppy code to leave them out.
-
can you post a link to the site. More info is needed to solve this
-
some of that makes sense. but this doesn't. in the code I posted above. it's all php <?php wp_pagenavi(); ?> <?php } else { ?> why not make that into this <?php wp_pagenavi(); } else { ?> they have it in two code blocks for what apears to me to be no reason
-
I have seen a few times in my studies that people have used the php tags in their code but didn't explain why they did it the way the did. for example One tutorials I am watch is showing this code <?php $ages = array(4, 8, 15, 16, 23, 42); ?> <php foreach($ages as $age) { echo $age . ","; } ?> So my question is. Why put the array in a seperate <?php code block and the foreach loop in another? Is there any reason or just personal preferance? I found the code works both ways. I have see others put each line in a seperate block. Here is an example from a wordpress theme <?php if(function_exists('wp_pagenavi')) { ?> <?php wp_pagenavi(); ?> <?php } else { ?> <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">«</span> Older posts', 'thematic')) ?></div> <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">»</span>', 'thematic')) ?></div> <?php } ?> Why not just put it all in the same tag?
-
this is how you would make a list in html Or you could use ol instead of ul <ul> <li>Bannana</li> <li>Orange</li> <li>Apple</li> <li>Mango</li> </ul> if this isn't what you are looking for, you should explain more.
-
this could be done with css and html. Here is how <div id="backgroundImage"> <div id="smallImage"> <img src="Path to your image" width="size here" height="size here" /> </div><!--end smallImage div--> </div<!--end backgroundImage div --> so you would need to make an html file and the css file linked like this <!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> <link href="stylesheet.css" rel="stylesheet" type="text/css" /> <title></title> </head> <body> <div id="backgroundImage"> <div id="smallImage"> <img src="servlet.jpeg" width="100" height="158" /> </div><!--end smallImage div--> </div<!--end backgroundImage div --> </body> </html> then make a file named stylesheet.css and drop the css code into that file and put it in the same location as the html file #backgroundImage { position: relative; width: 400px; height: 400px; background:url(YOUR IMAGE HERE.jpg) repeat; } #smallImage { position: absolute; top: 30px; left: 60px;} /* CHANGE TOP AND LEFT TO WHAT YOU NEED */
-
ok, that makes sense now. thanks guys
-
these I am guessing are php operators is that correct? -> and => Do they both mean the same thing? I am really trying to understand -> I looked on w3c schools, but they don't have it listed, not that I can find anyway. I also looked on php.net and found this code Method chaining is read left to right (left associative): <?php class Test_Method_Chain { public function One() { echo "One" . PHP_EOL; return $this; } public function Two() { echo "Two" . PHP_EOL; return $this; } public function Three() { echo "Three" . PHP_EOL; return $this; } } $test = new Test_Method_Chain(); $test->One()->Two()->Three(); /* Ouputs: One Two Three */ ?> I am really trying to truly understand what it does, not just to use it but understand how and why it works. Can you spell it out for me? I think I am starting to see how php can be easy to learn. I am in school right now going for a degree in web design. There are just so many codes to learn. I have decided just recently to stick with php and get it figured out since it seems to be able to do so much. As aposed to spending time learning javascript, java, jquery or anything else. Do you have an opinion on that? Thanks
-
help setting a password
CyberShot replied to CyberShot's topic in PHP Installation and Configuration
I figured it out. took a while and ended up getting myself kicked out of phpmyadmin with a password error. took an hour and a half but I got it