Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. If you are getting a blank page then there may be an error which is occurring when you go to http://localhost/sqlitemanager/ To see if there is any error occurring open up you php.ini and find the following: [code]; server, your database schema or other information. display_errors = Off[/code] Change Off to On after display_errors = Now save the php.ini and restart your server. Now go back to http://localhost/sqlitemanager/ do you get any errors?
  2. Perhaps you'll want add you sites to the "Site Manager" Go to Site > Manage Sites and select a previously defined site from the dialog box, Dreamwevaer will now use the settings for the defined site you ahve just selected or go to Site > New Site and define a site you wish to mange.
  3. Or pass it in as the second  parameter for the ExecuteAndGetResult function: [code=php:0]require('config.php'); print_r($db_info); // 1 /* This is a complete PHP page all database related stuff goes here */ function ExecuteAndGetResult ( $query, $dbi ) {       print_r($dbi);  // 2 } ExecuteAndGetResult("query_here", $db_info);[/code]
  4. A better option is use the HEREDOC syntax, no need to escape any quotes: [code=php:0]<?php if ($page == 'names'){ echo <<<HTML_CODE </td>   </tr>   <tr class="navtext2">     <td height="22" colspan="3" valign="top"> <div id="navcontainer">               <div align="left"><font color="#747474"> {$row_names['fullname']} </font></div>       </div>       <div>         <div align="left"></div>       </div>       <div></div></td>   </tr> HTML_CODE; // DO NOT INDENT OR PUT ANYTHING ON THE LINE ABOVE } ?>[/code] When using HEREDOC syntax you may need to wrap curly braces around your variable names ({$my_var}), especially if its an array.
  5. That code is completly fine flash gordon. What error(s) do you get? POst them here in full if you get any. ALso add the mysql_error() function to the die clause. So this line: [code=php:0]mysql_connect("localhost", $username, $password) or die ("Could not connect to database");[/code] is like this: [code=php:0]mysql_connect("localhost", $username, $password) or die ("Could not connect to database<br /><br />" . mysql_error());[/code] This should now retrieve an error message from MySQL if there is an error occurring anywhere.
  6. PHP can run on virtually any operating system in existence. For finding out the php version just create a new file called info.php and add the following code to it: [code=php:0]<?php phpinfo(); ?>[/code] Now run the file in the browser (http://my-domain.con/info.php) and it should display information about PHPs setup and Server information. Also PHP supports many different databases including MySQL. Go to php.net for more information.
  7. Probably want to use min-width on the two. So when you resize the browser it should stop resizing the width of the element you applied the min-width to. However min-width is not supported by some browsers (especially IE6 or below))
  8. Well the header already sent error message is probably caused by the first error. So if you fix the first error then all should be fine. See if changing $REMOTE_ADDR to $_SERVER['REMOTE_ADDR'] sorts it out.
  9. You'll want to add in the relevant HTML into the string. Like so: [code] row.innerHTML = values[1] + '&nbsp;&nbsp;' + '<img src="Icons/owner.ico"><span style="font-family: Tohoma">' + values[2] + '</span>&nbsp;&nbsp;' + text; [/code]
  10. Make sure you have allowed (internal) access to port 80 in your firewall software. Your firewall might be blocking requests to and from port 80.
  11. [quote author=mgallforever link=topic=116489.msg474616#msg474616 date=1164657870] try using double quotes instead of single quotes while defining your host,user,pass and dbname [/quote] That wont make a single difference ;) The problem is because you dont have the mysql extension enabled. Please read the thread titled "[b]Call To Undefinded Function mysql_connect[/b]" in the [url=http://www.phpfreaks.com/forums/index.php/board,41.0.html]FAQ/Code Snippet Repository[/url] forum. Should be able help you. Note: that FAQ is for Windows only. If you are on a linux based OS then you'll need to recompile PHP the --with-mysql=path/mysql/installDir command option
  12. I see you seem to be having a lot of trouble positing and you are post so called 'test posts/threads' around the place. Please could you not do this as this will be considered as spamming the board. What you should do if you cant post is to post a thread in the [b]PHPFreaks.com Questions, Comments, & Suggestions[/b] forum as this will get to the mods/admins attention quicker. Or Pm one of the users that have blue, purple or red usernames. These guys are the mods and admins of the boards so should be able to help you out. Also 99.9% of the time you get this when your post contains HTML especially the script tags. If you are not post any HTML what's so ever then upload a text file to your site with what your trying to post.
  13. The only way to make an optional variable (parameter) for a function is to provide a default value if that parameter is not passed to the function when called.
  14. Its a setting issue in that case if thorpe cannot find any calls to any superglobal arrays. Your PHP3 server has a setting called register_globals enabled. This allows you to use $var instead of $_POST['var'] or $HTTP_POST_VARS['var']. register_global can create a security exploits in your code if you are not careful and, thus the decision from the PHP Devs to disable this setting by default as of PHP4.2 (or PHP4.3 cant remeber which version), also this setting will be going completely too as of PHP6. However for a decent mail script. I have heard a few members recommending a mail script called phpMailer
  15. You'll probably want to set up a virtual host in IIS control panel for each domain. But yeah this is a server configuration issue. I'll move this to the IIS support forum for you.
  16. That setting is new to PHP5.2 so I think you have to add it in manually.
  17. As .htaccess files work on a per-directory bases and effects all sub-directories with in the same directory as the .htaccess file in. I should place a .htaccess file in the root of the folder in which you files are viewable via the browser which would be the www/ directory. Add the following to it: [code]php_flag safe_mode Off[/code] It should now turn off safe_mod throughout your site.
  18. If you float the green box left then it'll work the way you want it to.
  19. People will not be able to connect to your Apache server unless they know your computers IP address and that you have  allowed external access to port 80, which should be the port Apache should be running on.
  20. You forgot the all important semi-colon at the end of this line: [code]Advertising Rules 2001"[/code] C_V beat me :)
  21. That is PHP code. Looks like there is an unclosed quote in an echo/print statement which is showing the PHP code. Could you post the full code here for where the above code came from and I'll have a look. Dont post as text here attach it as a file attachment. To do so Click Reply button and then click the Additional Options... link. Now attach the PHP file to the post by clicking the browse button and selecting the php file from the explorer window that opens.
  22. Your settings method appears to be the problem: [code]function settings(){ //MySQL settings. $this->mysql['host'] = $mysql['host']; $this->mysql['user'] = $mysql['user']; $this->mysql['pass'] = $mysql['pass']; $this->mysql['dbname'] = $mysql['dbname']; //MySQL errors. $this -> mysql['con_error'] = "<b>MySQL encountered a severe error while trying to connect to the host</b>n";         $this -> mysql['db_error'] = "<b>MySQL encountered a severe error while trying to use the database</b>n";         $this -> mysql['gen_error'] = "<b>MySQL Error: <b>Due to a database error this page cannot be displayed</b>n"; }[/code] You are setting up the mysql class variable with another array called mysql which doesn't exist. Where does the mysql array come from ($mysql). What would be better is to use a constructor instead of the settings function. The constructor is a function which will automatically be called by PHP when you initiate the class. What you'll want to do is pass the host, username, password and database name through to this function. You do this when initiating the class like so: [code=php:0]$mysqlC = new mysql('host', 'username', 'password', 'database_name');[/code] That will now setup the mysql class variable. Now all you need to do is call the do_connect function. Heres your improved class: [code]class mysql { //MySQL var var $mysql = array();     // The constuctor! YOu'll notice this has the same name as the class.     function mysql($host, $user, $pass, $dbname)     {         //MySQL settings. $this->mysql['host'] = $host; $this->mysql['user'] = $user; $this->mysql['pass'] = $pass; $this->mysql['dbname'] = $dbname; //MySQL errors. $this -> mysql['con_error'] = "<b>MySQL encountered a severe error while trying to connect to the host</b>n";         $this -> mysql['db_error'] = "<b>MySQL encountered a severe error while trying to use the database</b>n";         $this -> mysql['gen_error'] = "<b>MySQL Error: <b>Due to a database error this page cannot be displayed</b>n";     } //MySQL connect function. function do_connect()     { $connect = mysql_connect($this->mysql['host'], $this->mysql['user'], $this->mysql['pass']); $db = mysql_select_db($this->mysql['dbname']); if(!$connect){ echo "<br>"; echo $this->mysql['con_error']; }elseif(!$db){ echo "<br>"; echo $this->mysql['db_error']; } } //MySQL query function function sql_run($sql)         { $this->do_connect(); $res = mysql_query($sql); if(!$res){ echo "<br>"; echo $this->mysql['db_error']; }else{ return($res); } } //MySQL mysq_num_rows function. function num_rows($sql)         { $this->do_connect(); $now = $this->sql_run($sql); $res = mysql_num_rows($now); if(!$res){ echo "<br>"; echo $this->mysql['db_error']; }else{ return $res; } } } $mysqlC = new mysql('localhost', 'root', '', 'mysql'); $mysqlC->do_connect();[/code]
  23. What extensions have you enabled in the php.ini? As these look like errors from failed extensions that are trying to find the above dlls. Could you attach your php.ini to your post please so I can have a look at it. Also can you post about your PHP setup too, such as how PHP was installed.
  24. Not sure what you mean. Could you post a screenshot of what you mean, also could you post a the output you get too when you go to View > Source.
  25. If you want each row to createe a separate link then your whole while loop is wrong. It should be like this: [code]while($row = mysql_fetch_assoc ($board_query)){ $board_id = $row['id']; $board_name = $row['Board']; $board_description = $row['Description']; echo '<a href="link.php?id=' . $board_id . '">' . $board_name . '</a><br />'; echo '<span style="font-size: small">' . $board_description . '</span><br /><br />'; }[/code] That should now print out a link for each board with its description.
×
×
  • Create New...

Important Information

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.