Vreau sa fac si eu ceva, insa sunt intr-o incurcatura totala !
Imi poate explica si mie cineva, cum pot salva un link intr-un fisier text, sau intr-o baza de date?
Vreau sa precizez ca doresc sa salvez doar url-ul paginii, nu si continutul dupa cum urmeaza:
Am index.php sa zicem, cu un formular.
Am o-pagina.php care afiseaza informatiile din index.php , la apasarea butonului de trimitere.
Pe pagina o-pagina.php , vor fi afisate informatiile adaugate ulterior in index.php , si un link catre o alta pagina creat automat odata accesat butonul de trimitere din index.php.
Deci am asa:
index.php = pagina formularului
o-pagina.php = afiseaza informatiile adaugate in index.php , si ofera un link catre:
o-pagina2.php = afiseaza mai multe informatii, plus informatiile adaugate in index.php , previzualizate in o-pagina.php ..
Ma intereseaza sa salvez link-ul oferit in o-pagina.php , catre o-pagina2.php , intr-un fisier text, sau intr-o baza de date, pentru a putea fi ulterior folosit in alte scopuri ..
Uitati codurile mele:
index.php
Cod: Selectaţi tot
<form id="curse-form" class="nm" action="creare.php" method="get" onSubmit="target_popup(this)">
<div class="row-fluid">
<div class="span6">
<input class="input-large" type="text" required placeholder="nume prieten/a" name="nu" />
</div>
<div class="span6">
<input class="input-large" type="text" required placeholder="prenume prieten/a" name="pr" />
</div>
</div>
<div class="row-fluid">
<div class="span6">
<input class="input-large" type="text" required placeholder="porecla prieten/a" name="po" />
</div>
<div class="span6">
<input class="input-large" type="number" required placeholder="varsta" name="va" />
</div>
</div>
<div class="row-fluid">
<div class="span6">
<select class="input-large" name="ju">
<option value="0">alege judetul</option>
<option value="Alba">Alba</option>
<option value="Arad">Arad</option>
<option value="Arges">Arges</option>
<option value="Bacau">Bacau</option>
<option value="Bihor">Bihor</option>
<option value="Bistrita Nasaud">Bistrita Nasaud</option>
<option value="Botosani">Botosani</option>
<option value="Brasov">Brasov</option>
<option value="Braila">Braila</option>
<option value="Bucuresti">Bucuresti</option>
<option value="Buzau">Buzau</option>
<option value="Caras Severin">Caras Severin</option>
<option value="Calarasi">Calarasi</option>
<option value="Cluj">Cluj</option>
<option value="Constanta">Constanta</option>
<option value="Covasna">Covasna</option>
<option value="Dambovita">Dambovita</option>
<option value="Dolj">Dolj</option>
<option value="Galati">Galati</option>
<option value="Giurgiu">Giurgiu</option>
<option value="Gorj">Gorj</option>
<option value="Harghita">Harghita</option>
<option value="Hunedoara">Hunedoara</option>
<option value="Ialomita">Ialomita</option>
<option value="Iasi">Iasi</option>
<option value="Ilfov">Ilfov</option>
<option value="Maramures">Maramures</option>
<option value="Mehedinti">Mehedinti</option>
<option value="Mures">Mures</option>
<option value="Neamt">Neamt</option>
<option value="Olt">Olt</option>
<option value="Prahova">Prahova</option>
<option value="Satu Mare">Satu Mare</option>
<option value="Salaj">Salaj</option>
<option value="Sibiu">Sibiu</option>
<option value="Suceava">Suceava</option>
<option value="Teleorman">Teleorman</option>
<option value="Timis">Timis</option>
<option value="Tulcea">Tulcea</option>
<option value="Vaslui">Vaslui</option>
<option value="Valcea">Valcea</option>
<option value="Vrancea">Vrancea</option>
</select>
</div>
<div class="span6">
<input class="input-large" type="text" required placeholder="in ce localitate sta?" name="lo" />
</div>
</div>
<div class="row-fluid">
<div class="span12">
<select class="input-large" name="select">
<option value="fara-selectare">alege</option>
<option value="0">................................ </option>
<option value="1">[MASCULIN</option>
<option value="2">[MASCULIN]</option>
<option value="3">[MASCULIN]</option>
<option value="4">[MASCULIN]</option>
<option value="5">[MASCULIN]</option>
<option value="0">................................ </option>
<option value="6">[FEMININ]</option>
<option value="7">[FEMININ]</option>
<option value="8">[FEMININ]</option>
<option value="9">[FEMININ]</option>
<option value="l0">[FEMININ]</option>
</select>
</div>
</div>
<div class="row-fluid">
<div class="span12 text-center">
<input class="btn btn-large btn-primary" type="submit" value="proceseaza informatiile"/>
</div>
</div>
</form>
Cod: Selectaţi tot
<?
$find = array ("/ /");
$replace = array ("+");
$link = $adresa.'stiri.php?nu='.ucwords($_GET["nu"]).'&pr='.ucwords($_GET["pr"]).'&lo='.ucwords($_GET["lo"]).'&va='.ucwords($_GET["va"]).'&po='.ucwords($_GET["po"]).'&ju='.ucwords($_GET["ju"]).'&stire='.$_GET["stire"];
$link = preg_replace($find,$replace,$link);
$stire = $_GET["stire"];
$fulllink = '<a target="_blank"href='.$link.'><b>PREVIZUALIZEAZA</b></a>';
?>
Cod: Selectaţi tot
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><html lang="en" class="no-js"> <![endif]-->
<head>
</head>
<body>
<?php include 'colectare.php'; ?>
<div align="center">
<p><strong>link-ul de mai jos este pentru previzualizare</strong></p>
<p><textarea cols="60" rows="2"><? echo $link; ?></textarea></p>
<br />
<p><? echo $fulllink; ?></p>
</div>
</body>
</html>
Cod: Selectaţi tot
<? echo $nu; ?> <? echo $pr; ?> din <? echo $lo; ?> in varsta de <? echo $va; ?> de ani , etc
Imi poate da cineva o idee?
Va multumesc anticipat !
Claudiu !