Search found 8 matches
- Mon Dec 04, 2006 9:35 am
- Forum: PHP - Code
- Topic: Simple php problem with database config file
- Replies: 8
- Views: 1009
lol..what these guys are trying to say is that the variable is not visible from withing the function unless is global. so you leave it the way it is where you define it (variables.php), and redeclare it inside the function like this: function anyfunction(){ global $db; global $db_user; ...............
- Sun Dec 03, 2006 10:48 pm
- Forum: PHP - Code
- Topic: Simple php problem with database config file
- Replies: 8
- Views: 1009
- Sun Dec 03, 2006 10:20 pm
- Forum: PHP - Code
- Topic: Simple php problem with database config file
- Replies: 8
- Views: 1009
I read through that, but I am still confused. I know I can't access those variables since they aren't global. I also know how to access the variables if I put my variables.php in a class and create a class object within my other php file. I just don't think this is the proper way to do it (or is it?...
- Sun Dec 03, 2006 9:08 pm
- Forum: PHP - Code
- Topic: Simple php problem with database config file
- Replies: 8
- Views: 1009
Simple php problem with database config file
This question should be an easy one to answer, but I can't seem to find it. Ok, so I have a config file called variables.php. It looks something like this: <?php $base_dir = "/"; $db = "my_database"; $db_user = "root"; $db_loc = "localhost"; $db_pass = "&...
- Thu Oct 26, 2006 5:32 pm
- Forum: PHP - Code
- Topic: PHP $upload_dir Error!!!!!
- Replies: 11
- Views: 1230
- Tue Oct 24, 2006 7:07 pm
- Forum: PHP - Code
- Topic: Need help with image thumbnail creation code
- Replies: 3
- Views: 511
I got the code working now. My logic didn't really make sense. Instead of trying to echo the image via the spanimages file (which didn't make sense at all the way I was doing it), I just use spanimages.php to create the thumbs, and printed them out via the img tag on my test.php file. Also, I think ...
- Tue Oct 24, 2006 6:19 pm
- Forum: PHP - Code
- Topic: Need help with image thumbnail creation code
- Replies: 3
- Views: 511
add error_reporting( E_ALL ); at the very top of your page and remove @ infront the functions error_reporting( E_ALL ) will display any errors, warnings that your script may have @ supreses the function from returning an error, so even if your function is crashing you'll not know Ok, I did what you...
- Tue Oct 24, 2006 6:03 pm
- Forum: PHP - Code
- Topic: Need help with image thumbnail creation code
- Replies: 3
- Views: 511
Need help with image thumbnail creation code
feyd | Please use , and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color] I am tryi...