wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
Yes that is true. You can use pho's readdir function to read all the files/folders in the images folder. Then using a while loop you can echo out the HTML to display the images on your webpage. Before you take on this project of yours make sure you know the basics of PHP. It will be better for you to learn the basics of PHP, such as variables, functions, loops, arrays, data types, superglobals ($_POST, $_GET etc) before you get started. Also make sure your hosting account has PHP enabled -check with your host.
-
PHP command line with no server
wildteen88 replied to hobeau's topic in PHP Installation and Configuration
Instead of adding the extension folder to the path add just the php folder (C:/PHP). Try again. Did that solve it. -
Have a read of this guide.
-
Can Apache run without an internet connection?
wildteen88 replied to richy's topic in Apache HTTP Server
No, Apache does not require an internet connection if you are developing PHP locally. When you want to access Apache you type in http://localhost/ You only need an internet connection if you plan on hosting a website from your computer. Not when you accessing it locally. -
Use the NULL keyword if entering an empty string. Or list just the columns you are inserting data into the table (recommended).Eg: INSERT INTO tbl_name (col1, col2, col3, etc) VALUES ('valueCol1, 'ValueCol2, 'ValueCol3 etc...)
-
How are you inserting it into your database table? Post the relevant parts of your code here. If you enter line1 line2 another line b l a h It should go into the database as you have typed it. However when you get the data back out of the database and display it in the browser you may find it displays as this: line1line2another lineblah This is nothing to do with PHP or MySQL but the browser itself. Web browsers ignore most whitespace characters (\n, \r, etc). In order for the browser to display your textareas you have entered it in the textarea you will need to use the html equivalent, eg <br /> for newlines.
-
Your php configuration probably doesn't have the short_open_tag directive enabled in the php.ini. INMO you should not code with short tags. Using the full tags allows your application to be more portable over different php setups.
-
How are you accessing the php file? Post the full url here. From that error message it doesn't appear to be a PHP configuration issue but an Apache configuration issue for your virtual host.
-
configuring php to run with mysql
wildteen88 replied to phpbeginner0120's topic in PHP Installation and Configuration
Ok before you continue can you move all files you have moved out of the PHP folder back into PHP folder. The number one rule is never move any files out of the PHP folder. Always keep them where they are. When you add PHP to PATH, PHP can see everything in I:/php so no need to move anything. Moving files around can complicate things even more, especially if you are going upgrade PHP. Also when you have setup the PATH make sure you have restarted Windows - that is a very important step. The next thing you should do is uncomment php.ini-recommended in I:/php and then create a test.php file with the following code: <?php phpinfo(); ?> Save it where you save all your other php files to. Run it and make sure it is using the php.ini in I:/php/ (look for the Configuration File (php.ini) Path or Loaded Configuration File line is pointing to I:/php/php.ini) If it is you can now configure PHP to enable the mysql extension(s). To do so open up the php.ini and setup the extension_dir directive to point to "I:/php/ext" and remove the semi-colon in front of extension=php_mysql.dll and extension=php_mysqli.dll lines. Save the php.ini and restart your http server (Apache, IIS etc). Re run test.php make sure it reports the changes you have just made by searching for extension_dir and making the sure the values is set to is I:/php/ext and that when you search for mysql or mysqli there is sperate heading/sub-section for each of them. If you can see the changes you have made in php.ini being reported by phpinfo() then PHP is now setup. When setting up PHP you should not do it all in one go. Always do it one step at a time and checking that every step you do works. I know I have said this before but never move any files out of the PHP folder especially if you have added the PHP folder to the PATH. If you do move a file make sure you cut and paste and not copy and paste. Having multiple copies of the same file can complicate things even more. NOTE: Make sure you have downloaded the zipped binaries package and not the installer. -
Open up the php.ini and search for this line: ; server, your database schema or other information. After that it should state this line: display_errors = Off And change Off to On. Save the php.ini and restart Apache (or whatever your http server is). NOTE: Before saving make sure error_reporting is set to E_ALL (look at 349) Errors should now be shown when they happen.
-
Exporting from Excel to MySQL ?
wildteen88 replied to halm1985's topic in PHP Installation and Configuration
You could save it as an .csv file (when you go to save File > Save As) Then you import the saved .csv file into phpMyAdmin by clicking the Import link/tab when you log into phpMyAdmin. -
Huh? Could you explain what you are trying to do. Not understanding your question.
-
Using this should work: echo $number1 . $number2 . $number3; Having to concat an empty string onto a number is waste of processing. Remove the "" and use just the concatenation operator. <?php $number1 = 5; $number2 = 21; $number3 = 88; $numbers = $number1 . $number2 . $number3; echo $numbers; ?> Output is 52188 Can't see how it doesn't work for you. How areyou echoing $numbers?
-
Try moving the header redirect after the for loop. If its in the for loop PHP will only run once through the loop. You will want to move the header redirect after the loop in order for the loop to run more the once. New code: <?php session_start(); include_once 'Database.php'; $db = new Database; if (isset($to_del)) { foreach ($to_del as $v) { //echo"$v"; $sql="DELETE FROM e_post WHERE id='$v'"; $db->insert($sql); } header("location: inbox.php"); } else { header("location: inbox.php?Err=1"); } ?> If it still doesn't work could you describe what sort of output you are getting? If its a blank page then add the following at the top of your script before session_start(): error_reporting(E_ALL); ini_set('display_errors', 'On'); Do you get any output now? Post any output you get here. Also could you tell me where the variable $to_del comes from too?
-
You dont need to use any fancy code to get each letter seperatly. You can just do this: $str = 'Peter'; echo $str{0} . '<br />'; echo $str{1} . '<br />'; echo $str{2} . '<br />'; echo $str{3} . '<br />'; echo $str{4}; The result will be: P e t e r
-
Apache won't start after installing php5
wildteen88 replied to horseatingweeds's topic in PHP Installation and Configuration
You should of just changed this line: LoadModule php5_module c:/php5/php5apache2.dll to this: LoadModule php5_module c:/php5/php5apache2_2.dll the php5apache2.dll module is not compatible with Apache2.2.x. You must use the newer Apache module for Apache2.2.x which is php5apache2_2.dll If you are using the newer version of PHP5 (version 5.2 or greater) PHP now comes with the newer Apache2.2.x module. -
If you want to ask questions about PHP, such what a certain functions does, or your code is not working etc then post in the PHP Help forum. If you are installing PHP and you problems/question about the installation process then post in the PHP Installation forum. It is easy to find which forum to post in by reading the forums descriptions underneath the forums title (the link you click on to access the forum).
-
I guess it wouldn't hurt if you asked the host to allow you to use .htaccess files. Or ask how you can set up your own custom 404 error pages.
-
Where to find a game server hosting company
wildteen88 replied to Guardian-Mage's topic in Miscellaneous
You will probably want to look into getting a dedicated server. A dedicated server is a server which only your site gets hosted on and you have full control over it. -
What you do you mean by "spins"? Do you mean the page continues to load and displays nothing?
-
Is that all the code? Also could you post the contents of config.inc.php too. Make sure you use the tags when you post your code.
-
Make sure your host allows you to use .htaccess files. You can test this by adding an invalid option into a .htaccess file like so: aaa Save that file in public_html now go to your website. If you get a 500 Internal Server Error then .htaccess files are enabled. if you don't then you can't use .htaccess as they are not enabled. You will have to edit the httpd.conf file to enabled .htaccess files.
-
You are getting there but you are still not accessing your variables correctly. For example these lines: session_start(); $_SESSION['BusinessName'] ='$BusinessName'; $_SESSION['BusinessName']; Should be just lthis: session_start(); You don't need to initialize your variable yet. You do that later on in your code. Which will be this section: if(isset($_SESSION['$BusinessName'])){ $query = "SELECT * FROM business_info WHERE `BusinessName`='".$_SESSION['$BusinessName']."'"; BUt here you are using the wrong of sort of syntax for using your session variable. You should use $_SESSION['BusinessName'] not $_SESSION['$BusinessName'] And then further on down this: <?php $_SESSION['BusinessName']; ?> <tr> <td valign="top" bgcolor="#f90102"> <?php echo "<h1><font color='ffffff'><marquee>$BusinessName </marquee></font></h1>"; ?> </td> </tr> Can be just this: <tr> <td valign="top" bgcolor="#f90102"> <?php echo "<h1><font color='ffffff'><marquee>{$_SESSION['BusinessName']}</marquee></font></h1>"; ?> </td> </tr>
-
Wish to have wireless peripherals, options?
wildteen88 replied to roopurt18's topic in Miscellaneous
For the printer you can use a Print Server it is a bit like an AccessPoint accept you connect your Printer to it via USB rather than ethernet. Then you can print to it wirelessly over your network. if you go for an all-in-one printer that has Fax, Scan and Copy functionality then you get this and you can do it all wirelessly with out having the need to setup a 'host PC' to connect your individual peripherals to your network.