473,734 Members | 2,514 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Notice: Undefined variable: db_host in C:\wamp\www\cbm all\index.php on line 7

Notice: Undefined variable: db_host in C:\wamp\www\cbm all\index.php on line 7

Notice: Undefined variable: db_user in C:\wamp\www\cbm all\index.php on line 7

Notice: Undefined variable: db_pass in C:\wamp\www\cbm all\index.php on line 7

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localho st' (using password: NO) in C:\wamp\www\cbm all\index.php on line 7
Error connecting to database server: Access denied for user 'ODBC'@'localho st' (using password: NO)

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. // Setup some variables
  3. include_once( "admin/settings.inc.php" );
  6. // make the database connection
  7. $db            = mysql_connect( $db_host, $db_user, $db_pass ); # or die "Could not make connection to database server\n";
  8. if ( ! $db ) {
  9.     print "Error connecting to database server: ".mysql_error();
  10.     exit;
  11. }
  12. mysql_select_db($db_name);
  14. // grab the template...
  15. $fh = fopen( 'templates/main.html', 'r' );
  16. $content = '';
  17. while( ! feof($fh) ) { 
  18.     $content .= fgets($fh);
  19. }
  20. fclose($fh);
  21. preg_match_all( "/\{Category: (.*?)\}/i", $content, $replacement_fields, PREG_SET_ORDER );
  23. $content = str_replace( '{COUNT_ALL}', get_count_all(), $content );
  24. foreach ( $replacement_fields as $category ) { 
  25.     $repl_string = "{Category: $category[1]}";
  26.     $replacement = get_category_html($category[1]);
  27.     $content = str_replace( $repl_string, $replacement, $content );
  28. }
  29. print $content;
  30. exit;
  32. function get_count_all() { 
  33.    global $db;
  34.    $sth = mysql_query("SELECT COUNT(*) as c FROM cb_urls");
  35.    $r = mysql_fetch_array($sth);
  36.    mysql_free_result($sth);
  37.    return $r['c'];
  38. }
  40. function get_category_html( $category_name ) {
  41.     global $db;
  43.    $count_all = 0;
  44.    $sql = mysql_query("SELECT COUNT(*) as c FROM cb_urls WHERE category LIKE '".addSlashes($category_name)."%'");
  45.    $r = mysql_fetch_array($sql);
  46.    mysql_free_result($sql);
  47.    $count_all = $r['c'];
  49.     $sql = "SELECT DISTINCT(category) AS c FROM cb_urls WHERE category LIKE '".addSlashes($category_name)."%'";
  50.     $sth = mysql_query($sql,$db);
  51.     $ret_string = '                                          <P ALIGN=LEFT><B><FONT SIZE="-1" FACE="Verdana,Tahoma,Arial,Helvetica">'.$category_name.' ('.$count_all.')<BR></FONT></B>' . "\n";
  52.     while( $res = mysql_fetch_array($sth) ) { 
  53.       $sth2 = mysql_query("SELECT COUNT(*) as cnt FROM cb_urls WHERE category='".addSlashes($res[c])."'");
  54.       $r = mysql_fetch_array($sth2);
  55.       mysql_free_result($sth2);
  56.         $nameA = split("::",$res[c]);
  57.         $name = $nameA[1];
  58.         if ( $name ) { 
  59.             $ret_string .= '                                             <A HREF="search.php?keywords='.urlencode($res[c]).'" onMouseOver="window.status=\''.addSlashes($name).'\'; return true;" onMouseOut="window.status=\'\'; return true;"><FONT SIZE="-2" FACE="Verdana,Tahoma,Arial,Helvetica">'.$name.' ('.$r[cnt].')</FONT></A>'."\n";
  60.             $ret_string .= '                                             <FONT SIZE="-2" FACE="Verdana,Tahoma,Arial,Helvetica"></FONT>'."\n";
  61.         }
  62.     }
  63.    mysql_free_result($sth);
  64.     return $ret_string;
  65. }
  66. ?>
settings.inc.ph p
Expand|Select|Wrap|Line Numbers
  1. <?
  3. // Setup variables
  6. // Database
  7. $db_host = 'localhost'; // the host where your database server is running
  8. $db_name = 'cbmall'; // the name of the database
  9. $db_user = 'root'; // the username for connecting to the database
  10. $db_pass = '696969'; // the password for connecting to the database
  12. // Clickbank ID
  13. $cb_user = 'Clickb'; // your clickbank affiliate id
  15. // full url path to the script file - include trailing slash
  16. $path = 'http://localhost/cbmall/';
  18. //  full url path to your XML file
  19. $xmlfeed = 'http://localhost/cbmall/xml/marketplace_feed_v1.xml';
  21. // Admin password - change to whatever you want
  22. $adminpsd = '696969';
  26. // PROBLEMS? Make sure ALL settings are 100% accurate.
  29. ?>
Nov 23 '10 #1
1 7596
1,059 Top Contributor
on settings.inc.ph p



instead of


it will solve your problem
Nov 24 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Dan Finn | last post by:
OpenBSD 3.2 Apache 1.3.26 PHP 4.3.4 PHP-Nuke 6.9 getting these in the apache error log: Sun Nov 16 20:20:16 2003] PHP Notice: Undefined variable: HTTP_USER_AGENT in /htdocs/nuke/html/mainfile.php on line 16 PHP Notice: import_request_variables(): No prefix specified - possible security hazard in
by: Jason | last post by:
hello, i am new to PHP, so go easy. I am using the examples in the book: PHP: Your Visual Blueprint For Creating Open Source, Server Side Content In the section where they talk about getting values from a form submission, the book says:
by: bissatch | last post by:
Hi, I get the following error: Notice: Undefined variable: end_while in C:\Program Files\Apache\Apache2\htdocs\csp\inc\xmlmenu.php on line 102 This is a script that works on the server at work but it has difficulty
by: prabhunew2005 | last post by:
hi I am doing web portal design using php. I gave part of one of my screen coding. <html> <head> <script language = "javascript"> function list_all_click()
by: dmain1971 | last post by:
I have a class with an empty array like so: private $detail = array(); Then I have a function later on in the class: function get_array_value() { $detail_info = ' ';
by: Bob Bruyn | last post by:
I've recently installed Apache 2 and php 5.2 on my WIndows XP machine. Everything is up and running. I'm passing some vars via the URL. It works fine online: http://www.torusdesign.nl/spry/test.php?folder=schilderijen/vrij_werk&navColor=SchilderijenNAV This is the code: <?php echo $folder; ?> <?php echo $navColor; ?>
by: Reggie | last post by:
am trying to create a a upload file.am uploading files ok but i recieve this message. Notice: Undefined variable: uploaded_size in /home/fhlinux169/c/ clashoff.co.uk/user/htdocs/upload.php on line 7 Notice: Undefined variable: uploaded_type in /home/fhlinux169/c/ clashoff.co.uk/user/htdocs/upload.php on line 14 Notice: Undefined index: uploadedfile in /home/fhlinux169/c/
by: printline | last post by:
Can anyone help me with why i am getting this error message: Notice: Undefined variable: SalesRepID in C:\Inetpub\wwwroot\index.php on line 158 Here is my php code: <?php session_start(); session_register("LoggedIn"); session_register("SavedSearchType");
by: siyaverma | last post by:
Hi, I am new to php, i was doing some small chnages in a project developed by my collegue who left the job and i got the responsibility for that, After doing some changes when i run it on my local server it was working fine but giving some errors those are Notice: Undefined index: phplogin in C:\Inetpub\wwwroot\sampleft\index.php on line 116 Notice: Undefined variable: username in C:\Inetpub\wwwroot\sampleft\index.php on line 116 ...
by: cyberlei | last post by:
hi all, I`m getting this error Notice: Undefined index: user in c:\inetpub\wwwroot\login.php on line 96 Notice: Undefined variable: message in c:\inetpub\wwwroot\login.php on line 101 Could someone please tell me where I did wrong? Here is the Code, Thanks a lot <?php
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.