Jump to content

Goldi90

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Goldi90's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, how to make this form + php to make it work this way from the drop-down box choose the database title, or ID, and then the form in which I write some content will be added to the database that matches the title or ID that is sometimes so as not to invade a mistake and content that I type is not added to another title or ID I created something like this: <?php $db = new mysqli('localhost','xxxxx','xxxx','xxxx'); mysqli_query($db,'SET NAMES `utf8`'); $sqlnowe = mysqli_query($db,'SELECT * FROM `cc` ORDER BY `id` DESC '); ?> <form action="formu.php" method="post"> <select name="tytul"> <?php while ($rownowe = mysqli_fetch_array($sqlnowe)) { ?> <option><? echo $rownowe['tytul']; ?></option><?php };?> </select> opismax:<br /> <input type="text" name="opismax" /><br /> <textarea name="opismax" cols="50" rows="10">Proszę, wpisz tutaj jakiś komentarz...</textarea> <input type="submit" value="dodaj" /> </form> <?php // odbieramy dane z formularza $tytul = $_POST['tytul']; $opismax = $_POST['opismax']; if($tytul and $opismax) { // dodajemy rekord do bazy $ins = mysqli_query("INSERT tytul='$tytul' INTO publications SET opismax='$opismax'"); if($ins) echo "Good"; else echo "Bad"; } ?>
  2. Excellent job! thanks Now how to change these addresses (http://www.adrtes.pl.pl/xyz.php?uri=Ble-ble&autor=Autoros-autorexk) on http://www.adrtes.pl.pl/Ble-ble/Autoros-autorexk
  3. 1. nothing appears 2. not work All code: <?php if ($_GET['autor'] && $_GET['uri']){ $autor = urldecode($_GET['autor']); $uri = urldecode($_GET['uri']); header('Location: http://www.adrtes.pl/mp3/'.$ulr.'/'.$niepl.'.html'); } $db = new mysqli('localhost','xxxx_xxxx','xxxxx','xxxx_xxxx'); mysqli_query($db,'SET NAMES `utf8`'); $wykonaj=mysqli_query($db,"SELECT * FROM `no` ORDER BY `pub_id` DESC "); $znaleziono=mysqli_num_rows($wykonaj); $sql = mysqli_query($db,'SELECT * FROM `no` ORDER BY `pub` DESC '); while ($row = mysqli_fetch_array($sql)) { $autor = $row['autor']; $we1 = array('ą','ć','ę','ł','ń','ó','ś','ź','ż','Ą','Ć','Ę','Ł','Ń','Ó','Ś','Ź','Ż',' '); $wy1 = array('a','c','e','l','n','o','s','z','z','A','C','E','L','N','O','S','Z','Z','-'); $autor= str_replace($we1, $wy1, $autor); echo '<div class="prod_title"><strong><a href="'.$row['uri'].'/'.$autor.'" title='.$row['tytul'].'>'.$row['tytul'].'</a></strong> </div>'; } ?> What do you want to achieve ... links in the form of www.mojadres.pl/$row['uri']/$author (eg www.mojadres.pl/Ble-ble/Autoros-autorex - it is already achieved through the <a href ="'.$ row['uri'].'/'.$author.' " title = '. $row[' title'].'>'.$ row['title'].'</ a>) These links above are to be redirected to this address http://www.adres.pl/pub/ '. $ uri .'/'.$ author.'. html - or entering into my link www.mojadres.pl/Ble-ble/Autoros-autorex have been redirected to http://www.adres.pl/pub/ble-ble/autoros-autorex.html etc.
  4. Hi, how to redirect to another page ... if ($_GET['autor'] && $_GET['ulr']){ $niepl = intval($_GET['autor']); $ulr = urldecode($_GET['ulr']); header('Location: http://www.adrtes.pl/mp3/'.$ulr.'/'.$niepl.'.html'); } while ($row = mysqli_fetch_array($sql)) { $niepl = $row['autor']; $we1 = array('ą','ć','ę','ł','ń','ó','ś','ź','ż','Ą','Ć','Ę','Ł','Ń','Ó','Ś','Ź','Ż',' '); $wy1 = array('a','c','e','l','n','o','s','z','z','A','C','E','L','N','O','S','Z','Z','-'); $niepl= str_replace($we1, $wy1, $niepl); echo '<strong><a href="'.$row['ulr'].'/'.$niepl.'" title='.$row['tytul'].'>'.$row['tytul'].'</a></strong>'; My link looks like this: http://www.adress.pl/bo/Name-That/Autore-Yourself and is redirected to the address http://www.adrtes.pl/mp3/Name-That/Autore-Yourself.html Changes only: Name-That and Autore-Yourself
×
×
  • 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.