Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

153
Vistas
HTML Javascript URL Parameters not lined up in a row by klicking second time on a next button

for test and understanding for my project: I want a php-page which shows me the current date of the week and a link which I can go one week forward. In the URL I send the date to the next side, if I have a datetime in URL (so the first "next" click) it should show me the next week and also a next-Button to go to the next week (2. week) and so on... (Background is I want have a weekcalendar (Monday to Friday) with buttons previous week and next week.)

Currently I have the problem, that the browser adds in the url my sended date as a added row. But I want only one date and not the previous sended dates before.

Currently: HTTPPAGENAME/?next=1653915514?next=1653915516

If i clicked to times on next. Wrong Example

But I only want only: HTTPPAGENAME/?next=1653915516

when I click for two times.

The rest of the code is not finished, currently it is only the url-row-think.

Whats the clue on that?

<?php
    date_default_timezone_set("Europe/Berlin");
    $weekdate = time(); 
    
    $tmpstringurl = strtotime("+ 1 week", $weekdate);

if(isset($_GET['next'])) {
//Test not finished
    $tmpstringurl = strtotime("+ 1 week", $weekdate);

} else {
//Test not finished
    $tmpstringurl = strtotime("+ 1 week", $weekdate);
}

?>

<!DOCTYPE html>
<html>
    <body>

<p><label>Date: <?php echo date("d.m.Y", $weekdate) ?></label></p><br/>

<a href="" onclick="location.href=this.href+'?next='+<?php echo $tmpstringurl ?>;return false;">One week more</a>

</body>
</html>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I have re coded your snippet below.

<?php
    # By Ajmal PraveeN (AP)
    date_default_timezone_set("Europe/Berlin");
    $weekdate = time(); 
    
    $tmpstringurl = strtotime("+ 1 week", $weekdate);

if(isset($_GET['next'])) {
//Test not finished
    $tmpstringurl = strtotime("+ 1 week", $weekdate);

} else {
//Test not finished
    $tmpstringurl = strtotime("+ 1 week", $weekdate);
}

?>

<!DOCTYPE html>
<html>
    <body>

<p><label>Date: <?php echo date("d.m.Y", $weekdate); ?></label></p><br/>

<a href="/?next=<?php echo $tmpstringurl; ?>" title="One week more">One week more</a>

</body>
</html>

If this is useful upvote.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda