wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
This forum is done in PHP and the files are index.php but its the magic of mod_rewrite which fools you.
-
Call To Undefinded Function mysql_connect
wildteen88 replied to wildteen88's topic in PHP Installation and Configuration
You cannot do this: [code]extension = "C:\PHP\ext\php_mysqli.dll"[/code] You need to setup the extension_dir to point to where your PHP extensions are loacted Then you scroll down and enable the php_mysql.dll extension. You enable this extension for the mysql_* functions. If you are using the mysqli_* functions then you enable the php_mysqli.dll function. -
I would not recommend using positioning when doing a CSS Layout as you'll are bound come into lots of problems. Using floats and clear is much easier when doing a CSS layout. About the Latin text most developers tend to put some random text into a layout to get a better visual understanding of what the layout will look like when its finsihed, especially if the layout going to have dynamic text if the sites is being coded in PHP etc.
-
You cannot send URL parameters through an include or rquire statement. Instead What I'd do is what redarrow suggested by pass the database through the function like so: database.php: [code=php:0]<?php function dbConnect($db) { // we'll define $connection as global so we can use this outside of the dbConnect function global $connection; $dbhost = 'yourhost'; $dbusername = 'username'; $dbpasswd = 'password'; $connection = mysql_pconnect($dbhost, $dbusername, $dbpasswd) or die ("Couldn't connect to server."); mysql_select_db($db, $connection) or die("Couldn't select database."); } ?>[/code] Now we use the following to connect to the database: [code=php:0]include 'database.php'; // now we call our dbConnect function dbConnect('database_name_here');[/code] Change database_name_here to the name of the database you want to connect to.
-
[quote author=Jenk link=topic=104474.msg416770#msg416770 date=1155731251] [code]<?php $query = "INSERT INTO `table` VALUES ('" . mysql_real_escape_string($_POST['textarea']) . "')"; echo '<textarea>' . nl2br(htmlentities($_POST['textarea'])) . '</textarea>'; ?>[/code] btw, nl2br() is the equivalent of [code]<?php function nl2br ($string) { return str_replace("\n", "<br />\n", $string); } ?>[/code] [/quote] It doesnt just replace the \n character but '\r\n' (Windows), '\r' (Mac) and '\n' (Linux)
-
Strange entry shown using phpinfo()
wildteen88 replied to slongmire's topic in PHP Installation and Configuration
This is normal. These are default values built into PHP itself if no value is set for include_path within the php.ini. I get the same result with PHP5 as an Apache Module. You can define a defualt include path by finding this within the php.ini: [code]; Windows: "\path1;\path2" ;include_path = ".;c:\php\includes"[/code] Now remove the semi-colon infront of include_path. Now change [b]c:\php\includes[/b] to the direcotry in which you want PHP to search in first when including/requireing files More information can be found over at php.net on this setting -
If you tell us the forum software you have downloaded we'll be able to help you. Also it'll be a good idea to check the forums documentation. For now I'm moving this the Third Party scripts forum.
-
What browser are you using? If its Firefox goto Tools > Options > Privacy > Cookie Tab > View Cookies. Now in the search box type in localhost or the name the of the cookie, and it'll try to find the cookie. For IE(7) you need to goto Tools > Internet Options > Browsing History Settings button > View Files. Now click the Types column so the grey arrow is pointing upwards in the Temporary Internet Files window. Now scroll down until you find a bunch of Text Files. These should be your cookies. For Opera goto Tools > Preferences... > Advanced Tab > Cookies > Manage cookies. Again use the search bar to sift through the cookies, by typing localhost or the name of the cookie. For any other browser you might want to consult their documentation.
-
You cannot put PHP code in a html file. As your server will need to be configured to parse html files with the PHP Intepreter. This is not recommended though.
-
Noobie Stuff: Very Basics Explained Easily
wildteen88 replied to Pudgemeister's topic in PHP Coding Help
[quote author=businessman332211 link=topic=102480.msg415949#msg415949 date=1155618854] By what I have heard(and tested) it's simply a less reliable form of mysql_fetch_array assoc is meant more for object oriented programming, and really nothing else. ANd mysql_fetch_array will do just as good at oop, as assoc. [/quote] WFT! I suggest you go and read the manual. mysql_fetch_assoc is the same as mysql_fetch_array. Excepty it returns an associative array, rather than two lots of the same results which is an array with associative and number indices. How is it less reliable than mysql_fetch_array? Also mysql_fetch_array or mysql_fetch_assosc has nothing to do with OOP. -
We will not write scripts for your here. if you want to someone to create it for your post in the freelancing forum. However you may aswell go over to hotscripts.com and you're bound to find one over there. Or just search google for 'PHP Shoultbox tutorials'. To learn to create one (which is recommended).
-
PHP doesnt support Apache2.2.x yet. It should support it in the next release of PHP4/5 To get PHP4 to work with Apache. Either downgrade Apache to 2.0.x, or either go to php.net and download the lates CVS version of PHP4. Or go to Apache Lounge to download the Apache2.2.x php dll file, which I think is php4apache2_2.dll for PHP4.
-
Do you mean a unix timestamp? A unix timestamp returns the number of secounds since Jan 1st 1970. if you want to convert a date into a unix timestamp use strtotime function: [code=php:0]$date = "25-12-2006"; // conver the date above into unix timestamp // which is 1167004800 $timestamp = strtotime($date); // convert it back into a date echo date("d - m - y", $timestamp);[/code] or use the time() function to get the unix timestamp of now. I use INT as the data type for storing timestamps.
-
Use $_SERVER['REMOTE_ADDR'] however keep in mind this variable may not return the users true IP address as it may return the users proxy address if they are behind a proxy. Also most ISPs give customers dynamic IP addresses, which mean their IP address could change automatically when they connect to the internet, connect to a website, change every minutes/hours etc. So using $_SERVER['REMOTE_ADDR'] shouldn't be relied on.
-
Have you installed PHP locally on your computer? If you have installed PHP5 and you're on Windows you'll need to enable the php_mysql.dll function. If you have PHP4 then it should work. Also if you are not on Windows you'll need to recompile PHP with the --with-mysql command option. Could you post more information about your PHP setup.
-
Run this: [code=php:0]<?php phpinfo(); ?>[/code] Look in the [b]Configure Command[/b] row. Look in the coloumn next to it to see whether you can see [i]--enable-exif[/i] if not then you'll have to see if your host will recompile PHP with the [i]--enable-exif[/i] command option. As thats the only way to enable the exif extension on a unix based server. Also before you ask your host make sure your site is not hosted of a Windows box, by running the code above look for the [b]System[/b] row. To the right of that it should state what OS the server is running on. If its Windows then you should be able to enable it through the php.ini.
-
Call To Undefinded Function mysql_connect
wildteen88 replied to wildteen88's topic in PHP Installation and Configuration
Does it connect fine to the database? Ie: [code=php:0]$conn = mysql_connect('localhost', 'user', 'pass') or die('Unable to connect to the MySQL server<br /><br />' . mysql_error()); mysql_select_db('db_name') or die('Unable to connect to the database<br /><br />' . mysql_error()); echo "Connected to MySQL and the database fine";[/code] If it does then it most probably an error withing your SQL Query. Add this - [code=php:0]or die(mysql_error());[/code] to end of the the mysql_query function when you perform your query. Also you might want to post a help topic in the PHP Help forum. If you query is failing. -
It is easier to do this with PHP. Doses your host have PHP installed?
-
I'm not an expert either in this field but what I think it is doing is this [b]/[/b] - this is the stating delimiter every reqular expression requires a starting/ending delimiter [b]\'{1,}[/b] - this says find 1 or more instance of [b]'[/b] [b]\"\.{2,}[/b] - this says find 2 or more instances of [b]".[/b] [b]/[/b] - this is the ending delimiter
-
I dont know if the admins has disabled this but you can change your Display Name to something else, but you cant change your username. The Display Name will replace RockingGroudon in your posts what ever you change it to. However you have to use RockingGroudon as the username to log in to the forum To chnage your display name goto Profile > Account Related Settings Now look for the Name: section. Change the name in the name texbox to what ever you want. Once you have changed the name. Scroll to the bottom fill in the security box, just enter your password in, now click Change Profile. You display name should now of changed and any post/thread that belongs to you should of been updated to your new display name.
-
You'll want to use this comparing x [code=php:0]if( $x == 'logout' ){ LogOut(); }[/code] Otherwise you are assigning $x to the constant logout all the time. Also make sure you have session_start() at the top of your script. And use session_destroy to destroy the session when they logout.
-
PHP problem.. getting REALLY mad!! [-SOLVED-]
wildteen88 replied to techiefreak05's topic in PHP Coding Help
How are you defining $logged_in as global. AFAIK you cannot define a variable as global out side of function. -
is t1, t2, t3 etc supposed to be .t1, ,t2, .t3 etc As there are no HTML tags that are <t1> <t2> <t3> etc. If you have given a tag a class name of t1 you use .t1 If you have given a tag an id name of t1 you use #t1 You cannot use t1 on its own as the browser will try to find a tag called t1, which doesnt exist.
-
PHP problem.. getting REALLY mad!! [-SOLVED-]
wildteen88 replied to techiefreak05's topic in PHP Coding Help
Is the variable $logged_in being created out side of the functions. If it is you want to add [code=php:0]global $logged_in;[/code] in each function that uses the $logged_in variable. As functions have there own variable scope and so PHP cannot access variables out side of the function unless you declare them as global.