Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. Well that is more or less tabular data for what you are doing, and tables are designed for tabular data. You can still do it in tables but with much less html: <table id="resultsrow" width="600" border="1" cellpadding="0" cellspacing="0"> <tr> <td rowspan="2" width="120" align="center">Image</td> <td align="center" width="120">type</td> <td align="center" width="190">address</td> <td align="center" width="140">price</td> </tr> <tr> <td colspan="3" width="450" align="center">description</td> </tr> </table> mines 1 whole table vs your three tables.
  2. If you are using nl2br when inserting data into a database then don't. It is best to use nl2br when you pull data out of the database.
  3. If you want someone to do something for you then please post in the freelancing forum. Otherwise please post more information about the script you are trying to install and we'll try to help you install the script.
  4. I think what fenyway means by "directly" is creating a database through mysql itself (via the command line) rather than using a third party app to manage mysql. However I think the invalid server index message is to do with phpmyadmins configuration file. To sort the error see if the following sorts it out: Go the libraries folder inside phpmyadmin and copy a file called config.default.php to the root of your phpmyadmin folder. Rename this file to config.inc.php (make sure you remove/rename the existing config.inc.php file). Edit the new config.inc.php to your mysql server settings. Try running phpmyadmin again.
  5. // create image vars for($i = 1; $i < 17; $i++) { ${'thumbs' . $i} = 'images/' . $i . '.gif'; $image_thumbs[${'thumbs' . $i}] = ${'thumbs' . $i}; $text_thumbs[${'thumbs' . $i}] = 'images/t' . $i . '.gif'; } // display generated images: echo '<pre>' . print_r($image_thumbs, true) . '</pre>'; echo '<pre>' . print_r($text_thumbs, true) . '</pre>';
  6. If you have multiple lists then you could use this: <?php $format = array( array(45, 20), array(40, 15, 3, 6), array(11, 12) ); function getLineData($linedata, $line) { global $format; $i = 0; foreach($format[$line] as $k => $offset) { $tmp[] = trim(substr($linedata, $i, $offset)); $i += $offset; } return implode("\n", $tmp); } $data = file('details.txt'); $tmp = null; for($i = 0; $i <= (count($data)-1); $i++) { for($k = 0; $k < 3; $k++) { $tmp .= "\n" . getLineData($data[$i++], $k); } $details[] = $tmp; $tmp = null; $i--; } foreach($details as $c_details) { list(,$firstnane, $lastname, $addr, $city, $state, $zip, $phone, $fax) = explode("\n", $c_details); echo "$firstnane $lastname<br /> $addr<br /> $city<br /> $state $zip<br /> $phone $fax <hr />\n"; } ?> details.txt format: First Name1 Last Name1 Street Address1 City ST Zip Phone #5 Fax Number1 First Name2 Last Name2 Street Address4 City ST Zip Phone #4 Fax Number2 First Name3 Last Name3 Street Address3 City ST Zip Phone #3 Fax Number3
  7. Its the PHP code thats the problem, you'll want to change your if statement: if ($_POST['subform']){ to something else. Prehaps: if ($_POST['this']){ $_POST['this'] will refer to your textarea, as you named it this
  8. Well it does work but not in the way you are expecting it to work. Because you are submitting the form when a user enters something into the textbox, and not when the user click the submit button. The submit button is not be sent in the http request ($_POST['subform']). Submit buttons will only be sent in the http request when they are clicked on.
  9. NO ternary operates are not designed to execute blocks of code. Instead they are designed to do simple bits of processing. Such return a value to a variable. Execute a function based on a condition. Ternary operates are inline conditions. I use ternary operators mainly on client defined variables, eg GET, POST and COOKIE/SESSION.
  10. Your sessions are working, but the problem seems to be PHP is not retrieving the session id set within your cookie. Try the following. Got the following link: https://212.241.216.160:8443/sitepreview/http/propertyeagle.co.uk/sessiontest.php Now go to where you browser stores your cookies, look for the cookie set by your site (212.241.216.160). Copy the PHPSESSID from the cookie. Now go back to sessiontest.php and append the following to the url: ?PHPSESSID=your_phpsessid_here eg: https://212.241.216.160:8443/sitepreview/http/propertyeagle.co.uk/sessiontest.php?PHPSESSID=5599baf6ce540a04ff18fa14745a61f9 Once redirected to sessiontest2.php append the PHPSESSID again, eg: https://212.241.216.160:8443/sitepreview/http/propertyeagle.co.uk/sessiontest2.php?PHPSESSID=5599baf6ce540a04ff18fa14745a61f9 Hello will now be displayed. This problem may due to the fact your using a secure http connection.
  11. If images are named 1.gif, 2.gif, 3.gif then you could do: $images = 6; // create image vars for($i = 1, $j = $images; $i < $j; $i++) { $image_thumbs['images/t' . $i . '.gif'] = 'images/' . $i . '.gif'; } // display generated images: echo '<pre>' . print_r($image_thumbs, true) . '</pre>';
  12. HTML or CSS Help board maybe? I'll move this thread to the HTML Help board.
  13. Use strstr, eg: if($row['PurchaseNo'] == substr($_POST['firstprize'], 0, 1)) { //PurchaseNo matches first number in $_POST['firstprize'] } else { //PurchaseNo doesn't match first number in $_POST['firstprize'] }
  14. Maybe this thread may help.
  15. Single and double quotes are not the same. PHP treats double quotes differently. In Double quotes you can use: escape characters (\n, \t, \r etc) variables PHP will treat variables/escape characters within single quotes as normal text.
  16. Try str_pos -perhaps.
  17. Looks like you version of phpmyadmin you have installed is corrupt as it is outputting the following characters: These characters is what is probably causing the error.
  18. The line number refers to your sql query and not your PHP code. Remember when using mysql_error() the generated error reported is coming from mysql and not php.
  19. They are conditions, they basically check if the requested filename is not an existing file/directory. If it is then the rewrite rules that follow will be ignored. if you didn't add those lines in then Apache will always rewrite every url to index.php?title=request/file/path/here You don't have to have those lines if you don't want them. But I have found they can be useful.
  20. You can only use {} around variables within a string not for calling functions/methods
  21. This is because php scripts are not the same as HTML. HTML is a client side language. Your browser will only understand client side languages. Client side languages are HTML, CSS and Javascript and few others. PHP on the other hand is not a client side language it is known as a server side language. This is why when you open your php file in a browser all you'll see is either a blank screen or your php code. In order to run your PHP scripts they will need to be in a server environment. This doesn't mean you'll need web hosting. You can run your PHP scripts off of your PC. In order to so you will need to install a couple of things. A http server the most popular being Apache and PHP itself. You will need to configure Apache with PHP. The best place to know how to configure Apache with PHP is php.net. As for how to use Apache go to httpd.apache.org Installing Apache and PHP can be quite hard for the first time, however installing them this way gives you a better understanding of how Apache and PHP work. If you do not want to try a manual install then you can go for a pre-packaged AMP setup. There are many available however I recommend WAMP If you go for WAMP please read WAMP documentation for where to place your scripts. If you go for a manual install of Apache and PHP then you need to place your scripts in Apaches DocumentRoot, default is something like C:/Program Files/Apache Foundation/Apache2/htdocs. In order to run your scripts you must open a web browser and then go to http://localhost/
  22. Try: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?title=$1 [L,QSA]
  23. Use the phpinfo() function. When you place this function in a script PHP will display a page full of PHPs operating environment/current configuration. Scroll down the page of information and look for a title called pdo_mysql If you cannot find that title then the mysql pdo extension is not enabled.
  24. Turn a setting called display_errors On within the php.ini if you are getting blank screens. PHP will now show errors which will help you know what's wrong. When you modify the php.ini make sure you restart Apache You're most probably get an error like "Call to undefined function: mysql_connect" when turn display_errors on. If you do please read this FAQ.
  25. When setting up eclipse with PHP I used this guide.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.