|
qleyo (f)
|
Right I happen to have 3 years experience with PHP, and alot more in C/C++ which is what PHP tries to emulate, but like SBU has said what exactly is your problem, and like he has said knowing and understand a problem is one of the major pitfalls of software engineering today. Its hard to tell you what to do when I don't know what you want,
|
|
|
|
|
|
alexis (m)
|
qleyo - He said he wants to a random quote generation script using text files or back-ended. He wanted one of us to write the code for him which most people on this thread is trying not to do, I reckon perhaps to allow him get his hands wet first.
I told him I would do it for him but if he does not the script, he should but a clear link on his site back to my own site.
|
|
|
|
|
|
sbucareer (m)
|
That is fair enough
|
|
|
|
|
|
pojutime (m)
|
Hi guys,
Thanks for all the replies. What i want is quite easy. I wonder why you guys have been unable to understand it. I want to place a link on a page. When a visitor clicks on the page, it will open a pop-up window. QUite easy thus far, abi? Ok when the pop-up window opens, the content it will display should be taken from a text file. After 24 hours and the link is clicked again, the pop-up should display content from the next (sequentially) not randomnly text file. And on an on like that.
Cheers
|
|
|
|
|
|
alexis (m)
|
pojutime,
This is a trivial task - if you read my post on this, I said I will do it for you only if you agree to put a link back to my website. FYI - you can put all your quotes on different lines in a txt file and use the fget() function in php to call them randomly.
|
|
|
|
|
|
pojutime (m)
|
its not random, its supposed to be sequential. once a file is displayed (for 24 hours), it should move to the next and display it.
|
|
|
|
|
|
Seun (m)
|
Offer some money and you will get a solution in 24 hours. 
|
|
|
|
|
|
nwaigbo-annoying
|
pojutime, I'm not sure if you got the solution to your problem yet but I might be able to help you, I read your questions but maybe you should explain what you are trying to do a little more,
This is what I got from your questions --you want to have text files in a folder --then you want when someone click on a link that file should display in a different window --if the person visit your site within 24 hours that person should see a different file in a pop-up window?
if this is what you are trying to do then you I have a question for you --Do visitors need to login to view the content of these files? if you still need answer to your questions please answer the questions above I might be able to help you out, Thanks
|
|
|
|
|
|
alexis (m)
|
Pojutime, you are going back and forth with this - random or sequential is no wahala, it's either
1. You pay for it - then everything becomes yours 2. You link back to my site and said the script was developed by me 3. I host the script and you link to it
Which do you prefer?
|
|
|
|
|
|
pojutime (m)
|
pojutime, I'm not sure if you got the solution to your problem yet but I might be able to help you, I read your questions but maybe you should explain what you are trying to do a little more,
This is what I got from your questions --you want to have text files in a folder --then you want when someone click on a link that file should display in a different window --if the person visit your site within 24 hours that person should see a different file in a pop-up window?
if this is what you are trying to do then you I have a question for you --Do visitors need to login to view the content of these files? if you still need answer to your questions please answer the questions above I might be able to help you out, Thanks
Thanks, no login required. Any visitor can access the pages.
|
|
|
|
|
|
qleyo (f)
|
Who ever ends up doing this, if you MUST use a file then please use .xml
If you decide to go the database route in the end you can easy import xml files into most databases.
This seems rather straight forward : Form takes in the quote. Perhaps with author field.
Writes it to the file in format <quote> <author>name</author> <text>quote text</author> </quote>
And you parse that back, into an array, perhaps 2d array. And use simple rand() to select an array index (also include mod sizeof array so you do not go out of bounds).
|
|
|
|
|
|
thekrafter (m)
|
Na wa o! This kain problem sef!
If there's no login required I assume EVERYONE who visits the site sees the same text file (quotation) on a given day?
|
|
|
|
|
|
alexis (m)
|
I don't think pojutime is serious about this script. Let someone do it for you for free and you give the person the credit, pay for it and have the code for yourself - simple matter
|
|
|
|
|
|
Seun (m)
|
I don't think pojutime is serious about this script. Let someone do it for you for free and you give the person the credit, pay for it and have the code for yourself - simple matter alexis: how can he pay for what is done for free? 
|
|
|
|
|
|
alexis (m)
|
Seun - I gave him 2 options.
1. I do it for free but you give me your word that you will credit the work to me by displaying my website link on the site you will host the page 2. I build it for you for a small fee and you use it as you like, you don't have to give me any credit or link to my site
|
|
|
|
|
|
oasis
|
@alexis
I quite agree with you about crediting you with a link. It's the least he could do. And since he has clearly shown that he's not willing to pay to get the job done, and not willing to learn php to do it himself, a link back to your website is a fair deal.
He's been dragging his feet ever since he was given this option. I wonder what exactly he's looking for?
|
|
|
|
|
|
pojutime (m)
|
the solution
|
|
|
|
|
|
oasis
|
Seun, what are you afraid of?
How come you always go round deleting every post that says something about you that you don't like? That is so dishonest.
Be a man and accept challenges like everyone else.
|
|
|
|
|
|
oasis
|
the solution Well, just say when.
|
|
|
|
|
|
pojutime (m)
|
why not now?
|
|
|
|
|
|
sbucareer (m)
|
Please if you have the solution just give it to this man. At least in the binary code, put your name in the author section and put code proprietary license, contact needed for any code re-modification and re-distribution. And register it under the GNU license.
|
|
|
|
|
|
oasis
|
why not now? Yes, why not now? Seun - I gave him 2 options.
1. I do it for free but you give me your word that you will credit the work to me by displaying my website link on the site you will host the page 2. I build it for you for a small fee and you use it as you like, you don't have to give me any credit or link to my site
|
|
|
|
|
|
pojutime (m)
|
so what are we waiting for?
|
|
|
|
|
|
oasis
|
so what are we waiting for? alexis is waiting for your response, which you haven't given any.
|
|
|
|
|
|
alexis (m)
|
oasis,
I doubt if pojutime is serious about this script, to tell you the truth, I have lost interest in this particular thread. Rather - I am concentrating my effort on starting a php tutorial, please assist if you have any php experience.
To anyone that has some php skills, let us start a php tutorial, I will put one up tonight.
|
|
|
|
|
|
|
|
nwaigbo-annoying
|
I think I have a script that can do this, I've been really busy, Also I wish this guy can tell us more about what he really want to do with this script,
To do what you are saying here's one way to do it
-- you need a way to keep track of the visitors -- since no login is required, cookie will be the best option but if the user delete their cookie you may not be able to show them a different file if they come back within 24 hours
-- use a fixed naming conversion for the files E.G file1.txt, file2.txt ,
--php has a function you can use to get certain type of file that match the pettern you want E.G you can get all text files in a directory , The name of this function is called "glob" , check php manual
-- now you will start by first checking if the user visited your site in the last 24 hours This can be done by installing a cookie that has date and time information in it , then you try to read this cookie when someone visit your site, if the cookie is not there , this maybe their first time so you install the cookie. then display the default file , or it may be that they deleted their cookie or their last visit expired.
-- also you can save the name of the file the person viewed the last time they visited your site, you can do this by adding the file number only , that means instead of adding file1.txt you will enter 1
--- your cookie value might look like this date-time-file_number,file_number
-- when you read this cookie back you can use a function in php called "explode" This function allows you to break up a string at a set point in this case the point will be ( - ) hyphen , This will allow you to read the date, time and file numbers separately.
, Not sure if this helped you?
If you are a php programmer this might give you a clue but if you are not a php programmer then you may need to wait for the script, My issue with your request is not money I can give you the script free , I wish you could give more information about what you really want .
|
|
|
|
|
|