Can u write this simple script 4 me, pleeeease
Moderator: General Moderators
Can u write this simple script 4 me, pleeeease
first, I am not a PHP programmer at all. I am a flash designer and I want two PHP scripts that enable me to read from and write to a text file stored at server side. Data should be stored in array form so I can read and write using an index.
first script: write.php:
Inputs:
1) $FileName: the url of the text file where data is stored.
2) $Index: where data should be stored.
3) $Value: the value of the element to be stored.
Outputs:
1) $Error: if the specified element can't be stored this should return one otherwise zero.
2) $Length: number of elements in the array.
second script: read.php
Inputs:
1) $FileName: the url of the text file where data is stored
2) $Index: the index of the element to be read.
Outputs:
1) $Value: the value of the requested element.
2) $Error: if element can't be read this should return one otherwise zero.
3) $Length: number of elements in the array.
I know some of u won't like to write this kind of ready-to-use code. But, believe me I need it urgently.
first script: write.php:
Inputs:
1) $FileName: the url of the text file where data is stored.
2) $Index: where data should be stored.
3) $Value: the value of the element to be stored.
Outputs:
1) $Error: if the specified element can't be stored this should return one otherwise zero.
2) $Length: number of elements in the array.
second script: read.php
Inputs:
1) $FileName: the url of the text file where data is stored
2) $Index: the index of the element to be read.
Outputs:
1) $Value: the value of the requested element.
2) $Error: if element can't be read this should return one otherwise zero.
3) $Length: number of elements in the array.
I know some of u won't like to write this kind of ready-to-use code. But, believe me I need it urgently.
btw if you ever do want to learn:
http://www.php.net/manual/en
If you start from the top of the Manual and work your way down and around, you should do well with practice. It isn't very hard to understand, it just takes some patience. Also check out sites like http://www.evilwalrus.com and http://www.phpbuilder.com .
http://www.php.net/manual/en
If you start from the top of the Manual and work your way down and around, you should do well with practice. It isn't very hard to understand, it just takes some patience. Also check out sites like http://www.evilwalrus.com and http://www.phpbuilder.com .
Thanx a lot sami.
I will consider learning PHP because my current problem is because I can't write a server-side application. I am only a desktop programmer.
by the way, I had known that I can use visual basic or C++ to make CGI scripts which makes it easier 4 me to write CGI scripts than PHP. what's the difference between CGI and PHP? and what do you recommend 4 me? learning a completely new programming language like PHP? or take use of my knowledge and learn CGI???
I will consider learning PHP because my current problem is because I can't write a server-side application. I am only a desktop programmer.
by the way, I had known that I can use visual basic or C++ to make CGI scripts which makes it easier 4 me to write CGI scripts than PHP. what's the difference between CGI and PHP? and what do you recommend 4 me? learning a completely new programming language like PHP? or take use of my knowledge and learn CGI???
I'd go for PHP first.
PHP really is easy to learn. If you can do HTML you can code PHP.
CGI is slightly more powerful is some ways, but PHP does what it was built to do best, and that's to be a web server side language.
I can't really speak on this matter great because i'm ignorant in the ways of CGI. You could say i know as much about CGI as you do PHP. =P
Here are some Google searches though:
PHP vs CGI & Reasons to code in php
Also, you should have a read at these to get you started:

Click To Buy it @ Amazon
&

Click To Buy it @ Amazon
It's the only two books you need.
PHP really is easy to learn. If you can do HTML you can code PHP.
I can't really speak on this matter great because i'm ignorant in the ways of CGI. You could say i know as much about CGI as you do PHP. =P
Here are some Google searches though:
PHP vs CGI & Reasons to code in php
Also, you should have a read at these to get you started:

Click To Buy it @ Amazon
&

Click To Buy it @ Amazon
It's the only two books you need.
thanx alot, Actually I c that Php pages are much wider in use than other languages like ASP or cgi. I think I am going to learn PHP.
I thought scriptlance's programmers are volunteers. I didn't set a budget for anything at all. the whole work is for personal use
can anybody help me writing these scripts??
I thought scriptlance's programmers are volunteers. I didn't set a budget for anything at all. the whole work is for personal use
can anybody help me writing these scripts??
first of all CGI is not a language, it's a specification (see: http://hoohoo.ncsa.uiuc.edu/cgi/interface.html)
php can do it, as can perl, C ..hey, even a dos-batch might do the job
now you should read viewtopic.php?t=511 to see how parameters are passed to php. Which version are you going to use (if) ?
I suggest reading the following manual pages
http://php.net/isfile , http://php.net/fopen , http://php.net/flock
http://php.net/file , http://php.net/fread , http://php.net/file_get_contents , http://php.net/include
http://php.net/unserialize
http://php.net/isset
http://php.net/count , http://php.net/strlen
http://php.net/echo
http://php.net/serialize
http://php.net/fputs
don't let the amount of pages overwhelm you, it's not that difficult and I think they are in order of appearance (in your script). There are many examples and user contributed notes that will explain each function.
php can do it, as can perl, C ..hey, even a dos-batch might do the job
now you should read viewtopic.php?t=511 to see how parameters are passed to php. Which version are you going to use (if) ?
I suggest reading the following manual pages
http://php.net/isfile , http://php.net/fopen , http://php.net/flock
http://php.net/file , http://php.net/fread , http://php.net/file_get_contents , http://php.net/include
http://php.net/unserialize
http://php.net/isset
http://php.net/count , http://php.net/strlen
http://php.net/echo
http://php.net/serialize
http://php.net/fputs
don't let the amount of pages overwhelm you, it's not that difficult and I think they are in order of appearance (in your script). There are many examples and user contributed notes that will explain each function.
hmm
if you know C then php is similar in it's operation, also if you want scripts i'd try http://www.hotscripts.com, they seem to have everything.
