Lid |
|
Oke hier dan een code waar hij in staat, live voorbeeld gaat niet omdat er een inlog achter zit maar dit zou moeten voldoen.
Wat er gebeurd als ik op de anchor klik is het volgende. In plaats van op de pagina zelf mij te verwijzen naar de <a name> tag ververst hij de pagina en zet hij de naam van de anchor in de URL dus maakt hij er bijvoorbeeld van:
http://www.mijnwebsite.com/#anchortje
Mijn code:
<h1><?=ADD_AGENDA_H1?></h1>
<h2><?=ADD_AGENDA_H2?></h2>
<?php
displayText($_GET['page']);
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
$error = array();
if(empty($_POST['date']))
{
$error[] = 'date';
}
if(count($error == 0))
{
$data = explode("|", $_COOKIE[COOKIE]);
$date = $_POST['date'];
$date = explode('-', $date);
$date = $date[2].'-'.$date[1].'-'.$date[0];
mysql_query('INSERT INTO site_agenda
(user_id, date, start, end, text)
VALUES
("'.mysql_real_escape_string($data[0]).'",
"'.mysql_real_escape_string($date).'",
"'.mysql_real_escape_string($_POST['start']).'",
"'.mysql_real_escape_string($_POST['end']).'",
"'.mysql_real_escape_string($_POST['description']).'")') or die(ERROR_INSERT_TO_AGENDA);
}
}
?>
<form name="registration" method="post" action="" class="space-above">
<fieldset>
<legend><?=ADD_AGENDA_L4?></legend>
<label><?=ADD_AGENDA_L1?></label>
<input type="text" name="date" id="date" value="" class="input" />
<br />
<label><?=ADD_AGENDA_L2?></label>
<select name="start" class="input">
<?=displayTimeSelect()?>
</select>
<br />
<label><?=ADD_AGENDA_L3?></label>
<select name="end" class="input">
<?=displayTimeSelect()?>
</select>
<br />
<label><?=ADD_AGENDA_L5?></label>
<textarea name="description" rows="5" class="input"></textarea>
<br />
<input type="submit" name="submit" class="submit-button" value="<?=ADD_AGENDA_BUTTON?>" />
</fieldset>
</form>
<a href="#anchortje">KLIK HIER</a>
<?php
showMyAgenda($_COOKIE[COOKIE]);
?>
<script>
$(function() {
$( "#date" ).datepicker({
dayNamesMin: ['Zo', 'Ma', 'Di', 'wo', 'Do', 'Vr', 'Za'],
monthNames: ['Januari', 'Februari', 'Maart', 'April', 'Mei', 'Juni', 'Juli', 'Augustus', 'September', 'Oktober', 'November', 'December'],
dateFormat: 'dd-mm-yy'
});
});
</script>
<a name="#anchortje">KOM HIER</a>
<h1><?=ADD_AGENDA_H1?></h1> <h2><?=ADD_AGENDA_H2?></h2> <?php displayText($_GET['page']); if($_SERVER['REQUEST_METHOD'] == 'POST') { if(empty($_POST['date'])) { $error[] = 'date'; } { $data = explode("|", $_COOKIE[COOKIE ]); $date = $_POST['date']; $date = $date[2].'-'.$date[1].'-'.$date[0]; (user_id, date, start, end, text) VALUES } } ?> <form name="registration" method="post" action="" class="space-above"> <fieldset> <legend><?=ADD_AGENDA_L4?></legend> <label><?=ADD_AGENDA_L1?></label> <input type="text" name="date" id="date" value="" class="input" /> <br /> <label><?=ADD_AGENDA_L2?></label> <select name="start" class="input"> <?=displayTimeSelect()?> </select> <br /> <label><?=ADD_AGENDA_L3?></label> <select name="end" class="input"> <?=displayTimeSelect()?> </select> <br /> <label><?=ADD_AGENDA_L5?></label> <textarea name="description" rows="5" class="input"></textarea> <br /> <input type="submit" name="submit" class="submit-button" value="<?=ADD_AGENDA_BUTTON?>" /> </fieldset> </form> <a href="#anchortje">KLIK HIER</a> <?php showMyAgenda($_COOKIE[COOKIE]); ?> <script> $(function() { $( "#date" ).datepicker({ dayNamesMin: ['Zo', 'Ma', 'Di', 'wo', 'Do', 'Vr', 'Za'], monthNames: ['Januari', 'Februari', 'Maart', 'April', 'Mei', 'Juni', 'Juli', 'Augustus', 'September', 'Oktober', 'November', 'December'], dateFormat: 'dd-mm-yy' }); }); </script> <a name="#anchortje">KOM HIER</a>
|