Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. Try something like: <?php //connect to db $sql = "SELECT ID,Employee_Name FROM yourtable ORDER BY ID ASC"; $result = mysql_query($sql) or die(mysql_error()); echo '<select>'; while(list($id,$name) = mysql_fetch_row($result)){ echo '<option value="'.$id.'" />'.$name.'</option>'."\n"; } echo '</select>'; ?>
  2. When you include functions.php you are effectively taking everything in functions.php and putting it into the file that included it. From a results point of view, it would be no different to copying and pasting functions.php into the other file. Of course, using an include is much easier. So, calling a function from functions.php is just like calling any other function. This obviously works both ways too. If you defined a variable or function in the page doing the including, then it would be avaliable to the included code.
  3. Any chance of defining 'can't handle the image'?
  4. You might want to check which PHP ini is actually being used. If you run this: <?php phpinfo(); ?> And check that you are editing the same one as is given under 'Loaded Configuration File'. Also, make sure you restart apache after making the changes. You might also want to check that PHP is being parsed. Make sure that if you view the source, you don't just get the PHP code.
  5. Whoops, missed that bit You still didn't answer my qestion though. At present, what happens when you try and run this? Do you recieve your message in your die() statement? Another error message?
  6. Well, apart from anything else, $ThanksURL is undefined. You could also try telling us what it does do rather than leaving us to guess.
  7. So what's the problem? You've shown how to redirect: header("Location: success.php"); As long as this doesn't come after any output to the browser, there's no problem.
  8. Yeah, just define, say, $title before you include the header file. Then echo out that, or ,if it's not been set, a default title. So, something like this: Any page: <?php $title = 'Custom title for this page'; include('header.php'); ?> header.php <?php if(!isset($title)){ $title = 'Default title'; } //echo out title and other header information ?> Remember, an include is like just taking the contents of your included page and running it as if that code were in the page already.
  9. Well i didn't completely follow your code, you seem to have $errormsg and $formerror? In any case, what you should do is define a variable at the beginning of the script which is then alterered throughout your checking process. At the end, check the value of that variable and then do whatever you need. You could do that with your error message variables -- just define them at the beginning as an empty string, then check at the end to see if they are still empty. Alternatively, a better approach would be to wrap up all the error checking in a function which can then return true or false.
  10. It's not actually concatenation; it's multiple parameters Am i being blind? Where do you select anything from your database?
  11. lmao. It's beautiful CV, brings a tear to the eye...
  12. Im afraid im not even going to bother to read your 'Quick question'. Your last one wasn't, so i've no reason to assume this one is. Please make the effort to give a more discriptive title to the problem if you'd like me to make the effort to answer it.
  13. Is that the exact code you are using? Both return a result resource for me.
  14. That is the definition of tabular data... Yeah, i guess it is. Its just think there's a slight distinction between a straight forward table of information and, say, presenting your database content in multiple columns since your using tables to achieve a particular presentation. That doesn't sound very clear at all, but i think i know what i mean
  15. Yeah, its possible -- you can detect file sizes and mime types.
  16. Don't be silly...that couldn't possibly work
  17. There was a thread about this a while back -- can't remember exactly where. But basically, the short story is: 'you shouldn't use tables' is a rubbish statement. There's very rarely such hard and fast rules. However, its considered bad pratice to use tables to align/position data. That is what CSS is for. It will allow you to modify things far easier, and gives you more control. Tables should hold tabular data. That said, there are certain times (such as creating columns of data from a database) when it is far easier to use a table.
  18. lol, so you're not asking for the answer you just want to know how to do it? On this line: foreach($_POST['pms'] as $num => $pm_id) It appears that you wanted to cycle through something, perhaps some checkboxes. However, unless im being completely blind, there's no input with the name pms on your form. On a site note, there's really no point in storing the number of pm's a user has in the database. Just count the rows whenever you need the number.
  19. I doubt there would be much, if anything, in it. I was referring to the upload speed of the user's connection. At the end of the day, the file has still got to be transferred to the server from the client and that's where the bottleneck lies.
  20. Well i could get all philosophical on you and suggest that there's no such thing as altruism (e.g. helping for no personal gain), seeing as i think everybody who does help gets some sense of achievement out out it --it's nice to know you've helped someone. There's also the fact that I learn a lot from helping others. The vast majority of stuff that i've learnt about PHP has been through this site, be it reading others' posts or finding out how to do something for myself. The questions asked expose you to things you might otherwise not have thought about/encounted, so I think you learn at lot. Also, I think it's true to say that until you can explain a concept to somewhere else, it's still debatable wether or not you truly understand it.
  21. No problem, glad its working. Yeah, but why use lots of queries when you can ust just the one? If you'll all done, can you mark the topic as solved?
  22. Wow, I just noticed that i signed up to phpfreaks 3 years ago today. Do I get a present? God that's scary. Where exactly have the last 3 years gone?
  23. First thing i notice is that you have you have your tables and fieldnames the wrong way round - it should be table.fieldname, not fieldname.table
  24. How about narrowing down the problem? I've no idea what the above code does and i've also no idea what your previous discription meant. How about providing sample arrays of $str1, $str2 and what iis in $diff. Im assuming that's where the problem lies?
×
×
  • 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.