Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/132135-newbee/
Share on other sites

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.

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/132135-newbee/#findComment-686731
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/132135-newbee/#findComment-686786
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/132135-newbee/#findComment-686884
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/132135-newbee/#findComment-686954
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/132135-newbee/#findComment-687729
Share on other sites

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...

Link to comment
https://forums.phpfreaks.com/topic/132135-newbee/#findComment-687784
Share on other sites

<?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???

Link to comment
https://forums.phpfreaks.com/topic/132135-newbee/#findComment-688498
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/132135-newbee/#findComment-688512
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/132135-newbee/#findComment-688528
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/132135-newbee/#findComment-689535
Share on other sites

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

 

Link to comment
https://forums.phpfreaks.com/topic/132135-newbee/#findComment-692075
Share on other sites


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  :)

Link to comment
https://forums.phpfreaks.com/topic/132135-newbee/#findComment-692182
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.