
-----------------------------------
Homer_simpson
Wed Aug 20, 2003 11:06 pm

Uploading/Apache/Ftp ???!!!
-----------------------------------
now i know how to upload files into a ftp... but when i'm using apache there aint no ftp  :?  so how can i upload my files using php?!

-----------------------------------
Amailer
Wed Aug 20, 2003 11:17 pm


-----------------------------------
err..create a uploader.....
or dl 1

hehe

http://www.hotscripts.com/PHP/Tips_and_Tutorials/File_Manipulation/

-----------------------------------
Blade
Thu Aug 21, 2003 3:14 pm


-----------------------------------
....
first page as a form...

File:




file called upload...



-----------------------------------
PaddyLong
Thu Aug 21, 2003 9:56 pm


-----------------------------------
hmm.. after rereading this post.. I wonder if he meant how do you put the files into your webserver?

if that is the question... then they go into the htdocs subdir in your apache install dir

-----------------------------------
Homer_simpson
Thu Aug 21, 2003 10:55 pm


-----------------------------------
dont worry about it man... i got it working how i wanted to... i make a record for each file that gets uploaded on mysql database and i upload files to my desired directory...  :D

-----------------------------------
Amailer
Fri Aug 22, 2003 12:24 am


-----------------------------------
So...
You need(ed) a script that,

Allows a user to upload a file (Maby with only certin extentions?)
The user can select which dir he/she wants the file to be places?
And then upload...while uploading the script gets all the information of the file, store it in a DB?

And then it finishes uploading (of course)
And there is a place where you can display the uploaded files?

(like a admin center, to delete, edit (file info or content) and etc )

;D

-----------------------------------
Homer_simpson
Fri Aug 22, 2003 4:09 pm


-----------------------------------
pretty much... yeah...

-----------------------------------
Amailer
Fri Aug 22, 2003 5:50 pm


-----------------------------------
Oh ok...
HMM i think i already made that...don't know where it is..

BUT I COULD create it again :D...

-----------------------------------
Homer_simpson
Fri Aug 22, 2003 6:23 pm


-----------------------------------
ya i've already got it working... every time i upload a file a new record gets created in some table...

-----------------------------------
Amailer
Fri Aug 22, 2003 6:45 pm


-----------------------------------
Oh ya...oh well gatta then get back to my project...
OH that reminds me...(forget making a new topic)

Ok, now im having troble displaying the layout...im trying to make this project so that it has no HTML in any file.

So...i wanted to put the whole layout in a database...where you can edit it and etc.

But this is the problem.

Now this is how my site is setup.
I got a table (in my database) for the links- (id, url, name and etc)

And i also got the sites layout in another table...
So how do i display the links  from the links table, into the sites layout..which is in the database?

err HOW on earth to explain this?!?!

-----------------------------------
Homer_simpson
Fri Aug 22, 2003 9:34 pm


-----------------------------------
i think i know what u are trying to do...well here's what i would do...each table must have an "ID" section which is an INT and is set on autoincrement... now u have to design a function that would return the complete info of an id.... for example in my code... i only type this:

$user=GetUserByID($IDNumber);
echo $user//Must be connected to database and GetLinkByID must be defined b4
function PrintLink($id,$x,$y,$class)
{
$templink=GetLinkByID($id);
echo "".$templink[text]."";
}

Now if u want yer pages to have no html in it u gotto make elements in yer database so yer pages should looksomething like this:

function PrintLink(1,10,10,"normallink");
function PrintLink(2,10,20,"normallink");
function PrintLink(3,10,30,"normallink");
function PrintLink(4,10,40,"normallink");


Hope I made sence  :?

-----------------------------------
Amailer
Fri Aug 22, 2003 9:52 pm


-----------------------------------
ERrr it does, and i knw how to do that another way..but thats not what i want.

All the HTML '' of the site is in a DATABASE, and a table called lets say 'layout'
(oh and BTW, the place the links have to go is replaced by the variable $link_name)

And the links are keeped in a table called 'links'

Now how do i display those links in the information given from the layout table?

Could i do this:
have a link variable $link_name

and this variable $layout has the layout (the HTML from the table LAYOUT).

Would it display the links? cuz the information from the 'layout' table contains the variable $link_name....

HOPE THAT YOU UNDERSTAND...i kind do/don't :?

-----------------------------------
Homer_simpson
Fri Aug 22, 2003 10:14 pm


-----------------------------------
so u want to have your whole layout(tables,forms,links,texts,etc) in one variable called $layout?!

-----------------------------------
Amailer
Fri Aug 22, 2003 10:25 pm


-----------------------------------
no no no...
...ahh ok 1 sec now look this is how the table is for the LAYOUT


TABLE: LAYOUT
FIELDS: layout_id, layout_info, layout_name

(Remember, now iv already inserted my information in the field layout_info-[the html], but in that HTML...there is a variable called $link_name..Thats where the link will go)


TABLE: LINKS
FIELDS: link_id, link_url, link_name


Now iv alreayd selected everything from the LAYOUT table, and iv keeped the information selected from the field layou_info as $layout = $row['layout_info'];

And now iv also selected the information from the LINKS table, and keeped the link_name as $link_name = $row['link_name'];

and...now i place the 2 variables
$link_name and $layout ...in my script or w/e. 

Since the variable $link_name is there it should display the links ...


I KNOW THATS NOT POSSIABLE TO DO...
But is there another way to do it? ATLEAST CLOSE TO THAT?
having the links in 1 table and the LAYOUT (HTML OF THE SITE) in another TABLE?!!?

this is crazy

-----------------------------------
Homer_simpson
Fri Aug 22, 2003 10:48 pm


-----------------------------------
well i still can't see how this could do u any good...but here goes...But Youl'll need to create a table for each page...
well in yer layout table u can have each line as a record...
now each record can be 2 things: 
1. normal html text
2.one of your objects(A link in this case)

so here's how the layout table should look like:
layout_line:int
layout_info:text
layout_commandtype:int
layout_id:int

now first we check see what the command type is if it is 1(plain html we just print it) if it's 2(a link type) we get the link data from the id and display it.


while(fetchmysqlarray(blahblah))
if $row[commandtype]=1 (normal html)
echo $row[layout_info];

if $row[commandtype]=2 (a link that has to be read from database)
$templink= get FROM links table the record WHERE linkname='$row[command_id]'

echo"".$row[layout_info]."";



so if yer page has 3 lines layout table will be like this : will be like this

Line    info                 commandtype              commandid
1                               1                  null
2        link1                      2                     3
3                             1                  null
now that table should display something like this in your page:


link1

-----------------------------------
PaddyLong
Mon Aug 25, 2003 10:57 am


-----------------------------------
...no offense but the idea of having no html in any file and having the layout stored in a database seems like a bad idea to me .... I can understand having like some values like table widths or font and stuff like that in the database ... but having your actual html code in the database just doesn't seem like a good idea ...

-----------------------------------
Amailer
Mon Aug 25, 2003 11:24 am


-----------------------------------
Whys that?

-----------------------------------
Homer_simpson
Mon Aug 25, 2003 12:57 pm


-----------------------------------
i think he's trying to make it so he can edit his webpages online...

-----------------------------------
Amailer
Mon Aug 25, 2003 1:12 pm


-----------------------------------
Ya...and others can also...
well i could do this.

Make it edit a file...
But i don't know about that.

-----------------------------------
Homer_simpson
Mon Aug 25, 2003 1:18 pm


-----------------------------------
why dont u just do what octopi did... using php, open a file edit it and save it...

-----------------------------------
Amailer
Mon Aug 25, 2003 1:48 pm


-----------------------------------

Make it edit a file...
But i don't know about that.

-----------------------------------
Homer_simpson
Mon Aug 25, 2003 6:19 pm


-----------------------------------
u mean u dunno how to do it?

-----------------------------------
Amailer
Mon Aug 25, 2003 6:25 pm


-----------------------------------
no i mean i don't wanna do it -.-
