wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
You cannot run PHP code through dreamweavers design tab or use DW preview features like you can with html. You must save the code as a .php file then upload/move to your server. Then you go to your site or local dev site (localhost) and run it there.
-
not its not. Do not ignore errors/messages PHP displays always try to fix them.
-
Hold on I think I have over looked something. Looking through the thread I mis read the following post of yours: The bit that I missed read is highlighted in red. That error message leads me to believe that you connected to mysql, however during the query the connection was lost. Whats the output of the following code: <?php // Database credentials $user = 'MyId'; $pass = 'MyPass'; echo 'Initializing database connection...<br />'; $conn = mysql_connect('localhost', $user, $pass); echo 'Database connection initialized!<br />'; echo 'Attempting to select database for use...<br />'; mysql_select_db('database_name_here', $conn); echo 'Database selected!'; ?> Note if you get any errors post them here in full
-
Thanks for the reply. I already knew that though. That's what happens - when I browse to the php forum via the HTTP address in IE, I get the same "Page cannot be found" when indeed the files do exist. Check your servers error log to see why it may be giving the file cannot be found error message, it may holds clues to as to why. What do mean by this: For some reason I still cant get the php files to open with the PHP executable... I'm not sure why it defaults to IE. Can you explain that more.
-
remove the @ from infront of the mysqli connection line.
-
have you confirmed you are using the correct hostname - first parameter of the mysql_connect function. Also if the mysql server is on the same server as the site then you can just use localhost rather than specifying the actual hostname and port. PHP connects to port 3306 by default when connecting to MySQL.
-
It depends. Are you sure you are using the correct username and password to connect to the mysql server?
-
the mysql_connect function is for connecting to a mysql database Does your site use a mysql database? No as it is sent through the mysql_connect function. Change the values for the $user and $pass variables to that of your database username and password.
-
change localhost in mysql_connect function to sub.mysite.com:3306 where 3306 is change it to the port number sub.site.com's database runs on.
-
You can change the CSS to this: /* all anchors in the document will have a defualt colour of blue */ a { color: blue; } /* all anchors with the class of 'class2' a green colour - this will override the default colour */ a.class2 { color: green; }
-
I don't understand VB either however the converted code will be like this: <?php // Database credentials $user = 'MyId'; $pass = 'MyPass'; $conn = mysql_connect('localhost', $user, $pass); mysql_select_db('database_name_here', $conn); /* I couldn't see what database the VB code was using. If you know it replace 'database_name_here' with the actual database name */ $sql = 'SELECT * FROM View_Towns WHERE Number = 1'; $result = mysql_query($sql, $conn); if(mysql_num_rows($result) > 0) { echo 'Results found!'; } else { echo 'No results found!'; } mysql_close($conn); ?>
-
It is becuase when your first run the script the test variable is not set in the URI and this PHP displays the Undefined index notice message, but when you submit the form with filled filled in (or not) the test variable in the URI is then set in the URI What you should do is check that the variable exists first before using it. You'd do this by using the isset function in an if statement. Take a look at the above example posted by papaface
-
This is the correct CSS: .class1 a{ color: blue; } .class1 a.class2 { color: green; } </style> <div class="class1"> <a href="moo.html">This link shows up as blue</a> <a href="moo2.html" class="class2">This link shows up as blue even though it should be green.</a> </div>
-
blue and green for me using IE7.0, Opera9.10 and FF2.0 on windows.
-
did you restart WAMP? If I remember correctly to restart WAMP you click the WAMP task bar icon and select restart All services from the list.
-
When you run php files you should open your browser and go to http://localhost You shouldn't run the php files by "double clicking" them to run from Windows Explorer.
-
[SOLVED] is there a way to install php-cgi?
wildteen88 replied to pearlygate's topic in PHP Installation and Configuration
PHP5 comes with php-cgi. Just download the PHP5 package from php.net. When you have installed PHP go to the PHP installation folder (C:/PHP - default installation path) and look for a file called php-cgi.exe -
Enabling mcrypt in PHP on Windows Server 2003
wildteen88 replied to iissmart's topic in PHP Installation and Configuration
It should be logging them to Apache's error.log file which should be located in the logs folder inside the Apache installation folder. -
If it needs to go at the bottom of page source then edit the template called index.template.php and scroll down to line 435: Line 435 should look like this, NOTE: I am referring to the default theme. </body></html>'; and change it to this: </body></html> <script type="text/javascript"> var dc_AdLinkColor = \'orange\' ; var dc_UnitID = 14 ; var dc_PublisherID = XXXX ; var dc_adprod = \'ADL\' ; </script> <script type="text/javascript" src="http://kona.kontera.com/javascript/lib/KonaLibInline.js"></script>'; Your Kona adds should display on every page on your forum.
-
I think from that error it means you have too many columns listed in your query that doesn't match the number of columns you have in your customers table. How many columns do you have in your query and how many do you have in the customers table? From looking at your query you have 53 columns. Is that correct in your database? Also I notice you use blank values in your query. If you are not going to insert a value for a column then don't include it in your query.
-
Only have one php.ini, delete all others. I would recommend you to keep the php.ini that is located in C:\WINDOWS For turning a setting called display_errors to On in the php.ini you simply search for the following line: ; server, your database schema or other information. Beneath that line will be the display_errors setting. change Off to On Now change a setting called error_reporting (which is just a few lines above the setting your just changed) to E_ALL. Now save the php.ini and restart IIS. Re run your code and if there is any problems with the script PHP will display errors messages this time, these errors message will help debug your code. Post all error messages you get here
-
There may be a problem with your query. Change this line: mysql_query($sql); to: mysql_query($sql) or die('There is a a problem with the query: <pre>' . $sql . '</pre><br />' . mysql_error());
-
Need query string without a question mark...is it possible?
wildteen88 replied to boadster's topic in Apache HTTP Server
You will want to use modRewrite if you want to use the follow URI for the query string: http://my.domain.com/querystring Instead of http://my.domain.com/index.html?name=querystring -
Enabling mcrypt in PHP on Windows Server 2003
wildteen88 replied to iissmart's topic in PHP Installation and Configuration
Edit your php.ini and turn a setting called "display_start_errors" to on. Save the php.ini and restart Apache. What startup errors do you get. -
The path in which you installed PHP to, which is "D:/WebServer/php"