wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
Use mysql_query as you dont have the mysqli extension enabled so you are getting the undefined error message with any mysqli related function. mysqli based functions are only available for PHP5+ the is configured to use the mysqli extension. If you are using PHP4 then you cannot use or enable any mysqli functions as they are not available for that version. If you wish to use the mysqli related functions then you'll want to upgrade PHP to version 5, or move to a different host that has PHP5 installed and is configured to use the mysqli extension.
-
Could you please provide more infomation as your question is a little vague.
-
Trying to install phpMyAdmin 2.8.2 .. but not working
wildteen88 replied to msaz87's topic in PHP Coding Help
You appear to be editing the wrong file! The file you want to edit is called [b]config.defualt.php[/b]. You'll find this file within the [b]libraries[/b] folder. You'll want to copy this file, dont move but copy it, to the root of the phpMyAdmin folder. Now rename this file to [b]config.inc.php[/b] Open this file within your PHP editor or any text editor, suhc as wordpad. The lines you'll want to change are lines 71, 72, and 73 within config.inc.php. In order to configure phpMyAdmin. Lines 71, 72 and 73 is the following code: [code=php:0]$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)? $cfg['Servers'][$i]['user'] = 'root'; // MySQL user $cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed // with 'config' auth_type)][/code] -
This is odd!? Why does one script work and the other not?
wildteen88 replied to bobleny's topic in HTML Help
Sometimes some browser dont ignore the wide space between or within table cells. It usually corrected by removing the white space from within and around the td tags. Also about the width. The width of an element is calculated by adding the total border and padding sizes to the the current width of an element, such as a table cell. So for example you have a border for your table set to 1px and have set a width of 192px for one of your table cells. The browser will give the cell a total of 194px. Here its added more 2px to the total width, why? Because on each side, the left and the right, of the element will have a border of 1px so it adds those two sides up together to get the total border width. You might want to read up on the box model. Heres an [url=http://www.redmelon.net/tstme/box_model/]Interactive demo[/url] of the box model. -
Use extract function, example [code=php:0]extract($row);[/code]
-
The gap will be nothing. When you use < br /> it makes the text go to a newline until you use two or more < br> tag then they'll be a gap, but the gap depends on the size of your font. So if your text was 24px each line will have a gap of 24px.
-
This tutorial [url=http://www.onlamp.com/pub/a/php/2003/01/09/php_foundations.html]here[/url] shows you how to read files in a directory. But to see whether a file is a PHP file or a TXT file I'd use the substr to get the last four characters from the filename. Then I'd use str_replace to remove the period (.) from the string. Now That I have just the extension I'd use if statment to see whether extension is equal to txt or use in_array to check the file extension again multiple file extensons.
-
I would recommend your to goto [url=http://www.php-mysql-tutorial.com/]php-mysql-tutorial.com[/url] and go through turorial numbers 1 through to 9. NOTE tutorial number one steps you through setting up Apache, PHP and MySQL locally so you run PHP scripts locally on your home PC.
-
The only way to do it is to create a test cookie in javascript then check to see whether the test is available. If the test cookie was retunr cookies are enabled otheriwse cookies are not enabled. [url=http://techpatterns.com/downloads/javascript_check_cookies.php]This site here[/url] explains/shows how to do this.
-
Well we do have a sister site called ajaxfreaks.com but unforunatly its down. I am not sure when it will be backup. But when it is you'll be able to submit your Ajax tutorial over there. Also about your tutorial I find it very hard to read the code in the tutorial with that black backgorund. I think you should consider using a lighter colour for the background for the code.
-
If you are usiong Apache2.2 you should downgrade to Apache2.0.x. PHP doesnt offically support Apache2.2.x Also about the PHPIniDir line. I forgot to add quotes around the Path.
-
Is that you code? If it is you have a few problems [b]unban[/b] should be [b]'unban'[/b] (including the quotes). Also [b]'.$pid.'[/b] wont work as it wont parse the $pid variable as it is in single quotes. You might want ot use double quotes instead. Also if $id is supposed to be an number you should check that it by doing this: [code=php:0]if(isset($_GET['id']) && is_int($_GET['id'])) { // unban ip code here } else { die("Please provide a valid id for the ipaddress"); }[/code]
-
Something like this: [code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>DIV Columns</title> <style type="text/css"> #col1, #col2 { width: 100px; padding: 10px; border: 1px solid #F00; float: left; } #col2 { border: 1px solid #00F; } </style> </head> <body> <div id="col1">Item1<br /> Item2<br /> Item3<br /> Item4<br /> Item5</div> <div id="col2">Item6<br /> Item7<br /> Item8<br /> Item9<br /> Item10</div> </body> </html>[/code]
-
Where ever you use sessions you must place session_start at the top of each page that uses sessions. Otherwise your sessions wont work.
-
Becuase you havnt told the for loop how many times you want it to loop. $prepareCount doesnt return an [b]integer[/b] but an [b]array[/b] so the for loop doesnt know how many times it needs to loop. So if you use the count function. This will count how many items there are in the array. So the start of your for loop will now look likes this: [code]for ($i = 0; $i < count($prepareCount)-1; $i++) {[/code] Notice [b]-1[/b] after count. This is stops the for loop from going on too many times, for example you have five items in array. Count will say you have 6 as its included the first item in the array which is zero.
-
MYSQL 5 Stripping addslashes() on Insert of new record
wildteen88 replied to JimChuD's topic in PHP Coding Help
The slashes are stripped automatically by PHP when you get the content out of the database (regardless of the state of magic_quotes_gpc). However if you look in side the mysql database using PHPMyAdmin or via the command line the slashes will still be there. -
How is $user being created? Are doing something like thios: [code=php:0]$user = mysql_fetch_array[/code] or [code=php:0]$user = mysql_fetch_row[/code] If you did then mysql_fetch_array and mysql_fetch_row will store the result in an array within the $user variable. If you want to just store the username then do this: [code=php:0]$user = mysql_fetch_array($result); $_SESSION['username'] = $user['username']; $_SESSION['password'] = $user['password'];[/code]
-
To embed say a video or a music file in to a page you'll want to look into imbedding objects into a webpage with html. This site here generates the HTML for you here: http://cit.ucsf.edu/embedmedia/step1.php
-
That is what the new code provided does: [code]$i = 0; while ($row = mysql_fetch_array ($query)) { $r = $row['units_covered']; $v = explode("'", $r); $units = "<option>"; $units .= $v[$i]; $units .= "</option>"; echo $units; $i++; }[/code] The while loop automatically calculates how many times it needs to loop in order to get all the results. Also the variable $i automatically increases by 1 with [i]$i++[/i], So when $v[$i] is stated when it goes for the first loop it use $v[0] then it use $v[1] for the secound loop, $v[2] for the third loop etc. Bascially the while loop and the for loop was doiing the same thing, but in a different way. You code should still ruin fine.
-
Basically your PHP script has run longer than the max execution time set in the PHP.ini You need to find the following line in the php.ini: [i]max_execution_time = 60[/i] And chnage 60 to the time in secounds for how long you want your scripts to timeout at. Save your php.ini and restart your server. Now to test this chnage has taken affect. Run the following script: [code=php:0]<?php phpinfo(); ?>[/code] When you run that code you should get a page full of information about PHP and the server. Now scroll down a find the line that starts with this: [b]max_execution_time[/b]. Both coloumns to the right should state what you set in the php.ini, for exmaple 120 If they dont scroll back up to the top and verify that PHP is using the correct php.ini by looking for line that starts of with this: [b]Configuration File (php.ini) Path[/b]. To the right of that it should state the full path to your php.ini file. Is the php.ini file in the location it is showing. If it is not in the location stated then PHP is currently not using the php.ini file. You can fix this by finding you php.ini file and moving it to the WINDOWS folder or if you have Apache2 installed you can add the following line to the httpd.conf file: [b]PHPIniDir C:\WINDOWS[/b] Change C:\WINDOWS to the correct path. For example if your php.ini file is in your PHP folder then use this: C:\php, presumming your PHP folder is in the root of the C drive. Once you have moved or added the PHPiniDir line to Apaches config file save any files you have changes and restart Apache. Run the phpinfo script again and check whether PHP is using the correct php.ini fileand that the max_execution_time setting has been updated.
-
The gap between the line is depends on the size of your font.
-
Can you explain in a bit more detail what you mean
-
Hava look at [url=http://www.dynamicdrive.com/dynamicindex1/dropdowncontrol.htm]this[/url]