Jump to content
xisto Community

Houdini

Members
  • Content Count

    565
  • Joined

  • Last visited

Everything posted by Houdini

  1. I have not used the MySQL Monitor but you can see more about it HERE and from what I have seen it is a GUI just like phpMyAdmin (which you have with XAMPP) and you can access it by typing into the address bar LOCALHOST/xampp/ then select the phpMyAdmin link from the menu on the left hand side. Practical PHP Programming is a great tool, it is a bookmark on my Firefox and a favorite in my Internet Explorer, you might just want to use phpMyAdmin on your local PC to try out some queries and import or export and all that.
  2. I like the fact that in order to maintain a website that every so often you must at least contribute something, I do have another host and with the exception of when I first started have never had my account suspended. I have not contributed lately (until lately) because I am tiring of some thing that I used to do elsewhere so expect to see more of my posts here especially PHP an MySQL related.The only thing that I guess that really bothers me is when a newbie joins they make a lot of posts asking what I think about some common or even some not so common software, sometimes even want to run a poll. I know that if you want to have a 'free hosted site' you want it RIGHT now. But in my opinion if you are just shooting the breeze then what good is it. To go to some of these posts and find nothing of any value that benefits no one then sometimes I feel disappointed.I try to make a post that actually makes some sense or could possibly be of benefit to someone else. I am digressing here so I will get to the POINT and I am quite satisfied with Xisto and as long as I can peck out a few letters that come out into a sentence, phrase or thought that is helpful then I will keep doing it right here.
  3. Do you mean by generalized like the MySQLI function of $connect=mysqli_connect($host,$username,$password,$database);That is pretty general and available with newest (or newer versions of MySQL) of PHP 5 but it will not work when in fact instead of selecting test_anita datbase instead of whoknows database so writing such a connection include would not help me at all. It is not like I have to query just one database, it could be any number of them even if I just need to connect to an existing one or create another new one.
  4. There is a reason for that include not selecting a database, and it is because I test IPB and PHP-Nuke with phpbb2 and phpbb2 (standalone BBS) and other software. If I included a database in my include file then it would be useless because it would only connect to that particular database, in my case it makes no sense and if I can't just do <?phpinclude("connect.php");$select=mysql_select_db("ipb",$connect) or die("Could not delect database ipb MySQL said: ".mysql_error());//more code...?>If the code were in the confines of one particular script then it might make sense but as a contributor to a couple of PHP and MySQL related websites, sometimes I need to create a database similar to the one that they have and to see what kind of problems they are having and be able to solve it I will create a database and then run their code after removing the obvious errors to either find the problem with their code or fix it by seeing a simple error. Does that make sense to you?
  5. vicky99 This is not true becuase you will have to have a domain and a domain name server. You can use your own PC (even Win 95) to host a local or intranet server on your own network, to serve files through a webserver on the internet you must have a domain name and domain name server account somewhere, this ususally costs money, not to mention that you should have a machine that is on 24/7/365 with someone that has the ability to bring it back up if it crashes, and a Windown machine does this quite often. I would use an Apache which is more reliable and more poeple know how to service it, but if all you really want to do is run a webserver on your own home network or even single machine for development then YES you can use Win XP or Win 2003 or later but not without running T1 and or T2 lines into your home (which also run quite a bit of money monthly). Microscopic Earthling was correct with this
  6. That is what the prune feature that most BBS Message Board etcetera have is for. Some posts are just junk anyway and should be deleted on a periodic basis. All Posts comsume some space and even though a database has features that help save space, let's face it my 3 year old site wtill has many old posts and some should be pruned (or removed) but it is like a tree or Rose you cut off old stuff to promote new growth. Important posts will be kept by a good webmaster, it is basically a decision of them or whoever is administrating the site. 150 meg which is offered by Xisto should last your entire lifetime provided you properly maintain it.
  7. What I like about PHP is that it is a server side like Perl and unlike JavaScript (by Netscape) or JScript (by Microsoft) it will always work and is not dependant on what settings are on a users browser. It also works on all OS's unlike ASP which requires a Windows environment. It has many built in functions and if you actually download the PHP manual to your local machine (and possibly also set up a server with PHP and possibly MySQL) you can test all the functions out right from the manual from the examples or user contributed notes provided. I use JavaScript where needed but mostly all my web design is PHP. I do notice that alot of people have bad habits though when using PHP they will echo or print out HTM when all they need to do is leave PHP by closing it then the browser will (as directed by the webserver go back into HTML mode) render the HTML content without all the escapes from double quotes and so forth. I also see those that will open PHP and just start a session then close it and then immediately reopen PHP and write more script (why this happens I never have figured out, plus it could cause an error with crappy code). I think PHP will eventually be the language of choice over Jave even or Perl as ist is getting better all the time and has almost full implementation of OOP with PHP5. Using either mysql or mysqli with PHP5 make life much easier for example here are two code to connect to a database one using MySQL normally (till PHP5) and MySQLi. my_sql() PHP code $connect = mysql_connect($host,$user,$password);$db = mysql_select_db($databse,$connect);mysqli_connect() PHP code $connect =mysqli_connect($host,$user,$password,$database);Hmmm just one statement here...NEAT!
  8. PHP 5 comes with the mysql dlls disabled instead it uses mysqli (supposed to stand for MySQL improved), you will have to edit your php.ini (wherever it is located) and remove the semicolon from in front of the dll as shown below ;extension=php_mssql.dll ;extension=php_mysql.dll extension=php_mysqli.dll Now if this is a brand new install and your php is working then just do a phpinfo() on your server copy and paste the below code into your server root directory if I remember right it is inetpub/www but if not then you should know ehre it is. <?php phpinfo(); ?> If you are having problems then you might want to go to Chapter 6 of the PHP manual right here at Chapter 6. Installation on Windows systems. Being a regular contributor at PHP Builder this same question is a common one, and any more my answer, especially if the problem has lasted for more than two days is to get either Triad, or XAMPP (my choice) or Wamp and uninstall or disable IIS even though it is on your PC Apache is FREE and the most widely used webserver in the world (IIS or PWS aren't even close). If you have this problem after reading and following the instructions for PHP install using PHP's own manual then you might take my advice and just get an all in one package that does it all for you with no problems and you are ready to go with coding on your local machine then when your scripts are bug free then send them up to your active internet Web site.
  9. It is absolutely free to any that wish to use it! Gratis...no charge...use at own risk it should also work with newer version of Invision like on this site where all they did was add graphic buttons which I developed for 1.2 and 1.3 also and will post that code as well if asked.
  10. I have prior to this post developed code to display PHP code within an Invision Board post with highlighting for 1.0 1.2 and 1.3 but just recently developed it for 2.0 and believe it will also work with newer versions here is the code to do this in its entiriity or the MOD if you like and since this forum presently does not have the capabilities I am posting this for m^e to play with and those that would like to try it with their own. Please keep in mind that this has only been tested using version 2.0 (the last free version) I refuse to pay for software if I can make it myself or upgrade it to something even better myself. So this is a MOD and all you need to do is copy it and save it and follow the install as per below. Hope m^e and other enjoy the fruits of my labor to provide more to this community. Also I am still trying to see why there is a compatiblity issue with my really great table BB Code, but that is on the back burner. Find me at PHP Builder or Dev Shed as a regular contributor concerning PHP issues as Houdini on PHP Builder and Houdini2005 on Dev Shed. I have seen lonebyrd and XIII there before. Just had to get my day count back up above 60 so had to really contribute something worthwhile. Hope it helps others on their programming PHP and some systems like Invision. Of yeah you will also have to add .phptop and .phpmain through the ACP to the main default CSS right after the .htmltop and .htmlmain and save it for this to work properly.
  11. Success has been achieved with the PHP BB Code as well I will release this on the Invisionize forums, but only after first releasing it here, since I once wrote this for 1.2 and 1.3 but 2.0 which I still have just needed to have the function called properly and after looking at the code for a little while and feeling really stupid I saw the problem. And to think I used to do this with no problem (make MODs for phpBB and IPB) this took almost a whole day. Basically it just involves one script which is the sources/lib/post_parser.php in 1.2 1.3 and 2.0 and probably the newer 2+ versions also (I don't have them so am not sure) Here is a screen shot off my local testbed for the 2.0 IPB. Give me a little time to properly edit and show changes needed to accomplish this here or on another IPB 2+ (possibly) I thought that this was already a MOD but I guess it is one I wrote and forgot about plus I removed the site I was using this code on but fortunately had downloaded all files from my Xisto for archival purposes and found the code and still have them. I will attach the post_parser.php that I used with this post and Microscopic Earthling can play with it and possibly use it here as well. Hope ya'll enjoy and see the ability to use this code as well as HTML or SQL which I have already demonstrated. Oh by the way I think for the PHP code block to work with IPB 2+ you must enter it using the ACP and save it that way but it is simple for Microscopic Earthling as he has experience with this. I can also develop the code to use a graphic button, but as it stand right now this is a manual entry only using case insensitive PHP or php as and or and . So the matter is right here and ready to go, just need a little change of one script or the changes that are in it.
  12. Idilled out the form a little after this was first posted and now it is almost June and still nothing from Microsoft. I think they said to wait about 6 weeks, well I think it is real close, so maybe it will arrive, but I am not holding my breath for it. I do live in the the Unstied States so it should be sent, at least if they have that many of them.
  13. Well I went to the ACP and modified the CSS in those .htmlmain .htmltop css lines and just added a comma after the group and added .phptop and .phpmian even previewed it. but the line below return array( 'START' => "<div class='{$used[ $type ]['css_top']}'>{$used[ $type ]['title']}{$extra}</div><div class='{$used[ $type ]['css_main']}'>", 'END' => "</div>" is still showing the error so I don't really understand since I at least have the PHP code retruning in the message area only with the error so not sure what can be done to correct this. I both saved the new CSS and also told it to save and reload in the ACP and not being the best with CSS am unsure. Also since the new definition is given for PHP in the array() definition I really dont know what is causing this unless when calling the function wrap_style() in the following line is missing something.$html = $this->wrap_style( array( 'STYLE' => 'PHP' ) );
  14. OK right now I am testing the actual code that will in fact make the code come out highlighted, and am using the last free version 2.0 but it is returning errors about the .css I think. I have it where it works either with or without a button (a <> gif) for 1.2 and 1.3 but even though it produces these errors about an offset on line 925 which I will show, I am searching my hard drive for the proper .css to create a PHP box. Here is the code that produces the error: function wrap_style( $type='quote', $extra="" ) { global $ibforums; $used = array( 'quote' => array( 'title' => 'QUOTE', 'css_top' => 'quotetop' , 'css_main' => 'quotemain' ), 'code' => array( 'title' => 'CODE' , 'css_top' => 'codetop' , 'css_main' => 'codemain' ), 'sql' => array( 'title' => 'SQL' , 'css_top' => 'sqltop' , 'css_main' => 'sqlmain' ), 'html' => array( 'title' => 'HTML' , 'css_top' => 'htmltop' , 'css_main' => 'htmlmain' ), 'php' => array( 'title' => 'PHP' , 'css_top' => 'phptop' , 'css_main' => 'phpmain' ) ); return array( 'START' => "<div class='{$used[ $type ]['css_top']}'>{$used[ $type ]['title']}{$extra}</div><div class='{$used[ $type ]['css_main']}'>", 'END' => "</div>" ); } Note that I used the html BB Code but need to create a PHP code with the css I think to remove the errors in 2.0 and possibly newer versions. Here is a screen shot of what I have with 2.0 right now. As you can see There is no code wrap and while many people might not know it you can use HTML BB Code and also SQL with IPB like this: INSERT INTO ibf_categories (id, position, state, name, description, image, url) VALUES (-1, NULL, NULL, '-', NULL, NULL, NULL); INSERT INTO ibf_categories (id, position, state, name, description, image, url) VALUES (1, 1, '1', 'A Test Category', '', '', ''); INSERT INTO ibf_css (cssid, css_name, css_text, css_comments) VALUES (1, 'Invision Style Sheet', 'form { display:inline }\r\nTABLE, TR, TD { font-family: Verdana, Tahoma, Arial; font-size: 8.5pt; color: #000000 }\r\na:link, a:visited, a:active { text-decoration: underline; color: #000000 }\r\na:hover { color: #465584 }\r\n.hlight { background-color: #DFE6EF }\r\n.dlight { background-color: #EEF2F7 }\r\n.mainbg { background-color: #FFFFFF }\r\n.mainfoot { background-color: #BCD0ED }\r\n.forum1 { background-color: #DFE6EF }\r\n.forum2 { background-color: #E4EAF2 }\r\n.post1 { background-color: #F5F9FD }\r\n.post2 { background-color: .....BLAHBLAH If you want I can give the code changes that need to be made to the post_parser.php which will allow the above shown code minus the wraparound code box as shown in the screen shot and maybe by then I will also find what I need to change to make the css work and not throw the ugly error.
  15. I enjoy this site but with only one option which is code to present code in a post I would like to see a new BB Code option either manually entered or as a button that would look like <> and surrpund my PHP code with PHP and actually highlight it, there is a MOD for it and I had it at one time on one of my sites, I can't remember if I wrote it myself or used and altered other code. vBulletin like at PHP builder or Dev Shed uses it, but it looks like there are variations in how their code is written.. If Microscopic Earthling is interested I think I still have the code that I used on my site before I took it down. Just wondering if other would like the same.
  16. Microsoft calls it volume licensing; Source Microsoft Volume Licensing Overview I have a corporate version which licenses 5 machines and while it is more expensive than a single license it is much cheaper than buying 5 individual licenses, usually unless you do have a company when you buy PC you would have a single license but companies like Walmart might have a volume license for thousands of computers. Also if you go to Best Buys or somewhere like that and copy a serial number off a PC that is on display how do you know that the serial number is really a bogus one and if you tried to use that number that it will work, or did you bother to think about that, and yes it is illegal even if the serial were legitimate for you to use it, and it is outright theft. I say if you don't like that then maybe you ought to think of using Linux which is free and then you don't have to worry about it.
  17. You will get bad results trying that, when you activate a copy of WIN XP, several environmental values are sent along with the registration, even the hard disk type and size, so when you put the same software on several machines Microsoft knows what machine it was activated for, so when you place it on another machine it has a different hard drive a different cmos, and many other features that are different from the first one, so when you try to update your software on any of the machines that is when Microsoft will know that there are several copies of the same software being used on several machines, or if you do place Win XP on all four machines only one will be activated and the rest will fail, then in 60 days the machines that failed activation because one copy had already been activated will now quit working altogether. Hey I got a larger hard drive and decided to put a licensed copy of the software on to it and it told me that I had to contact Microsoft and get licensed software so after talking with them over the phone they told me that you can only have one copy on any given hard drive. So I could do one of two things keep using the old hard drive and use the new one for extra purposes or remove the OS from the old hard drive and then Microsoft if necessary generate me a new serial number to use with the new hard drive.If you have already placed the software on the other machines then in 60 days they will all stop working and only one that has been activated will continue to work, or you could purchase a copy of XP that gives you a license for 5 machines which still costs quite a bit but not as much as individual copies of XP.
  18. Correct, you (or at least I) should develop your new code on your localmachine and when it is working the way you want it to work then upload the now hopefully bug free script up to your working site. Another thing I do with new scripts is have two folders on the internet site one with my real content and another (call it test or something like that) if the script does something wrong or worse (it wrecks your site) then you can correct it while your real site goes merrily along. The only difference you would have is a config.php file, one for your local machine like below <?php$host="localhost";//this is default$user="root";//this is a default for a new MySQL$pass="";//this is the default (no password for 'root')$connect=mysql_connect($host,$user,$pass) or die("Could not connect to server, MySQL said: ".mysql_error());?>and for your Xisto it would be something like <?php$host="localhost":$user="yourastahostusername";$pass="yourastahostpassword":$connect=mysql_connect($host,$user,$pass) or die("Could not connect to server, MySQL said: ".mysql_error());//good to check for errors?>
  19. OK so you are now wanting to learn to use PHP and a few includes which are file(s) that you place into your script on any given page to indlude stuff that you have written previously. I did see another tutorial on such matters but possibly this tutorial will make more sense. PHP has the abilty to include other PHP files into the current script that is being processed by the server. Let us just take a simple example. This will be a file that will connect yo your database and a specified table. It will include all the necessary parameters to actually do just that. This is a program on its own right and as such will perform a specific funtion (connect to the MySQL Server and select a database to work with). So for testing purposes we will create this file to be included when the script we are using needs this to happen. Look at it as its own program (which it is) that helps save typing a new program. Usually you would like this program or include file to ahave a name that is not easily recognized as a database connection, so call it something like error.php or happy.php and to really throw off hackers you could also include a file that doesn't even do anything and call it db.php (this is a file with nothing at all in it). Security matters aside then there are other ways to protect this important file which will be explaines later in the tutorial. So lets build the connection file for inclusion where and when needed. NOTE anything in the code below behind // is a comment and can be copyed and pasted into a working script <?php//always use this in your script <? is deprecated and unreliable$host="localhost";//This will work with most MySQL servers but your server might be different$user="root";//This is a default for a new MySQL install use you own username if assigned one$password="";//This is a default, if you have a password for your MySQL USE IT$db="yourDatabase";//The name of the datebase you want to connect to goes here between the double quotesOk now name the above script whatever you want and use it as an include in other scripts where and when you need it like below. <?phpinclude("yourIncludeScript.php");$connect =($host,$user,$password) or die("Could not connect with server, check settings, MySQL said: ".mysql_error());//If anything is wrong the file will stop and show an error Could not connect with server, check settings, MySQL said: and the actual MySQL error.$query ="SELECT * FROM $db";//This is from the included file as is the variable from above$result =mysql_query($query) or die("Execution of query failed".mysql_error());...//more codeSo how does this look to PHP on the server which is what this little tutorial is about? <?php//here is the include file as specified see above code$host="localhost";//This will work with most MySQL servers but your server might be different$user="root";//This is a default for a new MySQL install use you own username if assigned one$password="";//This is a default, if you have a password for your MySQL USE IT$db="yourDatabase";//The name of the datebase you want to connect to goes here between the double quotes//end of the includeed file$connect =($host,$user,$password) or die("Could not connect with server, check settings, MySQL said: ".mysql_error());//If anything is wrong the file will stop and show an error Could not connect with server, check settings, MySQL said: and the actual MySQL error.$query ="SELECT * FROM $db";//This is from the included file as is the variable from above$result =mysql_query($query) or die("Execution of query failed".mysql_error());...//more code[As you can see the included file is parsed by PHP as it was originally written, mistakes and comments included. If you do include a file that does not work you need to correct it before using it as an include. Many problems with using PHP are includes with flaws in them or used in the wrong place. Had the include been at the bottom of the above script the values needed to connect to the database had not been defined, so keep in mind where and when you need to include a file with a specific purpose when written your script in PHP. Questions or for more about using an include(s) then PM me Houdini for more. Been working on other things lately, so now I am back for most questions about PHP and MySQL useage.
  20. I generally notice confusion with new users to PHP and or MySQL and first of all I believe that unlike HTML which is automatically associated with a IE browser in a Microsoft system. HTML is automatically rendered with whatever browser is the default browser, be it Internet Expolrer Firefox Netscape or any other browser that has been set. PHP is a different matter to view the output of a PHP file it must be run on a webserver, and if you do not have one set up on your local PC it simply will not work. (Note serverside langauge requies a server) HTML is client side and requires only a browser so it will display by double or single clicing the file itself and the program associated with it will open it, but not so with PHP or ASP (Window servers only) or Perl. You must have a working webserver like IIS PWS Apache Solaris and so on, and the file must be accessed with a browser that sends a request for a page that resides on the server like one of the above mentioned. All webservers have a ROOT where they keep files and other subdirectories. Normally you will have an index.html or index.php file (the server looks for these type files and serves them upon request of that file. With a PHP file the server will look up what you typed into to address bar and try to PARSE it (unlike HTML) to do whatever it is supposed to do, if PHP is not set up properly it will produce either errors or unexpected results or both. The webserver must know where the executable file is and this is set up in the servers sonfiguration file, then there are dlls that the PHP or other langauge will need to perform certain operations when asked to do so, if these are not set they will fail with errors. If you are using Xisto as a server usually you do not need to worry about this, but if you have some ideas about creating something that requires PHP on you site it would be best to place a webserver on your home PC or MAC and develop these programs there and when debugged to the point where you are satisfied then upload them to Xisto. I am a regular contributor to PHP Builder Forums and Dev Shed here and see these question all the time, I used to answer and try to help, but now it seems that installation of these services. My PAT answer anymore is to just download and install either XAMPP available here or you could use WAMP available here This is not a tutorial but a post to try to help those that are new to PHP to get started in the right direction. While it is possible to install a server and MySQL and PHP on your own (with much frustration and questions) the programs I suggested will help you if all you really want to do is write PHP and MySQL routines to develop a site. This is just my opinion for newbies and I am sure that there will be those that tell me you should actually learn something from doing it on your own, but when I see people getting more and more confused trying to do this then I really wonder if the satisfaction of self installation is really that much a benefit unless that is your desired career.
  21. I am kind of really confused with this 'tutorial'. miCRoSCoPiC^eaRthLinG is correct in pointing out that it would at least help to provide a real example. This is not a tutorial but merely useless info that could be gotten by going to the PHP:Manual to see this; Here is the link to the above quotes from the manual Function imap_mail()Note that I removed the whitespace in the actual manual and summed up the (tutorial) in one fell swoop because I RTFM and refer to it often. This is not a tutorial at all, and I just had to get that off my mind. I do suppose that by now the author that provided this 'tutorial' no longer is a member and if so maybe they would show the new powers of imap_mail() vice mail() This post or tutorial is almost verbatim from the PHP manual, if the user is not already gone or banned they should be for that alone. IMHO
  22. Houdini

    PHP Problems

    First off PHP is a server side language like Perl and must be run on a server. All web servers have a ROOT directory (in the case of WAMP I believe it is C:\wamp\www but could possibly be anywhere on your hard drive but the www directory (folder) will reside within the wamp directory folder wherever it might happen to be. When you write a PHP file it must be placed on the webserver somewhere in the ROOT (www) and you may add subdirectories to this folder for your own organizational purposes. So lets take a simple Hello World script and do just that and then test it. Create the below file as is and then save it on your hard drive to the www folder or directory (whatever you call it). Then open your favorite browser and type into the address bar LOCALHOST/hello.php. <?phpecho "<center><h1>Hello World from PHP!</h1></center><br />";echo "My PHP install is working correctly, now for bigger and better things!";?>This should ouput to the screen a centered large headline saying Hello World from PHP! and a line with left justification saying My PHP install is working correctly, now for bigger and better things! PHP can generate HTML and that is what the above code does. If after doing the above and the file is in the proper location of the webserver (Apache with WAMP) it should work, otherwise you have a corrupt install and need to uninstall and reinstall the program. Normally with WAMP or XAMPP or Triad and such if you just accept the default values you should have no problems provided that you place the PHP and HTML files in the proper directory.
  23. This is not necessarily true you can include the SET in an insert statement see MySQL:INSERT syntax for more and you will notice the second method of using the INSERT statement allows the use of the SET statement, you just don't see it used that much and instead see the UPDATE being used.
  24. Installing XAMPP was the objective not wether md5 is a file structure which it is not so do not worry about MD5 again it is NOT a file system it operates on files and strings and as such can not open anything only alter it.The correct program for it is MSI or .msi but you will not see it it is built into the install, just doubleclick the program and it will work, forget MD5
  25. The BB Codes that are used on this site are custom BB Codes I think Microscopic Earthling created most of them and might be able to explain these codes more clearly than anyone else. I think in the testing forum there might be some information about how these code were created but I am not sure so you could give that a try.
×
×
  • 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.