Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Feb 2001
Posts: 26
MHB
Offline
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 26
Right guys,
I wanna require files that have info on people kept in arrays.
So, I have a file called 'dave.dat'
In it it has:

Code
code:

Then, my main script has:

Code
code:

Now, when running I get an error 500 but I dont get the page normally created by the fatalsToBrowser line. So I check error log and there isnt any...

So, I tried doing it with the array in the script and removed the require line, and it worked perfect.

So, It is in the require line my problem lies...
Ive tried using double quotations and still no luck frown

Where am I going wrong? confused

BTW - What does that little '1;' do at the end of alot of scripts do?

Sponsored Links
Joined: Feb 2000
Posts: 4,625
Member
Member
Offline
Joined: Feb 2000
Posts: 4,625
Add this under the require line and see if it IS the require line.

Code
code:

Joined: Feb 2001
Posts: 26
MHB
Offline
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 26
Hmmm....I added that and it came up with the error 500 page, so it isnt the require line that is the problem it seems.

Im REALLY confused. frown

Anyone know where I could be going wrong?

Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
Greg, that code won't help unless the requires were originally wrapped in an eval statement smile

MHB, there's nothing wrong with teh require line. If you're getting an error it's a paths or permissions error or something of that nature.

I personally wouldn't keep a file with the array all set up in it like you're doing. If you want to expand the script you'll need one file for every entry that you're using, which is inefficent.

If you only have the one, then just put the array in your program. Otherwise, use the required file list a flat-file database. Put each field in, deliminated (a lot of people use '|' as the deliminator), read the lines in, find the one you need. Then split on the pipe and have each piece popped into the array so that you can access the individual elements like you are asking/

--mark


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
Joined: Feb 2000
Posts: 4,625
Member
Member
Offline
Joined: Feb 2000
Posts: 4,625
damn. frown
*smacks head*

Sponsored Links
Joined: Feb 2001
Posts: 26
MHB
Offline
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 26
Quote
quote:

You mean like:

Dave | Liverpool | 1970 | | England

Like that?
And loads more after?

Right, I dont have a clue how to do that frown laugh

Don't suppose you know of anywhere that shows it online?
I got O'Reilly's learning perl book, Ill have a look in that tonight.

Thanks!


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)