Intypen, link veranderd.

Gestart doorWouterr5 reacties47 weergaven

6 berichten · pagina 1 van 1

Wouterr

Lid · Topicstarter

Berichten
5.274
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien

Eindhoven, Nederland

Hey!

Ik heb een vraagje of iemand dit weet.
Ik weet wel dat het kan, maar de naam enzo niet.
Kijk, je hebt een textbox (input) en daar vul je dan bijvoorbeeld 10 in (Aleen cijfers.)
En dan onder in, staat een link (Koop)

Zoiets, dus dat als je iets invult, dat het dan direct veranderd in die link..
Weet iemand dat?
Alvast ebdankt.
0
Berichten
4.013
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kun je het wat anders uitleggen, want ik snap het niet echt?

ik weet dus niet als het volgende juist is:

<html>
<body>
<form action="" method="GET"><input type="text" name="cijfers"><br /><input type="submit" value="Verstuur data!" name="get"></form>
[COLOR= #0000BB]<?php
$submit[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]get[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cijfers[/COLOR][COLOR= #007700]];[/COLOR]

[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]get[/COLOR][COLOR= #007700]]))
{[/COLOR]
 [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<a href=link.php?aantal=$text>link</a>"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cijfers[/COLOR][COLOR= #007700]]))
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Vul a.u.b een cijfer in!"[/COLOR][COLOR= #007700];
}[/COLOR]

?>
</body>
</html>
</html>


Denk ik, heb het niet zelf getest.
EDIT/
Heb het getest was 1 error in, heb verbeterd nu. biggrin
0
Wouterr

Lid · Topicstarter

Berichten
5.274
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien

Eindhoven, Nederland

Nee, daar zit een button in.
En wat ik heb is een link
0
Berichten
4.013
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dat snap ik niet confused.
0
Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hij wil met javascript dat het dan automatisch aanpast, zonder echt dingen te veranderen! aanpast.
Dan zou je zoeits moeten doen:

<input type="text" onkeyup="document.getElementById(link).innerHTML = <a href="jelink.php?id=+this.value+">Je tekst voor bij de link</a> /><br />
<span id="link"></span>


Niet getest, maar zoeits moet werken!
0
Wouterr

Lid · Topicstarter

Berichten
5.274
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien

Eindhoven, Nederland

aa nice, dat zocht ik inderdaad.
ik ga nu test biggrin
//edit
hier gaat iets fout met die " en .

[COLOR= #0000BB]<?php
$check[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM catalogue_pages WHERE indexid = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]page[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[COLOR= #0000BB]$check2[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$check[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$user[/COLOR][COLOR= #007700]->[/COLOR]user[COLOR= #007700]([/COLOR][COLOR= #DD0000]"rank"[/COLOR][COLOR= #007700]) >=[/COLOR] [COLOR= #0000BB]$check2[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]minrank[/COLOR][COLOR= #007700]]){[/COLOR]
[COLOR= #0000BB]$furniget[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM catalogue_items WHERE tid = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]tid[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[COLOR= #0000BB]$furni[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$furniget[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<center><b>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$furni[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]catalogue_name[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</b> <br />
<i>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$furni[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]catalogue_description[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</i><br />
<br />
[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$furni[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]catalogue_cost[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000] credits<br />
<br />
Hoeveel keer wil je hem kopen?<br />[/COLOR][COLOR= #007700];[/COLOR] 
?>
<input type="text" onkeyup="document.getElementById(link).innerHTML = this.value" />
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]
    <br />
<br />
Weet je zeker dat je hem wil kopen <a href="shop.php?page=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]page[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]&tid=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]tid[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]&goed&aantal=[/COLOR] [COLOR= #007700]<[/COLOR]div id[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"link"[/COLOR][COLOR= #007700]><[/COLOR]/div[COLOR= #007700]>[/COLOR][COLOR= #DD0000]">Ja</a> / <a href="shop.php?page=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]page[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]">Nee</a>  <br /> </center>[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Jou rank is [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$user[/COLOR][COLOR= #007700]->[/COLOR]user[COLOR= #007700]([/COLOR][COLOR= #DD0000]"rank"[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] en je hebt rank [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$check2[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]minrank[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000] nodig om deze pagina te bezoeken.[/COLOR][COLOR= #007700];
}[/COLOR]
?>


dat is mijn stukje script wat ik nu heb.
ik heb er al wat aangeprobeerd maar het lukt niet echt sadley
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren