Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> pobieranie subject z linku
marmon
post
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 19.06.2005

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


witam
chcialbym poprosic o wyjasnienie mi co nazlezy zmienic aby subject byl pobierany z linku

Kod
usercp.php?do=pm&action=edit&subject=TUTAJ JEST TYTUŁ&uid=2&what=new&to=user1


pozdrawiam


  1. <?php
  2. elseif ($do=="pm" && $action=="edit")
  3. {
  4. // if new pm will give id=0 and empty array
  5. if (isset($_GET['id']) && $_GET['id'])
  6. $id=intval(0+$_GET['id']);
  7. else $id=intval(0);
  8. if (!isset($_GET['what'])) $_GET['what'] = '';
  9. if (!isset($_GET['to'])) $_GET['to'] = '';
  10.  
  11. $res=mysql_query("select messages.*, users.username as sendername FROM messages INNER JOIN us
    ers on users.id=messages.sender WHERE receiver=$uid AND messages.id=$id"
    );
  12. block_begin(PRIVATE_MSG);
  13. if (!$res)
  14.  err_msg(ERROR,BAD_ID);
  15. else
  16. {
  17. print("n<form method=post name=edit action=usercp.php?do=$do&action=post&uid=$uid><table class="lista" width="100%" align="center" cellpadding="2">");
  18. $result=mysql_fetch_array($res);
  19. print("n<tr><td class=header>".RECEIVER.":</td><td class=header><input type="text" name="receiver" value="".($_GET["what"]!="new" ? unesc($result["sendername"]):urldecode($_GET["to"]))."" size="40" maxlength="40" ".($_GET["what"]!="new" ? " readonly" : "")." />&nbsp;&nbsp;".($_GET["what"]=="new" ? "<a href="javascript:popusers('searchusers.php');">".FIND_USER."</a>" : "")."</td></tr>");
  20. print("n<tr><td class=header>".SUBJECT.":</td><td class=header><input type="text" name="subject" value="".($_GET["what"]!="new" ? (strpos(unesc($result["subject"]), "Re:")===false?"Re:":"").unesc($result["subject"]):"")."" size="40" maxlength="40" /></td></tr>");
  21. print("n<tr><td colspan=2>".textbbcode("edit","msg",($_GET["what"]=="quote" ? "[quote=".htmlspecialchars($result["sendername"])."]".unesc($result["msg"])."[/quote]" : ""))."</td></tr>");
  22. print("n</table>");
  23. print("<br />");
  24. print("n<table class=lista width=100% align=center>");
  25. print("n<tr><td class=lista align=center><input type="submit" name="confirm" value="".FRM_CONFIRM."" /></td><td class=lista align=center><input type="submit" name="confirm" value="".FRM_CANCEL."" /></td></tr>");
  26. print("n</table></form>");
  27. }
  28.  
  29. ?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




zmienne z linku znajdują sie w tablicy $_GET. subject wiec pobierasz:
  1. <?php
  2.  
  3. echo $_GET['subject'];
  4.  
  5. ?>

poczytaj se o $_GET i $_POST


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 19.08.2025 - 20:23