Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. I used $rp because if I used $r for retriving the results from the secound query, it would of overwirte the first set of results, which will result in your script not working correctly.
  2. Just post the code over at pastebin.com and provide a link to the posted code. That way we can see your code. Or a better option would be to attach the file to your post (Reply button > Additional Options... link > clik browse button to attach a file to the post.) You can probide a demo account yes, as that way we can see whats going on
  3. You need to add this: [code]$result2 = mysql_query("select * FROM product where id=$id"); while($r=mysql_fetch_array($result2)) {     $prodId=$r["id"];     $manuf=$r["manuf"];     $name=$r["name"];     $description=$r["description"];     $size=$r["size"];     $type=$r["type"];     $fibre=$r["fibre"];     $dimensions=$r["dimensions"];     $image=$r["image"]; echo $prodId;  echo "<br />"; echo $manuf; echo "<br />"; echo $name; echo "<br />"; echo $description; echo "<br />"; echo $size; echo "<br />"; echo $type; echo "<br />"; echo $fibre; echo "<br />"; echo $dimensions; }[/code] Into your first while loop, otherwise it'll just retrun the last result from the first query. This should do: [code]<?php require 'incs/php.php'; $conx = @mysql_connect($dbServer, $dbUser, $dbPass); @mysql_select_db($dbName) or die("No Database Access<br />Please try again"); $result = mysql_query("select * FROM wishlist where login='test'"); while($r = mysql_fetch_array($result)) {     $id = $r["id"];     $login = $r["login"];     $result2 = mysql_query("select * FROM product where id=$id");     $rp = mysql_fetch_array($result2))     $prodId      = $rp["id"];     $manuf      = $rp["manuf"];     $name        = $rp["name"];     $description = $rp["description"];     $size        = $rp["size"];     $type        = $rp["type"];     $fibre      = $rp["fibre"];     $dimensions  = $rp["dimensions"];     $image      = $rp["image"];     echo $prodId . "<br />\n";     echo $manuf . "<br />\n";     echo $name . "<br />\n";     echo $description . "<br />\n";     echo $size . "<br />\n";     echo $type . "<br />\n";     echo $fibre . "<br />\n";     echo $dimensions;     echo "<br /><br />"; } ?>[/code]
  4. Paste your code over at pastebin.com, your code most probably has something in it which is tripping the IPS we have installed here.
  5. This is a server config issue. Your server doesnt have the Indexes option in the Options direcive when you define the severs document root. Without this setting it can cause this. As it blocks access to see directory indexes. if you have access to your servers httpd.conf file, open it up for editing and find the following: [code]# The Options directive is both complicated and important.  Please see # http://httpd.apache.org/docs-2.0/mod/core.html#options # for more information. #     Options[/code] After Options there'll probably be something like this after it: [code] FollowSymLinks Includes[/code] Add Indexes to end of the list, making sure you put a space between the last option in the list. So its like this: [code]Options FollowSymLinks Includes Indexes[/code] Save the httpd.conf and restart Apache. You should now be able to see the directory indexes. Read the manual for information on the [url=http://httpd.apache.org/docs-2.0/mod/core.html#options]Options directive[/url]
  6. Use double quotes: [code]echo "<a href=\"" . $delete . "\" onClick=\"return confirm('are u sure?');\">Delete</a>";[/code]
  7. If you want use a sesion make sure you have session_start() as the first line of any php page that uses a session. To create/access the sessioin use $_SESSION['session_variable_name_here'] So to create a session that holds your name, use: $_SESSION['name'] = 'jwk811'] That creates a session variable called name. Which holds jwk811 as its value. Now to use that in any page. Make sure you have session_start() at the top of the page now add: echo $_SESSION['name'] where you want your name to appear. The same applies with cookies however to create a cookie you must use the [url=http://php.net/setcookie]setcookie[/url] function. Then to access your cookie you use $_COOKIE['cookie_name_here']. NOTE: YOu can not set and use cookies at the same time like you can do with sessions. Also when ever you use the sesison_start or setcookie function make sure you are not putting anything to the browser, otherwise you'll either get a blank screen or a nasty header cannot be sent error message.
  8. How do you verify someone is logged in? Rename the html file so it has a php extension (filename.html to filename.php). Then at the top of that page add in the PHP code that you use to verify someone is logged in.
  9. XAMPP has three php.ini's. The correct ini you should edit is loacted in C:\[your xampp install path]\xampp\apache\bin\ When you made the changes save php.ini and restart the Apache server. Also have a read of this FAQ from Xampps site: [quote=http://www.apachefriends.org/en/faq-xampp-windows.html#phpini]I do not get any connection to my MS SQL server! If the mssql extension was loaded in the php.ini, sometimes it comes to access problems when only TCP/IP is used. You can fix that problem with a newer "ntwdblib.dll" from Microsoft. Please replace the older file in the \xampp\apache\bin directory with your newer file from Microsoft. Apache restart. Thank you Horst for this topic note![/quote]
  10. Post the actually Rewrite rule here so we can see if you do have the correct syntax. Also make sure you have enabled the mod_rewrite module in Apaches configuration file (httpd.conf). To enable the mod_rewrite module for Apache. Open the httpd.conf file for editing. Now look for the following: [code]#LoadModule rewrite_module modules/mod_rewrite.so[/code] Remove the hash (#) from the start of that line. Save httpd.conf and restart Apache. Also if you are getting 403 forbidden it does appear something isn't right with your mod_rewrite rules/server configuration.
  11. No need to do anything if you have php installed on windows as it is part of the core library of PHPs built in functions. Read [url=http://uk2.php.net/manual/en/ref.ftp.php]this page[/url] for more info on the FTP library in PHP.
  12. Use this: [code]$query="UPDATE users (`username`, `password`, `etc, etc`) where `username`='$username'";[/code] As the SQL query. password is a SQL keyword so MySQL is getting confused and so result in the above error. You should add backticks around the column names in your query, like I have done. This is prevent SQL from getting confused and is good practice to add backticks around column/table names in your SQL queries
  13. Looks like you pass the $sThanksmail  variable through htmlentities/htmlspecialchars function. Or your own function which converts any html chars into their html entity equivalent.
  14. Oh i see. Didnt realise that. Thanx for the heqads up.
  15. Note I have update the code slightly as it wasnt closing the table rows correctly. Recopy the code posted above to replace the old code.
  16. As I didnt test the code when I made it. It wasnt functioning correctly. try this new code: [code=php:0]$c = 0; while($pfsq = mysql_fetch_assoc($showpfsinst)) {     echo (($c % 4) == 0) ? "  <tr>\n" : '';     echo '    <td align="middle"><font face="Verdana" size="1" color="' . $textcolor_inst  . '">' . $pfsq['FName'] . ' ' . $pfsq['LName'] . "</font></td>\n";     // If $c equal to 3 we reset the     // counter and echo the closing table row tag     if($c == 3) {         echo "  </tr>\n";         // reset counter to zero         $c = 0;         $tr = true;     } else {         // increment counter by 1         $c++;         $tr = false;     } } // check that the the current table row hasn't been closed yet. If it hasn't we'll close it echo ($c != 3 && $tr == false) ? "  </tr>\n" : '';[/code]
  17. If you want a free PHP IDE to develope your PHP scripts with get phpdesigner 2006 (only for windows)
  18. Use [code=php:0]$calc = "\$rate = str_replace(array(\"L\",\"E\",\"F\",\"I\"), array(\$l, \$e, \$f, \$I), \$field1);";[/code] If you are using eval. However i see no use for eval here. Just use: [code=php:0]$rate = str_replace(array("L","E","F","I"), array($l, $e, $f, $I), $field1);[/code]
  19. I forgot to add $c++; to the end of the while loop so it wasnt counting! [code=php:0]$c = 0; while($pfsq = mysql_fetch_assoc($showpfsinst)) {     // I missout the the opening ( on this line:     echo (($c % 4) == 0) ? "<tr>\n" : '';     echo ' <td align="middle"><font face="Verdana" size="1" color="' . $textcolor_inst . '>' . $pfsq['FName'] . ' ' . $pfsq['LName'] . "</font></a></td>\n";     echo ($c % 4) == 0) ? "</tr>\n" : '';     $c++; }[/code] Hows that now?
  20. Not sure but prehaps: [code]$contents = $_POST; // ************* Here come the url from a dialog box one page before... $contents = file_get_contents($contents['url']); $contents = str_replace(array("\r\n", "\r", "\n"), "\n", $contents); $contents = explode("\n", $contents); foreach($contents as $url) {     // ******************************** Now a lot of stuff (WHOOPHIE) is done to that file...     // BEZEICHNUNG     preg_match("=<h1[^>]*>(.*)</h1>=siU", $url, $hit);     $data['obj_bez'] = trim($hit[1]);     // KURZTEXT     preg_match("=<h2[^>]*>(.*)</h2>=siU", $url, $hit);     $data['obj_krz'] = trim($hit[1]);     // ******************************* and store array (WHOOPHIE) in a database...     $insert_data = array( 'obj_bez'=> $data['obj_bez'],                           'obj_krz'=> $data['obj_krz']                         );     DB_Sql::query(DB_Sql::insert('objekte', $insert_data));     $insert_id = mysql_insert_id();     if(DB_Sql::error())     {         echo DB_Sql::error();         exit;     } }[/code]
  21. Never head of WHOOPHIE before. What is it? Also provide more information too about what you are trying along with a visual referencce too. PLus could you provide an example what is in urls.txt
  22. Use [url=http://php.net/manual/en/function.mail.php]mail[/url] to send an email using PHP. Note your server will have to have an SMTP installed, or PHP to to be setup to use an SMTP sever. If are renting webspace from hgost, they'll have this setup for you.
  23. The probelm is you have the mysql improved extension enabled. However you are using the normal mysql functions in the script. (mysql_connect, mysql_error etc). the mysql iimproved extension (php_mysqli.dll) doesnt work with the normal mysql functions (mysql_*). You'll need to enable the nomal mysql extension (php_mysql.dll) in order for your script to work. Both extensions have their own set of mysql functions. For exmaple the mysql improved extension has these functions: mysqli_connect mysqli_query mysqli_fetch_array Notice the i after mysql. The mysqli extension will only work with the functions prefixed withg mysqli. It wont work with functions prefixed with mysql. In order to use the functions prefixed with mysql you'll need to use the normal mysql extensin (php_mysql.dll)
  24. If you have a submit button thats an image, I belive you'll need to use $_POST['Submit_x'] or $_POST['Submit_y'] as the browser sends the the x and y co-ordinates where the user click the submit button.
  25. Do not double post. Your last post was moved. Topic closed
×
×
  • 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.