Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. hmmm... - echo $rows[0][$fieldname] inside your function see if it has your expected value. - I suspect you probably wanted to put $key as the 1d element: $rows[$key][$fieldname] because otherwise I don't really see the point of that condition being inside the loop like that. - After all that, your code should be causing " selected=\"selected\" to be physically written on your screen at some point in time, because it's not being echoed inside option tags. Based on your provided script, here is my guess: function loadform2($values,$session_profset,$rows,$fieldname){ foreach ($values as $key => $value){ if(!empty($key)){ echo "<option "; if ($rows[$key][$fieldname] == 3) echo " selected=\"selected\""; echo ">$values[$key]</option>"; } } }
  2. chmod permissions on files/folder set to allow it? and a dumb question: you did remove the //'s from the function calls at the bottom and put your targets in the arguments, right?
  3. think you need to take out that last comma before WHERE edit: I also suggest you clean your variables before sending them to your database. That script is begging for sql injection.
  4. Probably a stupid question, but have you contacted the person/company you bought the script from?
  5. Here's how I would write it: echo "<TD><a href='view.asp?ID={$row[6]}' target=_parent>{$row[2]}</a></TD>"; You can use single quote inside double quotes, and you can put { } around vars so php don't get confused about what's part of the var and what's not.
  6. edit: Oh snap, I was trying to quote your post but whenever I hit quote it just kept putting that up. How weird is that?
  7. hmm...paypal does that? At best, that sounds not very convenient. There's no reason you shouldn't be able to have multiple accounts sharing the same card number. People do that all the time, especially in parent/child situations. At worst, telling someone they can't enter in a CC# because it's already associated with a paypal account seems like a security risk to me...
  8. QFT Get a business account. I've used my CC on several places like walmart.com, newegg.com, adamandeve.com, etc.. and I don't recall ever seeing any kind of "useful" info on my bank statement.
  9. well what exactly is the problem? do you get a blank page? one of those broken link image things? Are your img tags inside the while loop? Again, it's kind of hard to help without you being more specific and showing some code...
  10. If you're looking for "live" interaction back and forth, not just having php set the vars and that's all you need php for, then look into ajax.
  11. What kind of trouble are you having? You're going to have to be more specific. Can you post some relevant code?
  12. can't do that with php. You can have javascript call the client's built in printer print function if security on the browser doesn't have that disabled.
  13. google "php GET method"
  14. Are you wanting it to appear on demand? You need to do that with javascript, not php.
  15. so what happens if they turn off javascript?
  16. “Give a man a fish; you have fed him for today. Teach a man to fish; and you have fed him for a lifetime”
  17. Your method is another way of doing the same thing he's doing. PHP provides a slew of functions for handling the result source. Most of them provide a basic means of getting and displaying the information. They just have slight nuances for more efficiency, based on your circumstance and needs. His problem is that he used the wrong variable and on top of that he didn't echo it right.
  18. Yeah...no. That's not how it works around here. We're here to help, not write your code for you. Assuming your query didn't somehow fail: echo "Total Product Value: $result"; if you put a variable inside single quotes it interprets it literally like you wanted to physically echo out $price not the value of price. You can either put it inside the double quotes (like above) or use no quotes at all and use a . instead of a , between your string and the var. Also, you didn't assign anything to $price. The result is in $result.
  19. case "404": echo "<div id='nav'> <ul> <li><a id = 'currentpage' href='$this_page'>$this_page</a></li> <li><a id = 'currentpage' href='$this_page'>$this_page</a></li> </ul> </div> "; break;
  20. http://www.phpfreaks.com/forums/index.php/topic,37442.0.html
  21. $query = mysql_query("SELECT * FROM users WHERE user='$username' ORDER BY userdata"); while($output = mysql_fetch_assoc($query)) { if (!$prev) $prev = substr($output['userdata'],0,1); echo $output['userdata'] . "<br />"; $prev = substr($output['userdata'],0,1); } edited for: forgot to change it from my test loop vars to your vars
  22. also you shouldn't use * in your select. you're only using userdata so just select userdata.
  23. just curious, but why don't you just do this? $query = mysql_query("SELECT * FROM users WHERE user='$username' ORDER BY userdata"); while($output = mysql_fetch_assoc($query)) { echo $output['userdata']; } I mean, I'm assuming that user is unique, so I don't really see the point in ordering by user...
  24. .josh

    if

    In his code it doesn't really matter either way. Either ==0 will work or it won't. Either ==1 will work or it won't. Both will be evaluated just the same. He could even use a switch statement here. Or if the value will only be 0 or 1, he could just do an if...else. As far as the problem goes, obviously $row['status'] is either 0 or false. More likely it is false. You need to go up and check where you're assigning that value. It could be any number of things. I'm going to assume the you're getting it from a sql query, based on $row being a common variable people like to use for assigning query results. -perhaps your mysql_connect failed -- use the right connection info? -perhaps your mysql_select_db failed -- use the right db name? -perhaps your mysql_query failed -- did you echo your query string to see if you're sending what you expect to the db? -perhaps you used the wrong column name -- perhaps you did not properly fetch the results In short: I think I'd start out by adding ...or trigger_error("SQL", E_USER_ERROR); after all your db function calls.
  25. in your form, change name = 'email1', name = 'email2' etc... to name = 'email[]' for all of them and then foreach($_POST['email'] as $email) { // example echo "$email <br />"; }
×
×
  • 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.