Jump to content
xisto Community

bakr_2k5

Members
  • Content Count

    90
  • Joined

  • Last visited

Everything posted by bakr_2k5

  1. This isn't completely true, I think. "$menus_result = mysql_query($query) or NULL;" $menus_result would be the output of mysql_query($query), but when mysql_query($query) fails it should pass NULL to $menus_result. Thus resulting in $menus_result = NULL! $query = "SELECT * FROM non_existent ORDER BY id ASC";$menu_result = mysql_query($query) or NULL;echo $menu_result; // Which echoes nothing at all, thus NULL!if($menu_result == NULL) { echo "Yes";} else { echo "No";} This results in a "Yes" so $menu_result is NULL. So "is_null($menu_result)" SHOULD return TRUE. This means "is_null()" doesn't do what it should do! Anyways we shouldn't trust on the name of a function as "is_null()". Bakr_2k5
  2. Yeah awesome, it works ;)Thank you faulty.lee!Well could think of it myself now I see it, but my mind isn't very clear today :)Anyways thank you! And problem solved :DBakr_2k5EDIT:is_null($menus_result) works here! Using the latest XAMPP version on linux (Gentoo).EDIT2:is_null($menus_result) doesn't work ... it gives always a FALSE! Strange
  3. Hello again I'm facing a problem with PHP and MySQL... I want, when a MySQL error occurs, to let the script continue. Here's the script: $query = "SELECT * FROM menus ORDER BY id ASC";$menus_result = mysql_query($query) or die("Error!");while( $menu=mysql_fetch_array($menus_result) ) { echo $menu['name']."<br />";}Now if the table "menus" doesn't exist, this would echo "Error!" where it's placed and terminate the whole script. But I want it to echo "Error!" and skip the while table but letting everything behind it continue. Is there any way doing this? I'm not that good with MySQL in PHP so still learning. Maybe there is a way using an if or a loop or so. But don't have a clue to implement it with "$menus_result = mysql_query($query)" Thank you in advance! Bakr_2k5
  4. Hmm it was my first time ever I saw something like that :DSo i thought let's post it on the forums, but didn't know it was THAT old :DWell we all learn from our faults!Next time (if there's going to be one) it's a NEW joke :)Bakr_2k5PS I still find it funny....
  5. Just a correction! this will result in including the file (when $page is "home") hometxt instead of home.txt! (spot the dot!)It should be: <?php $page = $_GET['page']; if (file_exists($page.".txt")) { include ($page.".txt"); }?> That's what I have learned, but maybe what you did would work too. I kinda feel bad about includes that allow to include external scripts/files! It isn't right to allow such things, yes, perhaps there are some webpages that use this but it's a BIG security flaw, i think. It makes it possible to use someone else's user database or MySQL data. And it could be possible to load the source of for example "config.php" where the MySQL password / username could be stored. Well it's my point of view, and i think it should be made to load only local files! The switch default is the best solution indeed, and even the switch alone. There's no way to get around these things. At least haven't found it yet Bakr_2k5 EDIT: $query = "SELECT * FROM menus ORDER BY id ASC";$menus_result = mysql_query($query);while( $menus=mysql_fetch_array($menus_result) ) { switch($_GET['page']) { case $menus['name']: include($menus['name'].".php"); $menu_found = TRUE; break; }}if( $menu_found != TRUE ) { echo "Page not found!";} This is my current page load script. It loads the menu items from MySQL for some dynamically way. But couldn't use the switch default thing because it would load the default page every time case didn't match $menus['name'], so i put the menu_found = TRUE and a check in it to work as a default handle. It basically does the same thing as default, if I'm right. Thought it could be handy for someone that needs it
  6. What about this using putty on windows? It isn't logical but would be cool if it worked. Then it would be possible to use my moms computer downstairs to maintain my system from windows with GUI apps Wait... Xcgywin, will it work with that? Can't try out at the moment so maybe you know?! Bakr_2k5
  7. hehe ... Don't know if this is the right place but it's computer related I think it's quite funny... From w3schools.com
  8. Hmmm i kinda knew that, but somehow forgot it... Well then I don't know.Perhaps others will know :)I never used dns or so, that's why...Bakr_2k5PS: Kinda worthless post ...
  9. Hmm i was a bit too fast i guess In Firefox java script:void(document.title='Changed title') works. And that yellow bar to disable javascript is because you run the script locally if I'm right. But the Javascript isn't really practical because users can have it disabled as you pointed out I think i'll go for the <title>example.com || <? echo $_GET['page'] ?></title> it would also be a lot cleaner then building a whole script around it to get the title changed Bakr_2k5
  10. Yeah that's pretty much what faulty.lees script does if I'm right.But had some other thoughts about using MySQL instead of loading the var from the foo.php script. It could also be done this way: URL: "http://example.com/?page instead of id>" And then do this: <title>example.com || <?php echo $_GET['page']; ?></title> It gives the same result as i want to only in a different way So thank you all for your suggestions!! And I consider this problem solved Bakr_2k5
  11. Isn't that done in /etc/hosts file? At least when I want to point hostname to 127.0.0.1 i do it in /etc/hosts... /etc/hosts192.168.144.200 cs.kuban.tv Don't know for sure. But it seems logical to me bakr_2k5
  12. My favorite audio player is still Winamp, but since I'm on linux can't use it...Yes if I'd use WINE .. But don't want that :)Winamp served me almost 5 years on my music needs, and never dropped it.But the newer versions kinda lost my attention, they were more system demandingand not that clean anymore. My favorite version of Winamp stayed on 2.xx (can't remember the exact version number).I used Windows Media Player too but didn't really satisfy me. It hadn't the "thing". Which Winamp has. But WMP integrated a bit better in Windows itself then Winamp.Well now I'm on linux and my audio players switch a lot. Currently use Audacious,since XMMS had been dropped by the Gentoo team and like to go with them :DBut I would say XMMS was / is the best linux audio player!! (Which is almost exactly the same as Winamp)Bakr_2k5
  13. I myself prefer a Desktop Computer since it has overall better performance and costs much less money.But it would also be nice if I would own a laptop since they're really handy when you're away from home.My mom own a laptop (doesn't work properly any more since my sister spoiled some thee over it )and worked a few times on it. My experience with laptops are that they have much less performance over adesktop computer. But it also kinda depends on what you do. Playing games on a laptop is possible but more thequake or doom games and no really system demanding games. Which the modern desktop computers would runeasily.When i have the money i would buy a laptop just for school or hanging out on the couch :DBakr_2k5
  14. This won't work ... foo.php is for example news.php it contains < $var1 = "news" > Then <title>*Sitename* || <?php echo $var1 ?></title>... So your code wouldn't work ... But it isn't possible the way i want. Thanks for trying anyways. Bakr_2k5
  15. Thank you faulty.lee,I'll take a look at it and see if it's usable in my scripts. It seems a bit complicated.So need to figure out what everything does. But it looks like something very useful! :)bakr_2k5
  16. Well it isn't THAT important :DBut it would be nice if it was possible.If you want to, i would like to try your engine. Maybe I'll get some ideas from it to solve my problem. :)Thank you so far :Dbakr_2k5
  17. Hi faulty.lee, That's not exactly what i meant, That switch from line 56 to 63 puts it's content in to a table ------------------------- | top | ------------------------- | m | | | e | | | n | content | | u | | -------------------------- EDIT: Right ... The ASCII thing doesn't really work the way i want! END EDIT! My main page is build up with tables and everything goes from there. In the content section lays that switch from line 56 to 63, so it loads the page it needs into the content table. <?php switch($_GET['page']) { case '1' : include('page1.php'); break; case '2' : include('page2.php'); break; case '3' : include('page3.php'); break; # etc. } ?>That script is something like mine in the content table. So i can't really move lines 56 to 63 to the top (or some where near) in the script, because the page will be included at the top what's not the purpose of it I hope you understand what I mean, I'm from the Netherlands so it could be weird for English people to understand it bakr_2k5
  18. Hi there, Don't want to be a bad one, but if you searched with "unexpected" you would find http://forums.xisto.com/topic/91032-topic/?findpost=1064354245 The error is there for a while bakr_2k5
  19. Thank you for the votes and posts so far (if there are coming more )I think it's better to build the "engine" of the site first and then go for the web interface.But my strongest target will be a clean web interface, and maybe when i feel like some eye-candy and more features. I'll wait till there are a bit more votes and see what's the biggest demand on a web interface :DLike saint-michael said, every thing has it's pro's and con's so a good balance between stuff would be nice.I'll see what time brings :Dbakr_2k5
  20. Hello, Is it in some way possible to load a variable that further then the current line in the script? I don't know if you know what i mean so I'll try to point it out in the script below. 1 <?php2 echo $var1;3 # $var1 needs to be loaded from foo.php4 # Lets say i want $var1 to be echoed in <title>$var1</title>5 - - - - bla bla bla55 - - - -56 switch($_GET['page']) {57 case "foo":58 include("foo.php");59 #- - - - from foo.php - - - -60 $var1 = "what ever you want";61 #- - - - end from foo.php - - - -62 break;63 }64 ?>Well is it possible at all? I already tried with "ob_start() / ob_end_flush()" but doesn't work either... (understood the purpose of ob_start() a bit wrong ) If you know a solution or an other way doing this, please tell me bakr_2k5
  21. Hi there ...Well what do you prefer?I myself prefer a clean interface. Don't really have arguments to defend it, it's just a feeling.I started this poll because i am building a website (which will be hosted here i hope).And needed a few opinions about the way its interface needs to be build.I'll hope you help me out of this decision! When I find some examples i will add them to the post...bakr_2k5
  22. You know? I kinda want all of yours video boards :DMy system:CPU: AMD Athlon 64 3200+MOBO: ASRock 939Dual Sata2RAM: 2x 512 kingston (or something like that) in Dual Channel (so 1024 mb)HDD: 40 gb VIDEO: Nvidia GF 4200 (AGP 8x) .. (I want a PCI-E card dammit!)MONITOR: A sumsung thingy .. What a very low refresh rate ... :DSo perhaps i should upgrade when i have some money in my pocket :Dbakr_2k5
  23. Nice to hear you have some feeling for Linux UBUNTU is kinda good distro since it's used by a lot of people, you should try out the Live CD first to get a good view of UBUNTU and Linux itself (as desktop environment), don't expect that the Live CD will run *good* .. Since it's from the CD And then decide if you want to install it. Perhaps it would be a good idea to have a second computer or laptop next to your machine so if run into something you could google it or search forums etc. I never used Ubuntu only tried out the live cd once. But i can't really say what's a good or best distro since it really depends on your needs. I self use gentoo but it would be a nightmare for someone without knowing anything about Linux/Unix (not that i'm an expert or something like that ) Well I'll try to point you to some distro you MIGHT like. - Fedora Core (http://forums.xisto.com/no_longer_exists/) I used this one quite a while but it's really graphical orientated (point & click), so you won't really learn much about Linux itself since there is for almost every configuration a graphical frontend. - OpenSuse / Suse (https://en.opensuse.org/Main_Page) I never used this one so i can't really tell much about it... But i heard a lot of good things about it. It's also graphical orientated, same story as Fedora Core These distro's mentioned above are more of the plug & play kind, if you know what i mean. There are more of course but i don't know them all - Slackware (http://www.slackware.com/) This was my first distro ever if i remember it right. It's a really good learning distro and very stable (* it's one of the longest existing distro) Well yeah i learned everything about linux on it, i had to know. - Debian (http://www.debian.org/) My second distro.. I liked it more then Slackware ... Since it is a bit better then Slackware (especially the package management system) It's also a good learning distro and has a huge community. - Archlinux (https://www.archlinux.org/) Can't remember much about this one.. But it was a good one.. It's really learning orientated, you kinda build the system from the ground up. - Gentoo (https://www.gentoo.org/) This one i use now .. and i love it It's perhaps the best learning distro that exists since it's really hard in the beginning. With gentoo you learn almost everything about Linux and everything around it. And it's source based so fully optimized for your system. Slackware, Debian, Archlinux and Gentoo are more of the command line kind of distro (well you can install a desktop environment from cd but it's not what it's meant for, i think!) You would learn much more with these distro's then Fedora Core and Suse. With command line distro i mean, giving command and lots of editing configurations files. Keep in mind that these distro's can have a graphical environment like Fedora Core and Suse ... But you have to install itself instead of letting the install disc do it for you. You don't need to scare away now, once you get the hang of it, it will be so easy. And there are literal millions of people who would like to help you into Linux... I'm pretty sure you will hang out in a lot of IRC channels to get some help, some people will be *****y against you since you're the 10000th person who asks it. And some people like to help you. But that's how it goes on the internet and in the Linux community, we like to help each other out. Oh yes, on last thing. It would be a GREAT idea to know something about your system (like the brands and models and so on, Linux isn't like windows that it search for drivers or so, only if they are implemented in some kind of detection software they will get detected, but there will always be unsupported hardware where you need to get your own modules / drivers) I'll hope you can do something with this post... bakr_2k5 EDIT: Those distros are easy to download from their own websites, and if you have a slow internet connection it would be handy to use a bittorrent client
  24. @Levis...Yes windows Apps run quite good now in linux with wine but i'm still waiting when they hit version 1.0 ... Don't use much windows apps at the moment, but i have Call of Duty 1 & Call of Duty 1 United Offensive running VERY good. (even better then in windows).But Wine had still some things that don't work very well. Such as Directx 9 support (at least at mine) .. And Wine doesn't support ALSA's Dmix, well maybe it does but i can't get it done. I know that for games there's cedega but it costs $$$ and the drop allot of supported games (i read somewhere).@Aka_BarIf you ask me if you have to use windows or Linux, I would say Linux (any kind of distro since I think it's MUCH better then Windows)But if you ask 100 people in here for example you would get maybe 50 different answers. So it really depends on what YOU want :)bakr_2k5
  25. Back when I was 7 (10 years ago) or so. We got our first computer a 386 as my mom says... It had DOS or Windows 3.(?) but don't remember it very good. There after we climbed up with windows version till windows XP Professional SP2 .. I liked windows 98 and windows 2000 the most, since it was low on resources etc. It was all pretty easy and point and click stuff...Since a few years I started buying my own computers. My first one was a Pentium 2 (266 mhz) First few weeks i ran windows 98 on it.. Then windows 2000 .. And it all kinda sucked on that machine .. I had read somethings about Linux so i tried Slackware 10. It was a HUGE difference in all.. Had to work with the command line But as more I used it the more i learned about Linux.Switched to Debian (Sarge if I'm right) to check it out . And well it ran a bit better than Slackware. A few months later I bought a athlon 1400 from a classmate. And installed windows 2000 to play some games.. But i got more into programming and stuff like that and went back to linux... (don't remember really what distro but i think it was archlinux??) .. Well got a bit stressed about that computer. So I bought for the first time some NEW parts for my computer .. And got a AMD Athlon 64 3200+ with 1024mbram dualchannel (bla bla bla (which is my machine now)) and went for Fedora Core 5.. It was all cool but had it's good things and bad things... So I switched to winXP Pro SP2 to play games and stuff like that, and in the meantime so some research on good linux distro's. Then I found out of Gentoo (my current distro) and it a damn good one.. At least for me So...I think Windows isn't good for anyone at all... They don't trust anyone and sneak in nasty tools with windows update and such..But it's also easy to use and you can all the games that exist on it...Linux is the ONE for me... And then I'm talking about every distro .. Just the Linux is awesome already! As distro i currently prefer Gentoo but that can change every time i want :DBut it all comes down on your needs and if you want to learn or not...Windows is for the "lazy" (no offense) people who just want to install and play.Linux is more for the people that want to learn things about linux itself and his/hers own computer... And it's more of a professional platform.I'll list some pro's and con's about windows and linux:Windows Pro's:- Easy to Use- Point & Click- Plug & Play- Games- More available software (i think)- More professional software (like video editing, website editing, etc)Windows Con's:- Bugs .....- Security (but that's more the result of users way of using windows)- No full control - Registry (gets messy and allot of errors)- No open source- Costs $$$ Linux Pro's:- open source- performance- full control (of everything)- CAN be easy- you will learn allot- no registry- Great community- Free for all (except some enterprise disto's)Linux Con's:- CAN be difficult- Most of the time no point & click (depends on the distro of your choice)- No REALLY plug & play (Most hardware will be detected, but some will need some more configuration)- ALOT of configuration files- Most of the time you will work on the command line- (if you use a source distro) LONG compile timesWell there could be more on these lists .. But it's almost 24:00 here ;)Remember that this is MY opinion and everyone's will differ from mine ...It's all really personal.bakr_2k5( PS if this is a crappy post .. Just delete it or so .. It's late and I'm not really waken up )
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.