Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]header
glass
post
Post #1





Grupa: Zarejestrowani
Postów: 94
Pomógł: 0
Dołączył: 23.03.2007
Skąd: United Kingdom

Ostrzeżenie: (10%)
X----


Witam szukałem trochę ale nie umie znaleźć czy jest możliwe ustawić tak
Kod
header('Location: http://bogatyojciec.pl/?A=48395');
.. by razem z przekierowaniem otwierał stronę w nowej karcie?

Mam w potrzebie formularz z polem select i listę z dwoma wyborami, każdy z nich to inny link, chyba że da się to zrobić inaczej?
Go to the top of the page
+Quote Post
nexis
post
Post #2





Grupa: Zarejestrowani
Postów: 1 012
Pomógł: 109
Dołączył: 26.09.2003
Skąd: nexis.pl

Ostrzeżenie: (0%)
-----


Za pomocą header()" title="Zobacz w manualu PHP" target="_manual i ogólnie rzecz biorąc PHP nie da się tego zrobić. Pozostaje JavaScript
Go to the top of the page
+Quote Post
slewin
post
Post #3





Grupa: Zarejestrowani
Postów: 104
Pomógł: 7
Dołączył: 9.12.2008
Skąd: wroc

Ostrzeżenie: (0%)
-----


Też odrazu mi się przypomnial taki temat . Kurs HTML na Helion i link przydatne skrypty ,nawigacja :
Kod
<script LANGUAGE="JavaScript">
  function selecturl(s) {
      var gourl = s.options[s.selectedIndex].value;    window.top.location.href = gourl;
  }
  </SCRIPT>

W ramach BODY

Kod
<FORM>
  <SELECT NAME="urljump" OnChange="selecturl(this)">
      <OPTION VALUE="none">Wybierz adres</OPTION>
      <OPTION VALUE="http://www.corel.com">Corel Corporation</OPTION>
      <OPTION VALUE="http://www.microsoft.com">Microsoft Corporation</OPTION>
      <OPTION VALUE="http://www.netscape.com">Netscape Corporation</OPTION>
  </SELECT>
  </FORM>

Co do nowej karty to nie wiem jak by to zrobić .
o coś takiego Ci chodzi ?

Ten post edytował slewin 18.04.2009, 09:33:54
Go to the top of the page
+Quote Post
glass
post
Post #4





Grupa: Zarejestrowani
Postów: 94
Pomógł: 0
Dołączył: 23.03.2007
Skąd: United Kingdom

Ostrzeżenie: (10%)
X----


powiem szczerze że mnie to satysfakcjonuje dzięki, tylko że na js się nie znam tak jak na php więc całkiem nie dobrze
Go to the top of the page
+Quote Post
DREEMus
post
Post #5





Grupa: Zarejestrowani
Postów: 286
Pomógł: 34
Dołączył: 4.09.2008
Skąd: Wrocław

Ostrzeżenie: (0%)
-----


hmm, a nie możesz sobie zrobić pliku re.php który Ci zrobi przkierowanie i otworzy popup? Czy to musi być nowa strona/zakładka (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)

czemu nikt nie sprawdza przykładów pod funkcjami w manualu (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)

  1. <?php
  2. //This works in 5.2.3
  3. //First function turns SSL on if it is off.
  4. //Second function detects if SSL is on, if it is, turns it off.
  5.  
  6. //==== Redirect... Try PHP header redirect, then Java redirect, then try http redirect.:
  7. function redirect($url){
  8.    if (!headers_sent()){    //If headers not sent yet... then do php redirect
  9.        header('Location: '.$url); exit;
  10.    }else{                    //If headers are sent... do java redirect... if java disabled, do html redirect.
  11.        echo '<script type="text/javascript">';
  12.        echo 'window.location.href="'.$url.'";';
  13.        echo '</script>';
  14.        echo '<noscript>';
  15.        echo '<meta http-equiv="refresh" content="0;url='.$url.'" />';
  16.        echo '</noscript>'; exit;
  17.    }
  18. }//==== End -- Redirect
  19. ?>

Przerób sobie na własne potrzeby (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Ten post edytował DREEMus 18.04.2009, 20:04:39
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.12.2025 - 00:06