Jump to content

SergeiSS

Members
  • Posts

    239
  • Joined

  • Last visited

Everything posted by SergeiSS

  1. echo is wrong here. require_once('header_'.$_SESSION['session_idioma'].'.php');
  2. Here usort() is a function that you need. The only thing that you need - to create correct call-back function. It might compare second columns from 2 elements and return correct value.
  3. "and you can tell what is going to be right...?" I don't know what do you like to do. I can say how I do it. 1. I set action equal to empty string, it means that submit is routed back, to the script itself. 2. Check data. 2a. If it's incorrect, user asked to change and I show previous (entered) values. User stays in the same script. 2b. If all info is correct, I send it to DB. Then I send user to intermediate page (header ("Location...." ) ), then I sent user back to the first page (header ("Refresh...." ) ) and show some info. 3. User returned back to the initial page and he can press F5 as much as he wish.
  4. Well... As I see, your logic is the next: user enter info in suppadd.php. Then he goes to suppsave.php. In this script entered data are checked: if one specific information exists in DB, you are redirecting to suppadd.php. If this information is not presented, you include the same (!) script suppadd.php. In both cases user might see the contents of suppadd.php. What are you going to do? I think that you are wrong in logic.
  5. Well, in such a case check a logic of your script - it's another task. Why do you have this error? Up to now nobody knows your code I just answered to your first question where you didn't show your code.
  6. It seems that you didn't try to use my code... You'd better try it and then answer.
  7. I don't like to explain it in detail... Just use it in another way: header("Refresh: 10;suppadd.php"); echo "New Supplier Added successfully!"; exit(); REFRESH works in the save way like LOCATION, but it redirect in some seconds (10 seconds in my example). LOCATION redirect immediately. PS. You may output any data between header() and exit(). User will see it it a browser.
  8. This could be solved very easy. 1. Check your received data. 2. If it's correct save in the DB. 3. Use header('Location:...'); in order to go to the form. Now GET/POST data were deleted. 4. User can press F5 until he is tired No more data will be recorded.
  9. If you wish to see any page inside your page, just use IFRAME tag.
  10. I'm glad that it helps Just to note: it's not a PHP task, it's MySQL task. I'd recommend you to read more about MySQL.
  11. If you use ORACLE (or PostgreSQL), the syntax of INSERT could be different from MySQL's INSERT. Also, if id field is a sequence, don't worry about it! Just insert you data and return a new id. INSERT INTO jobs (Name, whateverElse) VALUES ('blah', 'bleh') RETURNING jobID; You get jobID as if you start SELECT query.
  12. This is what I asked about. And every block has a unique id. That's great In such a case it's better to use another algorithm. 1. Every block has a unique id. 2. When create names and ids, use this id. I'll change your code and then show you how to work with it. <td width=\"206\"><p>$filename1<br><img src=\"$filename1\" alt=\"$filename1\" /></p> <p> <label> <input type=\"checkbox\" name=\"image_{$unique_id1}_save\" value=\"save\" id=\"CheckboxGroup1_1\" /> Save</label> <br /> <label> <input type=\"checkbox\" name=\"image_{$unique_id1}_delete\" value=\"delete\" id=\"CheckboxGroup1_2\" /> Delete</label> <br><label> <input type=\"checkbox\" name=\"image_{$unique_id1}_rotate\" value=\"rotate\" id=\"CheckboxGroup1_3\" /> Image needs rotating</label> <br /> </p></td> Curly brackets here image_{$unique_id1}_rotate (and also in other 2 places) are important!!! Well, how would you use it? Answer: easy Make a loop (foreach) iteration through $_POST and check keys: foreach( $_POST as $key => $val ) { list( $info, $id, $action)=explode( '_', $key); if( $info == 'image' ) { // use $id and $action: $id is a unique id and $action can be any from this set (save, delete, rotate) - do whatever you wish // you will see here only checkboxes that were checked at your form // any code here } } From my point of view this algorithm is easier to understand and it produces more clear code. PS. Advantage of this method: you don't need to know your id, you get it from the POST array.
  13. One of the problems is that you forget dollar sign at one place before "file_info" And one question to you. Do you have a set of blocks like the described block? If you have a set of blocks of information about files I can give you another possibility to get it in an easy way.
  14. And where do you see a problem? First ask user and then send this info into DB. And then you can do whatever you wish.
  15. You'd better show more code. The error is somewhere in another part of your code.
  16. The only (real) way to solve this kind of problems is to see the text of query. // Insert this code echo $query.'<br>'; //before this return mysql_query($query); And then show this query here.
  17. OK... You might have a query SELECT id,uid FROM `boot` WHERE id=1 Did you try to execute it from phpmyadmin? It seems that something is wrong it this query. Function mysql_error() could be useful for you to see exactly what is wrong. You may try to use it just after you make a call to function select().
  18. $query = $db->select("boot", "id, uid", "id=1"); It's a very great line! But why are you sure that all people knows the internal part of this function, it's parameters and so on? It's not a request, it's a call to the function that could do it and send to MySQL - I don't know, I can suggest it only.
  19. This warning mean that you have an error in you MySQL request. Show it.
  20. You are selecting an information (MySQL) and then check if something exists in it (PHP). You'd better do it inside MySQL's request. For example: SELECT `myname` FROM mytable WHERE myuser = 'user' and myname='5412' Maybe "WHERE myname='5412'" is enough. Send this request and then check just a number of rows in result but not values. It will work faster. The difference could be 10e-3 seconds, of course, or something like this
  21. This code header ("Content-type: image/png"); MUST be the first output of this script! If you like to make a selection, do it in a HTML page but not inside GD script. Then send this selection into you GD script using GET parameter(s). For example, you may do it with help of JavaScript. Just for example: let pict.php is you GD script. Use JS, change id value to whatever you wish (set new SRC for tag IMG). Browser will request your script with a new parameter <img src="pict.php?id=25" />
  22. You may put transparent DIV above this input. Set DIV's size equal to input's size, set z-index of this DIV more... But I can't understand. User see it and can enter these letters into another input, text editor etc. It's possible also look into the page code and copy this code very easy.
  23. "Yes that is correct, echo "[$id]"; is resulting in lots of []!" - is it mean that you have nothing between brackets? If "yes" it means that it's incorrect. Because you have to see ids between brackets!!! BTW.... It seems I've found a reason for your problem // For the first time I didn't read you code carefully. But just now I saw you initial code $info = mysql_fetch_array( $data ) // but later your wrote $id = $row['id']; $name = $row['name']; // I think you might write $id = $info['id']; $name = $info['name']; Check it...
  24. English is not my native language, sorry... And it could be that others understand you. But could you explain you question more detail for me?
  25. "so the link for all results is "directory/name.php?id=" where the equals should be followed by the id?" Check if you have something in this variable. For example, do it: echo "[$id]"; and say - if you have something between square brackets.
×
×
  • 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.