Jump to content

Muddy_Funster

Members
  • Posts

    3,372
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Muddy_Funster

  1. yeah, gonna need to see the code up to and including that line number.
  2. I don't think you can post attached files untill you get a minnimum post count. Anyway, your problem is here : $name= $_POST['name']; $thn= $_POST['thn']; $query="SELECT * from msnama where angkatan like '%$name%' and tahun like '%$thn%' "; when you return to the page there are no post variables set, so the query is not being filtered. Here's a quick fix : if(isset($_POST['name'])){ $_SESSION['name'] = $_POST['name']; } $name= $_SESSION['name']; if(isset($_POST['thn'])){ $_SESSION['thn'] = $_POST['thn']; } $thn= $_SESSION['thn']; $query="SELECT * from msnama where angkatan like '%$name%' and tahun like '%$thn%' "; Some other things you need to look at : NOT using SELECT * Data Input Sanitization
  3. Fair enough, they have already been created. Just because something was broken years ago does not meen that it can not now be fixed today. My strong suggestion would be that you press the point to have those databases merged where possible as soon as you can. If you can't get permission, fair enough, as DavidAM said - we've all been there, but at least if you push for it and they refuse then you yourself are coverd when it does go horribly wrong further down the line (as long as you do it in writing).
  4. There are two choices as I see it, Query the database again and get the results in the order you want them learn about php arrays and the use of usort() Option 2 fits what you are asking, but we will need to see some code from you to see where you have got to so far before we can really help more.
  5. fputcsv() writes out to the csv name given, it does not append data to it. The only way that pops into my head would be to load in the original csv, and then append the $list onto the old contents before writing it all back to the original csv. This does however seem to me to be a somewhat bloated way of doing things, but I'm not well versed in the manipulation of files with php, so there will probably be a better suggestion.
  6. As Jessica said, you should have a unique identifier set in the table for every cart item. Without more info about the table structure, there isn't anything more we can offer in the way of help.
  7. Yeah, I would say that fopen was made exactly for this reason. Load the css file into a variable and then preload the variable into the form (I'd suggest a large textarea for this rather than try to break out each element into it's own input). Then when the form is submitted you could even compare the form input with the fopen variable and save changes if there are any, discard if there are none. What you may want to look at as well is glob() for finding and listing the file names in a directory, but that's overkill if you know that the file name will never change or be deleted.
  8. this isn't a php issue, it's a dns one.
  9. I see, so you want to return the username and password information onto a web page from the array and then have a form on that web page that will allow you to alter said information in said array. After which this the web page will also need the ability to write back the changes to the file for them to be made perminant. Is that about right?
  10. $userArray['user1'] = 'new password'; ...... $userArray['user4'] = 'pass4'; ...... unset($userArray['user3']); ...... I think that covers it
  11. add, eddit, delete what exactly? values, keys or both?
  12. so other than the unterminated string in the assignment of LM to $allocby, the use of short open tags, one of the craziest headers I ever did see, and an $email veriable that you never use, what exactly is it that you are having a problem with? and what exactly is that problem?
  13. The first part meens that when you call, for example, runMe(name) then you are saying that name is a declared constant. This is totaly different to runMe("name") as name is a string literal in this case. the forst example php tries to evaluate the constant to a value that should be contained within it at the time of decleration, in the second the string it's self is just passed into the function.
  14. It's all good, I was just explaining what was happening was all.
  15. right, so you are actualy passing in a constant into the function rather than a variable or string literal?. And if your going to ignore the fact that you are doing something wrong, just because it works for you, what's the point? No, he is building php tags into a string to echo out at runtime
  16. I could, but then I would expect payment for that. I'll help you out if you want me to, but I don't do work for free. First thing you need to establish is the form field names on the remote server that is asking for the login. you can do this by veiwing the page source of said site.
  17. How else do you expect index.php to know if you are logged in or not if it doesn't check? That bit of code is saying that if there was 1 or more records returned by your query, then do something (in your case : include the code that is in index.php on this page). Look into using sessions
  18. yeah, please use code tags. Have you perhaps tried following any links that do not contain spaces in them...?
  19. it's not returning elementCreate("right") it is returning elementCreate(right) you need to apply the quotes within the string you build, or create the varaible as a quoted variable. also $1 isn't a valid variable name. variables need to start with either a letter or underscore, see here
  20. Lazyness is the most common excuse for increasing server load and reducing scalability with poorly structured SQL. I'm not saying it can't be done, I'm just saying you shouldnt expect to be encouraged to do it.
  21. Use a curl() call -> See here
  22. No one serious about sql would suggest or endorse the use of SELECT * in anything other than debugging.
  23. OK, people invented code tags for a reason (and no, it want's so you could not use them).... your check for the form simply looks to see if the $_POST superglobal has been registered in memory. Superglobals, once populated once, exist (even without data) for the rest of the script (may even always be there, but I don't recall ever trying to check that). Expand your check to see if the form submit button was sent through the $_POST array to check if the form it's self was passed if(!isset($_POST['submit'])){ //your code here As a rule of thumb, I would say try to be as explicit and verbose as you can when coding. Never assume that the language will be ok at sorting out any ambiguity in your code.
  24. tried your link, looks like it needs a student login perhaps?
×
×
  • 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.