Jump to content

SergeiSS

Members
  • Posts

    239
  • Joined

  • Last visited

Everything posted by SergeiSS

  1. I tried to understand your logic but failed... Maybe it's my problem, of course. But in any case, did you hear about MVC (Model-View-Controller)? It means that it's better to separate the part where you get your data from the presentation part. In this case it would be better not to use 'echo' inside the 'while' loop. Just get data, create arrays with data and then print them. It also will be more convenient to debug. Another thing, can be even more important... It seems, that you may aggregate all information in one SELECT and then just take this info. Check for GROUP_CONCAT in the MySQL help.
  2. OK. Instead of trying header("location: $page_url"); write here echo $page_url and check what do you have here. Until now I'm not sure that you have in this variable the correct URL (the URL that you like to have here).
  3. It always interesting for me... How lazy could be a man? OK, short example As short as possible. <div><iframe ......></iframe></div><div><iframe ....></iframe></div> How to put them in correct places? You would better think about it. As an example you may check the code of this forum page. It contains some DIVs.
  4. You need 2 DIVs. Put one iframe in the first DIV and another iframe in another DIV. Then you may place these DIVs (iframes) whenever you wish. May be you will need CSS for this. Another possibility is to use a table with 2 columns. But it's not a modern solution.
  5. It seems that there is no telepath here Show your code that redirect incorrectly. We'll think together.
  6. You'd better show your code. Otherwise it's difficult to say what is wrong. I can suggest only that you try to use the value from your selection (column with image name or something similar to it) without checking it's contents.
  7. 1. Yes, it's possible. 2. You may use GET variables or SESSION variables. 2a: $test = 'index.php?id=10'; header("location: $test"); 2b: read about sessions.
  8. Sorry for misinforming... I use MySQL not too often. My "main" DB is Postgre, I like it. That's why I can sometimes say something wrong about MySQL.
  9. 'password' is reserved word for MySQL, that's why use special letters/quotes (sorry, I don't know exact name for it ) $sql = "select * from `usname` where `usname`='$usname' and `password`='$password'"; Also you would better use it for all: table names and column names. I'd recommend to don't use reserved words for column names at all. PS. "Cannot modify header location..." - you get it because your script print some letters (error message about SQL error) before you try to use function header(...). Solve your SQL problem and then the second problem would be solved automatically.
  10. And what is not clear? Take for() loop and set variables. I think it's better to use an array but not a set of variables: <?php $images=array(); for( $i=1; $i<=10; $i++) // may be not 10 but a number of loaded images $images[]=sprintf( '2011-%02d', $i ); ?>
  11. kamal213 - if you like to know the url of the form, that you come from, check variable $_SERVER['HTTP_REFERER']. But be careful! This variable could be wrong, because browser can change it before sending to a server. BTW, you may also use header( 'Refresh:.....') in order to show something at this page before real redirecting.
  12. You may try to use regular expression or just create your own function. I'd better create my own function It's not difficult to do.
×
×
  • 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.