Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. It's a warning, so it's not affecting the execution.  Do you still get that warning if there are items in the shopping cart?  Most likely the $Cart variable is empty, so there is nothing for it to loop through, which causes a warning from foreach.
  2. Notices don't affect the operation of your code...it is PHP's way of telling you that there is a minor mistake in your code...For example, the first Notice you have listed states that on this line: [code]$numRows = $row[0];[/code] There is no $row[0]...index "0" is undefined. You can have them stop displaying by setting your error reporting level lower, or turning off errors
  3. Use urlencode on your $value variables: [code]foreach($_POST as $key => $value) { $s.= "&"; $s.= $key; $s.= "=";   $s.= urlencode($value); }[/code]
  4. I would imagine that MSN messenger has an API similar to Web AIM (http://developer.aim.com/webaim) that they use.
  5. Hmm, I don't think there is anything in php.ini that would force a variable to be passed by reference. The only thing I can offer is the part of the manual about reference variables: http://us2.php.net/manual/en/language.references.php
  6. [code]if ($ef == "" && $es == "") {[/code]
  7. I won't disagree with you that it runs slower on windows than linux, however, that does not imply a fundamental flaw in the way that php is executed within windows, but rather a difference in the execution of any program between windows and *nix. My disagreement with your quote, and the reason I brought up the age of it, was because of this specific part: [quote]running PHP within a Windows Web Server results in frequent crashes[/quote] That, in my experience, is simply not true.
  8. That article is 2.5 years old... [quote]Ramat Gan, Israel, March 30, 2004 ¾ Zend Technologies Ltd., the PHP ...[/quote] I think that with the progress that they have made with PHP in the last 2.5 years the developers may be upset for quoting that article. I've run PHP on a windows (2000 and 2003) server for over 2 years now and have never had a problem...at least not with it "crashing"
  9. An example... [code]<?php if ($_POST) { foreach ($_POST['names'] as $name) { $query = "INSERT INTO tablec (name, family_name) VALUES ('" . mysql_real_escape_string($name) . "', '" . mysql_real_escape_string($_POST['family_name']) . "')"; mysql_query($query) or die(mysql_error()); //you may want to execute a query that will remove that name from tableA to prevent it from showing in the future } } $query = "SELECT * FROM tableA"; $query = "SELECT * FROM tableB"; $names = mysql_query($query); $families = mysql_query($query); while ($row = mysql_fetch_array($names, MYSQL_ASSOC)) { $n .= ' <input type="checkbox" name="names[]" value="' . $row['name'] . '"> ' . $row['name'] . '<br />'; } while ($row = mysql_fetch_array($families, MYSQL_ASSOC)) { $f .= ' <input type="radio" name="family" value="' . $row['family_name'] . '"> ' . $row['family_name']. '<br />'; } echo ' <form method="post"> <table> <tr> <th>Names</th> <th>Families</th> </tr> <tr> <td colspan="2" style="text-align: center;">Choose the names to associate with a family:</td> </tr> <tr> <td>' . $n . '</td> <td>' . $f . '</td> </tr> <tr> <td colspan="2" style="text-align: center;"><input type="submit" name="submit" value="Submit"></td> </tr> </table> </form>';[/code] Obviously you would have to have database connection code and you would have to modify the field names and table names, but you get the idea.
  10. when the script stops running, the variables, including database connections, go away
  11. Remember that PHP does not use pooled connections like Java. If you are wanting to use a persistant connection, you may want to look into the mysql_pconnect function. http://www.php.net/mysql_pconnect
  12. if you set your session var equal to $query, then do further operations on the $query variable, they will not automatically be applied to the session var...meaning, the session var is a copy of the $query var at the time of the " = " operation. You can create a reference to the $query var using the "&=" operator. [code]$_SESSION['query'] &= $query;[/code]
  13. Variables are not persistant, so each time the user is sent to a new page they are "reset", unless you save them in some manner
  14. did you try google? http://www.google.com/search?hl=en&lr=&safe=off&q=phpmyadmin&btnG=Search
  15. [quote author=hitman6003 link=topic=118536.msg484444#msg484444 date=1166058328] [code]ini_set("display_errors", 1); ini_set("error_reporting", "E_ALL");[/code] [/quote]
  16. Did you look at the tutorials section? http://www.phpfreaks.com/tutorial_cat/7/Membership-Systems.php
  17. make sure error reporting is turned on and that error reporting is set to E_ALL. [code]ini_set("display_errors", 1); ini_set("error_reporting", "E_ALL");[/code]
  18. what code are you using that has a foreach loop?
  19. [code]$file = file($filename); foreach ($file as $line) {   $line = explode(",", $line);   echo $line[0] . "<br />"; }[/code]
  20. What are you trying to accomplish with the xml? You can use simplexml_load_string rather than load_file.... [code]$parsed_doc = simplexml_load_string(file_get_contents($myurl));[/code]
  21. Why is your mysql_connect inside of single quotes? [code]$connect = 'mysql_connect($db_host,$db_username,$db_password)';[/code]
  22. Crayon did..... [quote author=Crayon Violent link=topic=118511.msg484311#msg484311 date=1166043224] [code] $email = mysql_real_escape_string($_POST['email']); $result = mysql_query("SELECT email,username,password FROM userinf WHERE email='$email' ", [/code] [/quote]
  23. This might be possible with COM... http://www.php.net/COM However, the easiest, and fastest way, would be to use something like Dreamweaver, where you can just copy and paste and it does all the work for you. Or save the word document as a .html file, then use a utility, such as DW, to clean up all the extra "MS Word" tags that it puts in there to get it back to a semi normal html document.
  24. change: [code]$result = mysql_query($query);[/code] to [code]$result = mysql_query($query) or die(mysql_error());[/code] Let us know what the new error is...
  25. try this: [code]if( $listAction && $listAction == "csv" ) { header("Content-type: text/plain"); $query = "SELECT * FROM members WHERE mbrID IN('" . implode("', '", $_POST['all']) . "')"; $results = mysql_query($query) or die(mysql_error()); echo "Id, First Name, Last Name, Organization, Email Address, Package, Pay By, Date Modified, Status\n"; while ($data = mysql_fetch_array($results, MYSQL_ASSOC)) { if ($data["status"] == '0') { $status = "Pending"; } else if ($data["status"] == '1') { $status = "Activated"; } else if ($data["status"] == '2') { $status = "Deactivated"; } echo $data['mbrID'] . "," . $data['fName'] . "," . $data['lName'] . "," . $data['org'] . "," . $data['email'] . "," . $data['mbr_pkg'] . "," . $data['payType'] . "," . $data['active_date'] . "," . $status . "\n"; } exit; }[/code]
×
×
  • 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.