djdellux Posted November 10, 2008 Share Posted November 10, 2008 i am brand new to coding/programing and am starting with php at me new job. i have a 3 month deadline to produce some worthy code. please do any of you have suggestions on where to start? possibly any sites/texts that may help me out? thanks for your time in reading this post and any help will go highly appreciated. -dellux Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/ Share on other sites More sharing options...
The Little Guy Posted November 10, 2008 Share Posted November 10, 2008 first you may want to start with the basics: http://us3.php.net/manual/en/language.basic-syntax.php Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-686720 Share on other sites More sharing options...
waynew Posted November 10, 2008 Share Posted November 10, 2008 Firstly; if you're completely new to coding: I would suggest some background reading. Here's a Wikipedia article on PHP. http://en.wikipedia.org/wiki/PHP The first thing to do is understand what PHP is. After that you need to set up a server enviornment on your home computer in order to run PHP code. Fortunately, there are plenty of tutorials on how to install such an enviornment. If you're using Windows, the kind of envionrment that you'll probably want to set up is called WAMP. Here is a background article on what WAMP actually is: http://en.wikipedia.org/wiki/WAMP Here are some tutorials that I've found that show you how to setup a WAMP enviornment on your own computer: http://www.google.ie/search?sourceid=navclient&hl=en-GB&ie=UTF-8&rlz=1T4GZAZ_en-GBIE244IE245&q=Setup+WAMP If you don't have time to do all of that, or are having difficultly in setting it up, go to http://000webhost.com and setup a free hosting account to test and run your code on. Then, I'd suggest that you start with the very basic tutorials on W3Schools: http://www.w3schools.com/PHP/DEfaULT.asP After that, you should have a basic knowledge of PHP. Also make sure that if you have any problems or questions along the way; to post here because there's always a few guys willing to help out. Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-686731 Share on other sites More sharing options...
djdellux Posted November 10, 2008 Author Share Posted November 10, 2008 i will be checking out your guys suggestions over the next few hours here at work. the provide me with a test server to post my codes (well except for my hour ill be on lunch lol). thanks to the both of you for your help in this matter and i will get back to you if i run into any other problems with the PHP monster. thanks again -dellux Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-686786 Share on other sites More sharing options...
djdellux Posted November 10, 2008 Author Share Posted November 10, 2008 well, i have been jamming thru the basics until i came upon arrays... this section is somewhat confusing to me. not in the basic context way but more so the application way... any help to see the end to this tunnel lol thx -dellux Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-686878 Share on other sites More sharing options...
premiso Posted November 10, 2008 Share Posted November 10, 2008 Arrays store data for easy access without having to have 1,000 variables of which you have to define or find a name for. It also allows for easy searching etc. Think of an array like a Train. You have multiple cars which can store different items. One car may store coal, another may store grain, another may store hay. In order to access that car you can say I want car that is in position 1, which would be coal. It would tell you there is coal in that car. Or you can say I want the grain car, for associative arrays, which would then return what is in the grain car. You can also say I want to search through all cars until I find the hay and tell me what position it is in. This would return that hay is in position 3. I am not sure a better way to explain arrays, but they are basically a collection of data that can be accessed by an index, such as the cars being in position 1 2 or 3. Hope I did not muck things up, but yea. That is the best I can explain them, just a collection of data. Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-686884 Share on other sites More sharing options...
djdellux Posted November 10, 2008 Author Share Posted November 10, 2008 PREMISO ************* well done mate. that hit the nail on the head for me i was trying to come up with something that way but???... notta... thanks lots -dellux Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-686917 Share on other sites More sharing options...
djdellux Posted November 10, 2008 Author Share Posted November 10, 2008 ON TO CLASSES,.,.,.,., ??? Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-686919 Share on other sites More sharing options...
Maq Posted November 10, 2008 Share Posted November 10, 2008 Some great basic PHP resources: Tizag W3 Schools Good luck! Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-686920 Share on other sites More sharing options...
premiso Posted November 10, 2008 Share Posted November 10, 2008 Classes are pretty intense. The best way to comprehend them is a class houses an object, lets say a cookie. Each cookie can be a different kind of cookie, you have chocolate chip, nuts, sugar etc. So the class would then have properties to describe the cookie say, name, type, color and age. Using a class you can set any of the properties to be different. Now let's say we have another class which we will call a bake class. This class can inherit the cookie class, meaning it takes the functions and allows you to use them. So you can bake many cookies of different types and be able to keep track of them. I know this is a rough example but Object Oriented Programming is much more than what I described. But hopefully the above gives a basic gist of what it is about, storing object information for easy access/manipulation. Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-686954 Share on other sites More sharing options...
djdellux Posted November 10, 2008 Author Share Posted November 10, 2008 classes down...not well but past them none the less, premiso, yet another great explanation. keep um coming. Now time to work with strings... thanks everyone -dellux Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-687040 Share on other sites More sharing options...
djdellux Posted November 11, 2008 Author Share Posted November 11, 2008 I have a task at hand... i need to use a DB to archive info and put it into input Fields. now i have jammed my head full of code over the last 2 days and for some reason i cant figure how to get this ball rolling...any suggestions would be greatly appreciated. thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-687729 Share on other sites More sharing options...
Adam Posted November 11, 2008 Share Posted November 11, 2008 I imagine you're to use a MySQL database? http://www.tizag.com/mysqlTutorial/ That will introduce you to MySQL and creating DB applications with PHP. Adam Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-687733 Share on other sites More sharing options...
djdellux Posted November 11, 2008 Author Share Posted November 11, 2008 adam you are correct in assuming the mysql which i have a lil book sitting next to me i am referencing. the problem is i just dint know where to start lol. deff feel like a newb here. Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-687749 Share on other sites More sharing options...
Maq Posted November 11, 2008 Share Posted November 11, 2008 Do you have access to a web app like PhpMyAdmin? If you do then it's very easy to create tables and fields. What exactly are you trying to accomplish? How are you inserting into the database? Please show us some sort of code we can work with... Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-687784 Share on other sites More sharing options...
djdellux Posted November 12, 2008 Author Share Posted November 12, 2008 OK well here's the task to accomplish i need to ****Make a GUI for logging DB**** uhhh how to do???? Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-688408 Share on other sites More sharing options...
djdellux Posted November 12, 2008 Author Share Posted November 12, 2008 <?php $file_dir = "/path/to/upload/directory"; foreach ($_files as $file_name => $file_array) { echo "path : ".$file_array[' ' "tmp_name"]."<br />\n"; echo "name: "$file_array[' ' "name"]."<br />\n"; echo "type : ".$file_array[' ' "type"]."<br />\n"; echo "size : ".$file_array[' ' "size"]."<br />\n"; if (is_uploaded_file($file_array["tmp_name"])) { move_uploaded_File($file_array["tmp_name"], "$file_dir/".$file_array["name"]) or die ("couldnt copy"); echo "file was moved!"<br/> } } ?> wtf is going on here??? Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-688498 Share on other sites More sharing options...
premiso Posted November 12, 2008 Share Posted November 12, 2008 Its an upload script. In PHP when a file is uploaded it is sent to a temp directory, hence the move_uploaded_file. In the move uploaded file you are able to set the file name to be what you want and move the file to where you want. The tmp_name is the name that the file was uploaded as, you can choose to keep using that or not. If the file moved successfully, report it, else die. This will do as many files as were uploaded on the previous page with the foreach loop. Hope that helps. Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-688512 Share on other sites More sharing options...
djdellux Posted November 12, 2008 Author Share Posted November 12, 2008 sure does mate, sure does. thanks again Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-688516 Share on other sites More sharing options...
djdellux Posted November 12, 2008 Author Share Posted November 12, 2008 OK well here's the task to accomplish i need to ****Make a GUI for logging DB**** uhhh how to do? don't really have the confidence yet, being this is my first task at programing ever. any suggestions are highly welcome Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-688524 Share on other sites More sharing options...
premiso Posted November 12, 2008 Share Posted November 12, 2008 That explanation is kind of vague...What are we logging? What fields will the user be able to input date into, what type of data is it? Does this have to be done by a certain user, and does it matter if it is done by a particular user? Is this a simple error log, if so does the GUI just need to be able to pull out data, display it in a table and allow the user to manipulate it? (If so there are alot of scripts on the web to do this, I actually Barrand on this form has some in his Signature). Please elaborate. Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-688528 Share on other sites More sharing options...
djdellux Posted November 12, 2008 Author Share Posted November 12, 2008 ill get back to you. this is really all my boss put in the email he sent to me ill get with him and get back to ya thx premiso Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-688538 Share on other sites More sharing options...
djdellux Posted November 13, 2008 Author Share Posted November 13, 2008 OK well I'm trying to view a SQLite db and this is the code i found that is supposed to facilitate this ***** <?php if ($db = sqlite_open('c:\\program files\\apache\\data\\log', 0666, $sqliteerror)) { sqlite_query($db, 'CREATE TABLE foo (bar varchar(10))'); sqlite_query($db, "INSERT INTO foo VALUES ('fnord')"); $result = sqlite_query($db, 'select bar from foo'); var_dump(sqlite_fetch_array($result)); } else { echo($db); } ?> ******* but guess what its not working...am i that much of a newbie that I'm not seeing something lol please help and premiso...i will have that info you asked for in your last post by the end of the day thanks fourm -dellux Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-689535 Share on other sites More sharing options...
djdellux Posted November 17, 2008 Author Share Posted November 17, 2008 OK well this is whats the deal is... i need to make a GUI for a data base >LOG.DB> there needs to be Fields displaying options to select by time range, user, and type. also i need to be able to filter by type of loggin. its just a test from my boss to see how well I'm understanding php and mysql. i have read a text by SAMS TEACH YOURSELF but i have yet to implement anything into code but the "HELLO WORLD" stuff lol. need to get some help on this first one to get the ball rolling if ya know what I mean. thanks in advance to any and all with some help/input on my situation. thanks Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-692075 Share on other sites More sharing options...
djdellux Posted November 17, 2008 Author Share Posted November 17, 2008 OK so this is what I have so far..... <html> <head> <title>Loggin DB</title> </head> <body> <form method="post" action="send_loggin1.php"> <select name="Websites to search"> <option value="">ID</option> <option value="">Page</option> <option value="">Description</option> <option value="">User Code</option> <option value="">Code Type</option> <option value="">Time/Date</option> <option value="">IP Address</option> </select> <p><input type="submit" value="send"/></p> <?php $db = $_SERVER['DOCUMENT_ROOT']."/../data/log.db"; //connect to sql $handle = sqlite_open($db); $query = "SELECT * FROM log where id > 85076"; $result = sqlite_query($handle, $query); $row = sqlite_fetch_array( $result ); echo "<table>"; while($row = sqlite_fetch_array($result)){ echo " <tr>\n"; echo " <td> $row[id]</td><td> $row </td> <td> $row[desc] </td><td> $row[userCode] </td><td> $row[codeType] </td><td> $row[time] </td><td> $row[ipaddr]</td>\n"; echo " </tr>\n"; } echo "</table>"; ?> </html> NOW, i know i am going to need a ifelse statement somewhere in here right??? lmao i feel like such a tool hahaha any help is thanked highly Quote Link to comment https://forums.phpfreaks.com/topic/132135-newbee/#findComment-692182 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.