wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
Premature end of script headers: index.php?
wildteen88 replied to limitphp's topic in PHP Coding Help
Yes it will be in the error log for Apache. -
Premature end of script headers: index.php?
wildteen88 replied to limitphp's topic in PHP Coding Help
Check your sites error log for the real error. -
whats wrong with it?? As was said earlier it is not PHP code. That whats wrong. Why you post this code?. You are not making any sense.
-
pfft.. i think i know what im talking about ive been programming in php for over 9 months now.. 9monts is nothing. Correct PHP syntax is like <?php $var = 'some value'; echo $var; call_some_function_here(); ?> What you posted is not event close to PHP. What! As in Apple Mac OSX? That is not even PHP thats a computer operating system.
-
That code doesn't event represent PHP at all. What are you trying to do?
-
What didn't work? You need to be more specific.
-
Line 46 should be
-
Is it possible to fetch from two arrays simultaneously?
wildteen88 replied to JeditL's topic in PHP Coding Help
This is bad code practice. Post your queries here. I assume you're querying two different tables. MySQL is able to pull data from multiple tables within one query using JOINs. -
[SOLVED] Crazy results from php/Sql
wildteen88 replied to wwfc_barmy_army's topic in PHP Coding Help
Oh.. I thought it was just some random code. What is the problem you are having? -
[SOLVED] Crazy results from php/Sql
wildteen88 replied to wwfc_barmy_army's topic in PHP Coding Help
This code is not needed at all. Just remove it $result2 = mysql_query("SELECT * FROM inputs WHERE user_id = " . $userid); if(!$result2){ die("Error quering the Database: " . mysql_error());} $total_items = mysql_num_rows($result2); echo "Total Number of records in Database: " . $total_items; Everything else is fine. However the code could be tidied up a bit. -
EDIT CV got there first Umm. That is completely the wrong syntax. This is the correct syntax $cust_name = array(); foreach($CustomerList_result->getRecords() as $CustomerList_row) { $cust_name[] = $CustomerList_row->getField('d_company'); }
-
You will need to edit your links to reflect your new url format. mod_rewrite cannot modify your links.
-
Do not use the installer for PHP. Instead download the VC6 Thread Safe Zip package from http://windows.php.net/. Extract the contents of the zip to C:/php. Rename php-development.ini (located in C:/php) to php.ini. Now add the following to Apaches httpd.conf (This is located in C:/<path to apache>/conf) LoadModule php5_module "C:/php/php5apche2_2.dll" AddType application/x-httpd-php .php PHPIniDir "C:/php" Save the httpd.conf. Now add C:/php to the Path Environment Variable. Restart Windows and PHP is installed. Before modifying the php.ini first test whether everything is setup correctly. Create a new file called info.php in C:/<path to Apache>/htdocs. Add the following code to this file <?php phpinfo(); ?> Open you browser and go to http://localhost/info.php. You should get a white/purple which details PHP configuration/environment. If you do everything is setup and you're good to go.
-
date expects a unix timestamp. You need to do
-
Check your sites error log. Your server may not have the mod_rewrite module enabled.
-
What code are you using now?
-
or simply use the $_SERVER['SCRIPT_NAME'] variable instead.
-
As mentioned above PHP code is not compiled. Unlike Java is for Java Applets. To run PHP code you need install PHP itself. To do so go to php.net to download the PHP interpreter. However installing PHP on its own will only give you an unhelpful command line. To run your scripts in your webbrowser on your computer you can install what is known as the AMP stack, This consists of Apache a HTTP server. MySQL a popular database server and PHP itself. This allows you to run your PHP scripts from your computer in your browser by going to http://localhost. You can either download the above and install them individually or you can use an "All in one package". The post popular being WAMP (for Windows only) or XAMPP (for Windows, Linux and Mac). These install and configure the stack for you. I use WAMP personally. To use your PHP scripts with WAMP you need to save them to C:/wamp/www. All scripts must end in .php. This file can contain PHP and HTML. PHP code will not be parsed in .html files. To run your scripts you go to http://localhost/ You can use any editor to create your PHP scripts. No special software is needed, only the AMP stack for running PHP on your computer. Yes you just upload it to your website as you do with your HTML/CSS/images etc. No not quite. Just rename your .html files to .php. Now you you just add your PHP code within PHP tags (<?php ?>). You cannot call PHP code as you can with Javascript. PHP only works when a request has been made to the server.
-
What! I meant you need to edit your code. phpMyAdmin has nothing to do with it. You need to edit this line in your code: $sql = "SELECT * FROM credits ORDER BY user_id"; Change that line to $sql = "SELECT * FROM credits ORDER BY user_name"; Change user_name to the actual field name that holds the username's in your credits table.
-
The user account you're using on Windows doesn't appear to have Administrator privileges. Without this you will not be able to run programs As Administrator or control system services (this is why MySQL cant start).
-
Difficulty switching between php 5.2.x and php 5.3 on apache
wildteen88 replied to thepreacher's topic in Apache HTTP Server
The problem is when use PHP5.3 it will use the .dlls for 5.2.x as its the first item in the PATH Environment Variable. What you are better of doing is download PHP5.2.x zip package and extract the contents of it to C:/php. Then Download the zip package for PHP5.3 and extract it to C:/php5.3. Add ONLY C:/php to your PATH. Now add the following to Apaches httpd config. LoadModule php5_module "C:/php/php5apache2_2.dll" AddType application/x-httpd-php .php .phtml .php3 PHPIniDir "C:/php" When you start Apache it will be using PHP5.2. To swap versions simply stop Apache and rename C:/php to C:/php5.2 and C:/php5.3 to C:/php. When you start Apache it should be using PHP5.3. To go back to PHP5.2 just rename the folders again. Pain in the arse but it should work. -
Remove the highlighted character on this line
-
Look into pagination to achieve this.
-
It is because the variable $dbc cannot be seen by your function. This is due to functions having their own variable scope. A dirty fix is to change function val($field = false){ $errors = false; to function val($field = false){ global $dbc; $errors = false; Now your function will work as expected