473,404 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

PHP Basics

Hi all,

I am new to this group and I am new to PHP too.

I want to create a php page with a file browse button and I have to
add the file path in Mysql table after submit.

Kindly bring me your ideas.

Thanks,
S.SARAVANAKUMAR

Jan 9 '08 #1
5 1288
Saravana wrote:
Hi all,

I am new to this group and I am new to PHP too.

I want to create a php page with a file browse button and I have to
add the file path in Mysql table after submit.

Kindly bring me your ideas.
Hi,

The HTML part for fileuploads is easy (assuming you know HTML)
Google for file upload, follow first link:
http://www.cs.tut.fi/~jkorpela/forms/file.html

for an introduction.

About saving the file path: forget it.
Fileuploads only send the file(s) to the server, NOT the path where they
reside on the clientmachine.
Even Javascript will not help you with this: It is also crippled on
purpose when it come to real paths and files.

Reason?
It is none of the server's business where the original file is on the
client.

Regards,
Erwin Moller
>
Thanks,
S.SARAVANAKUMAR
Jan 9 '08 #2
Rob
On Jan 9, 10:34*am, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
Saravana wrote:
Hi all,
I am new to this group and I am new to PHP too.
I want to create a php page with a file browse button and I have to
add the file path in Mysql table after submit.
Kindly bring me your ideas.

Hi,

The HTML part for fileuploads is easy (assuming you know HTML)
Google for file upload, follow first link:http://www.cs.tut.fi/~jkorpela/forms/file.html

for an introduction.

About saving the file path: forget it.
Fileuploads only send the file(s) to the server, NOT the path where they
reside on the clientmachine.
Even Javascript will not help you with this: It is also crippled on
purpose when it come to real paths and files.

Reason?
It is none of the server's business where the original file is on the
client.

Regards,
Erwin Moller


Thanks,
S.SARAVANAKUMAR- Hide quoted text -

- Show quoted text -
Erwin - that's not strictly true.

JavaScript could be used to store the original location of the file,
like this :-

<form method="POST" name=form1>
<input type=file onChange="alert(this.value)">
</form>

Having said that, I can't think why you would want the original
location. I think Saravana is actually asking how to store the name/
path of the file on the server, so it can be retreived.

Is that right?

Rob.
Jan 9 '08 #3
Rob wrote:
On Jan 9, 10:34 am, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
>Saravana wrote:
>>Hi all,
I am new to this group and I am new to PHP too.
I want to create a php page with a file browse button and I have to
add the file path in Mysql table after submit.
Kindly bring me your ideas.
Hi,

The HTML part for fileuploads is easy (assuming you know HTML)
Google for file upload, follow first link:http://www.cs.tut.fi/~jkorpela/forms/file.html

for an introduction.

About saving the file path: forget it.
Fileuploads only send the file(s) to the server, NOT the path where they
reside on the clientmachine.
Even Javascript will not help you with this: It is also crippled on
purpose when it come to real paths and files.

Reason?
It is none of the server's business where the original file is on the
client.

Regards,
Erwin Moller


>>Thanks,
S.SARAVANAKUMAR- Hide quoted text -
- Show quoted text -

Erwin - that's not strictly true.

JavaScript could be used to store the original location of the file,
like this :-

<form method="POST" name=form1>
<input type=file onChange="alert(this.value)">
</form>
Hi,

You are right.
I stand corrected. :-)

It is NOT possible to modify the value(s) with JavaScript, but it is
possible to read.

Regards,
Erwin Moller
>
Having said that, I can't think why you would want the original
location. I think Saravana is actually asking how to store the name/
path of the file on the server, so it can be retreived.

Is that right?

Rob.
Jan 9 '08 #4
On Jan 9, 8:05 pm, Rob <ratkin...@tbs-ltd.co.ukwrote:
On Jan 9, 10:34 am, Erwin Moller

<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
Saravana wrote:
Hi all,
I am new to this group and I am new to PHP too.
I want to create a php page with a file browse button and I have to
add the file path in Mysql table after submit.
Kindly bring me your ideas.
Hi,
The HTML part for fileuploads is easy (assuming you know HTML)
Google for file upload, follow first link:http://www.cs.tut.fi/~jkorpela/forms/file.html
for an introduction.
About saving the file path: forget it.
Fileuploads only send the file(s) to the server, NOT the path where they
reside on the clientmachine.
Even Javascript will not help you with this: It is also crippled on
purpose when it come to real paths and files.
Reason?
It is none of the server's business where the original file is on the
client.
Regards,
Erwin Moller
Thanks,
S.SARAVANAKUMAR- Hide quoted text -
- Show quoted text -

Erwin - that's not strictly true.

JavaScript could be used to store the original location of the file,
like this :-

<form method="POST" name=form1>
<input type=file onChange="alert(this.value)">
</form>

Having said that, I can't think why you would want the original
location. I think Saravana is actually asking how to store the name/
path of the file on the server, so it can be retreived.

Is that right?

Rob.
Hi Rob,

You are exactly correct.

Thanks for the help.
Jan 10 '08 #5
Rob
On Jan 10, 5:58*am, Saravana <saravanakum...@adventnet.comwrote:
On Jan 9, 8:05 pm, Rob <ratkin...@tbs-ltd.co.ukwrote:


On Jan 9, 10:34 am, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
Saravana wrote:
Hi all,
I am new to this group and I am new to PHP too.
I want to create a php page with a file browse button and I have to
add the file path in Mysql table after submit.
Kindly bring me your ideas.
Hi,
The HTML part for fileuploads is easy (assuming you know HTML)
Google for file upload, follow first link:http://www.cs.tut.fi/~jkorpela/forms/file.html
for an introduction.
About saving the file path: forget it.
Fileuploads only send the file(s) to the server, NOT the path where they
reside on the clientmachine.
Even Javascript will not help you with this: It is also crippled on
purpose when it come to real paths and files.
Reason?
It is none of the server's business where the original file is on the
client.
Regards,
Erwin Moller
Thanks,
S.SARAVANAKUMAR- Hide quoted text -
- Show quoted text -
Erwin - that's not strictly true.
JavaScript could be used to store the original location of the file,
like this :-
<form method="POST" name=form1>
* <input type=file onChange="alert(this.value)">
</form>
Having said that, I can't think why you would want the original
location. I think Saravana is actually asking how to store the name/
path of the file on the server, so it can be retreived.
Is that right?
Rob.

Hi Rob,

You are exactly correct.

Thanks for the help.- Hide quoted text -

- Show quoted text -
OK, then you need to do this in 3 steps. I'll give you pointers to
what you need to do, but you'll need to write that exact code your
self.

The first step is to present an upload form, fairly simple.

The second step is to process the file upload using PHP. There's an
exacmple of both of these steps at http://uk3.php.net/manual/en/features.file-upload.php.

Once the file has been uploaded and you have the name and location of
it from the first part of your upload script, then you can write that
into your database using mysql_query() - http://uk3.php.net/manual/en/function.mysql-query.php

Please have a go at writing the code, but if you get stuck, then come
back to us.

Robert.
Jan 10 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: enki | last post by:
I have been learning perl and C++, and I have been looking into Java. I know very little about the language, I have found some realy bad books that realy served to confues me and I have to find...
0
by: James Messick | last post by:
I'm just getting started with MySQL. Got my first db created and can run SQL against it in the phpAdmin program. Is there a tutorial online somewhere that shows me the basics of accessing it from a...
2
by: Kurien Baker Fenn | last post by:
I would like to show the progress of an application using the progress bar in visual basics using the timer.Please help me. Thanks in advance.
1
by: manish | last post by:
Hi, I am a fresher in the programming field i.e although I have done programming at the basic level but at professional level I am very new and I am facing many problems. These probllems are...
1
by: ThunderMusic | last post by:
Hi, I need to send some data from my app to a remote server. So, after some searches, I found the best way would be to use web services (unless you can suggest me other ways). The data sent will...
14
by: chitu | last post by:
Hi pals, Hope u all of r intersted in C programming.Let start from d basics.
5
by: Jyoti Khalap | last post by:
HI Can Anyone help me out with my problem its very urgent I want to import text file to my visual basics application because everytime its a new text file depending on that text file i want to...
3
Mague
by: Mague | last post by:
Hey, I need help to some how open a exe file with Microsoft Visual basics. You mite think im trying to steal someone elses project but im not i wont to no how they did it and upgrade it if...
0
by: babu8880 | last post by:
www.convensysglobal.com/elearn You can login and attend courses and similar resources ask your doubts from experienced engineers in iphone and Objective C Domain You can attend live classes...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.