wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
Loading PHP extensions on host server
wildteen88 replied to HooligansInDaKitchen's topic in PHP Coding Help
If you have access to the php.ini you can enable the exenstions there, either by adding [code]exension=php_[extension_name_here].dll[/code] or by uncommenting the line in the php.ini If you dot not have access to the php.ini. Then you'll want to contact your hosts about it. They may enabled it for you. -
Standard POST variables not working on server
wildteen88 replied to chrispols's topic in PHP Installation and Configuration
No. Its to do with your PHP setup. -
Yes. Give your form a name by adding the name="my_form_name" attribute to the form tag then use use the following javascript: document.my_form_name.action='new action here'
-
Try something like this: [code]<?php if($var == bla) echo "var is bla"; } ?>[/code] Obviously I have deliberatly leftout the opening curly bracket to force an error inbthe code. You should get an error like the following: Parse error: parse error, unexpected '}' in path/to/your/file/here]on line 5 If you mean notice errors, which are not errors. You'll want to remove [b]& ~E_NOTICE[/b] from the error_reporting directive in the php.ini
-
If youre using Apache then it'll be the htdocs directory not www, which will be located in C:\server\Apache2\htdocs\ (if you followed my tutorial that I link to in your earlier thread). If you didnt follow it then by default it'll be located in C:\Program Files\Apache Group\Apache2\htdocs There'll be some demo html files in that folder. Delete all files in the htdocs folder. Now add your files and folders to that folder. Go to http://localhost/ and you should see your files/folders you just placed in the htdocs folder, or your index file will be shown.
-
The correct forum for this post this is the [url=http://www.phpfreaks.com/forums/index.php/board,11.0.html]PHPFreaks.com Questions, Comments, & Suggestions[/url] forum. That si forum your report any problems with forum/site you are having. However for the error you're getting is where we get so much traffic our database runs out of connections to give out.
-
You'll want to work with percentages rather than pixels if you want the your layout/div to fit in all screen resolutions.
-
Standard POST variables not working on server
wildteen88 replied to chrispols's topic in PHP Installation and Configuration
Use $_POST rather than $HTTP_POST_VARS $HTTP_*_VARS are depreciated. You should use the newer superglobal arrays instead. Which are ($_GET, $_POST, $_COOKIE, $_SERVER, $_SESSION etc). -
open up the httpd.conf and find the following line: [code]# same purpose, but it is much slower. # DirectoryIndex[/code] After where it says DirectoryIndex there should be a lists of index.(extension here). Check to see if index.html is in that list or if you use .htm as the file extensions check that index.htm is in the list. If index.html or index.html is not in that list then add them in, making sure you add a spaces between them eg: [code]DirectoryIndex index.html index.html.var index.php index.htm[/code] Save the httpd.conf and restart the Apache server for the changes to be made.
-
Can you install PHP on XP Home Edition?
wildteen88 replied to Greenie's topic in PHP Installation and Configuration
Yes you can install it on Windows XP Home Edition, I have it. The other tutorials are most probably intalling PHP on IIS. IIS is a web server by Microsoft which come with Windows XP Pro/Windows Server editions. If you want a webserver which you will, unless your are running your PHP scripts via the command line. Then download and install Apache. Apache is free to use and download from http://httpd.apache.org TO install PHP just go to php.net and download the Zipped Binaries (NOT the installer!). For installing Apache and PHP have a read [url=http://www.phpfreaks.com/forums/index.php/topic,108327.msg435982.html#msg435982]of this thread[/url] -
Tables are not ment for layouts. They are mean for displaying tabular data, such as showing temeraters throughout the year. Tabled layouts are easy to do yes. However for me tableless layouts are a lot easier. Plus you get the benefit of coding less HTML, smaller file sizes. You can get a two colmn layout with a header done with just 3 div tags and a few lines of CSS. Where as if its tables it'll be more like 10 or more tags. CSS is specifically designed to style your layouts. Not HTML. HTML is just the blue print of your website.
-
Turn on regitser_gloabls in then php.ini. Restart your server after you've made the changes though, I do not recommend you to turn this setting on as it can cause security exploits in your code, thus why it is turn off by defeault. You should use the superglobals arrays ($_GET, $_POST, $_COOKIE etc). However most apps should work with this settting off anyway. If the app you are using requires this setting to be on then I would not recommend you to continue using that app.
-
[quote author=btherl link=topic=111002.msg449617#msg449617 date=1160449587] Try including the sql statement in your die(), like this: [code]$sql = "SELECT * FROM table"; mysql_query($sql) or die( 'Error executing $sql ' . mysql_error());[/code] [/quote] Use double quotes btherl. Variables will not work in single quotes. Try this instead: [code]$sql = "SELECT * FROM table"; mysql_query($sql) or die( "Error executing query: {$sql}<br />\n" . mysql_error());[/code]
-
PHP looks for the files needed in three places, the WINDOWS (or WINNT depending on the version of Windows you're using) folder, the System32 (WINDOWS/system32) folder or the Windows PATH variable. It will not search the whole computer finding the files. If you want php to find your php.ini you''ll need to tell it where it is, either by adding a registery entry or by adding the following to Apaches conf file: [code]PHPIniDir = "C:/"[/code] The above only works for Apache2.0.x or higher.
-
Rather than using a for loop it'll be better if you use a foreach loop: [code=php:0]foreach($_POST['like'] as $key => $value) { echo "post = " . $value; }[/code]
-
How are you accessing the [b]a[/b] URL paramter in your script? The following should work: [code=php:0]echo $_GET['a']; // returns the value of a[/code]
-
[quote author=Wuhtzu link=topic=111028.msg449682#msg449682 date=1160465731] just do something like this in your stylesheet: [code]body,html{ margin: 0px 0px 0px 0px }[/code] it goes like "margin: top right bottom left"[/quote] if you want all margins (top, right, bottom, left) margins have no margins, just margin: 0px; ,will do.
-
Find my error ? RESOLVED THANKS GUYS N GIRLS !
wildteen88 replied to Distant_storm's topic in PHP Coding Help
Could you point out line 186 Also post lines 183 to 189 here. -
Remove those spaces between each letter and use the code tag [nobbc][code][/code][/nobbc] when posting code. Otherwise this thread is going to the trash.
-
larger code on one page, or spread out(bottom of post)
wildteen88 replied to Ninjakreborn's topic in PHP Coding Help
It doesnt matter how many files you use. You can code a whole app in just one file if you want. However this file will be huge and have tons of lines of code. Hard to debug, edit etc. Having multiple files is much easier to handle. As you can easily find what you wnat to edit. Rather than opening up your big file and go where is that function or whatever. -
If php cannot find a php.ini file it'll use the defualt settings which is builtin to the intepreter. In order to get a php.ini file you'll want to rename php.ini-recommended to just php.ini. Now move php.ini to C:\windows (change C to the letter fo your hard drive). Restart Apache and phpinfo should now reflect the changes you make to the php.ini NOTE: If you are using Apache2.0.x or greater you can add the following: [code]PHPIniDir "C:/WINDOWS/"[/code] To the httpd.conf file.
-
larger code on one page, or spread out(bottom of post)
wildteen88 replied to Ninjakreborn's topic in PHP Coding Help
No they are not the same. The following: [code=php:0]if ($_GET['status']) { $status = $_GET['status']; }elseif ($_POST['status']) { $status = $_POST['status']; }[/code] Doesnt check for the [b]existance[/b] of the variable, but checks whether $_GET['status'] is either true (it will return true if it holds a boolean, string, numeric value etc) or false. Where as if(isset($_GET['status'])) checks whether the variable exists and not the value You should use isset for check whether a variable exists, never if($_GET['status'])