Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. The session id will chane when the session times out or is destoryed. A new session is regenerated when you destory the session or if the user current doesnt have a valid session.
  2. You cannot destroy the session immediatly as soon the user leaves your site. The only the way you do this is to lower the lifetime of the session, to something like 5mins however if the user leaves his computer for 5mins or more thier session will be destroyed, thefore when they return they'll most probably get a session timeout error message of some sort. Also sessions become invalid when the user closes their browser and goes to return to your site.
  3. If you want to use $proxy and $ip outside of the function you'll have to make them global eg: [code]function get_IP() {     global $proxy, $ip[/code]
  4. No. session_is_register checks whether the session name has been set within the session file. However the session itself does depend cookies, but if cookies are disabled PHP will attempt to place the SESSID in the url instead. Also session_is_register is becoming a depreciated function. Instead you can use something like the following: [code=php:0]if(isset($_SESSION['sess_name'])) {     //do something }[/code]
  5. Thats pretty simple: [code=php:0]// connect to db here $sql = 'SELECT * FROM market'; $result = mysql_query($sql); echo '<table border="0" cellpadding="0" cellspacing="0">'; echo '<tr><th>id</th>'; echo '<th>Seller id</th>'; echo '<th>Price</th>'; echo '<th>Qty</th>'; while ($row = mysql_fetch_row($result)) {     echo '<tr><td>' . $row['id'] . '</td>';     echo '<td><a href="seller.php?id=' . $row['sellerid'] . '">Seller id</a></td>';     echo '<td>' . $row['price'] . '</td>';     echo '<td>' . $row['qty'] . '</td></tr>'; } echo '</table>';[/code] Thats the basic code. Its untested but it should work.
  6. For of change this: [code]while ($row=mssql_fetch_row($results))             {               echo"<option value=\"results\">  ";               $fields = mssql_num_fields($results);               for( $i = 0; $i < $fields; ++$i){                   echo $row[$i];                          }               echo"</option>";             }             ?>[/code] to this instead: [code]$i = 0; while ($row = mssql_fetch_row($results)) {     echo '<option value="results">';     echo $row[$i];     echo '</option>';     $i++; }[/code]
  7. Umm, which I did menton: [quote]... you cannot validate your php file if its on your local computer.[/quote]
  8. Well what do you want it do when its the correct version?
  9. You shoud still be able to pass the php file through the validatar, but the php file mustbe  hosted on your site in order to validate it, you cannot validate your php file if its on your local computer.
  10. Yes that is correct also make sure you have a semi-colon before the closing ?> tag so its this: <?php echo $funnyurl; ?>
  11. Have a read of [url=http://www.phpfreaks.com/forums/index.php/topic,95443.0.html]this FAQ thread[/url] it should be able to help.
  12. How are you outputting $out? If you are sending it to the browser the browser will not show the tab, but show a space between word1 and word2, howver if you look into the source you'lll see the tab is there. browser ignores white spaces characters. If you are sending it a file then it should put a tab between word1 and word2 Or do you want it to to store \t in the file as is with out it creating a tab? If you dont want it to create a tab use this: \\t instead, two backslashes.
  13. Try a switch statment instead: [code=php:0]switch(@$_GET['page']) {     case 'action':         include "page.php";     break;     default:         if(!isset($_GET['page']))         {             echo 'No such page';         }         else         {             include "welcome.php";         }     break; }[/code]
  14. You'll want to use a function called [url=http://uk.php.net/manual/en/function.mysql-insert-id.php]mysql_insert_id[/url]
  15. By looks of things the script you are using needs to be installed, by running a script which setups the database and defualt configuration settings. As at the mement the script is trying ot login in as ODBC into your mysql server which is incorrect as the user ODBC doesnt exist. Does the script come with a read me file or some form of documentation. Have a read of the documentation for more info.
  16. Its becuase of this: [code]a:visited {text-decoration: none; color: #0000CC; cursor:crosshair}[/code] When when ever you click a link the browser records this, then when the browser is creating the link it checks whether you have clicked that link before, it you have it'll apply your hover class. It'll do that everytime you visit the link again until you clear you cache/history. The optoin is to leave as it is or change 0000CC to FFFFFF
  17. PHP will load the function, but it wont run the function untill it you tell it to. Also the two functions shouldn't cause any problems with the page load times.
  18. Stop bumping topics that are only a few hours old. Please wait for at least 4 - 12 hours before bumping a topic again. I have removed your  last two replies.
  19. I dont know! Kind of hard when theres no code to see. Post the code you current have here and I'll have look. Also where do you want the IP address to show up to?
  20. You'll probably want to use something like this: if(($counter % 3) == 0) EDIT: Doh! Me too slow.
  21. You'll need to append index.php to your DirectoryIndex line in the httpd.conf file. Heres how you do it: Find and open the httpd.conf file for editing, for a defualt install of Apache it be in C:\program files\Apache Group\Apache 2\conf Now scroll down and find the following: DirectoryIndex index.html index.html.var Now add a space after index.html.var and add index.php Save your httpd.conf file. Once saved restart Apache server. When you goto http://localhost it shoudl automatically load index.php
  22. Oh its PHPNuke. I will modify this topic title to prevent any further confusion. Also I will move this thread to the Third Party PHP Scripts help forum too.
  23. This is not possible to do. As the folder information is stored on your computer. This information is not sent when you add the folder to a zip file or send this folder to someone else, as their computer wont have the icon file or folder information in order to change the folder to the on you have. The only way to do this is for the person you send the folder to, will have to change the folder icon manually, however you will need to include the folder icon in the email too. Why do want do you want to do this?
  24. Your online server has a setting called register_globals turned on however you local server, has this setting turned off, which it should be. By all mean you can enable this setting by opening your php.ini and finding the following line: [code]register_globals = Off[/code] Change off to On save the php.ini and restart Apache. You shoud now be able to run your script however keep in mind any other scripts you may want to use on your local server may not function correctly due to register_globals being turned on. But what I recommend you to do instead is to open up notepad and type the following: [code]php_flag register_globals On[/code] Now got to File > Save As... in the file name field delete what is in there and type in [b].htaccess[/b] exactly Save this file in your [b]ghani_website_test folder[/b] (C:\program files\xampp\htdocs\ghani_website_test) Now goto http://localhost/ghani_website_test/shop You should no be able to run the php script.
  25. Change it to this: if (isset($_POST["Submit"]) && $_POST["Submit"] == "Send") Basically you had the closing ) in the wrong place Umm, Ken beat me :)
×
×
  • 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.