Jump to content

maximeke2

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

maximeke2's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. ok, i'll try it next time
  2. yes, $_SESION['msg'] is used to display a message, in the main file there is a script: <?php if($_SESSION['msg'] != '') { echo '<div id="message">'.$_SESSION['msg'].'</div><br>'; /* jquery part: */ ?> <script> $("#message").hide(); $("#message").show("slow"); $("#message").delay(3500).hide("slow"); </script> <? $_SESSION['msg']=''; } ?> But.. i deleted all the echo "<script>history.back()</script>"; and i placed them back one by one, and there's something wrong with this one: if($_GET['id'] == '') { echo "<script>history.back()</script>"; } if i place this one back, he redirects, even if the statement is false. EDIT: I figured it out! On the previous page there was a form, on wich i forgot to add the ?id=<? echo $id; ?>.. So it works now Thanx!
  3. I'll try that tomorrow,now i'm going to bed
  4. You can not really "slow down" a script, but you can pause it for a while, by using usleep() for example: usleep(1000000); stops the script for 1 sec, so if you would change it to usleep(50000) , it waits 50 milliseconds. $running = null; do { curl_multi_exec($mh, $running); usleep(50000); } while($running > 0);
  5. Edited but it still redirects
  6. Hi everybody, i'm working on a event page, and registered users can comment on the events. If they posted a comment before, they can edit that comment by clicking a link. Once you're in that link, you can edit the title & the content. So when they press submit, the scripts checks your information and updates the database. Now comes the strange part... my scripts redirects automatically back to the previous page, shows the $_SESSION['msg'] var and doesn't update my database.. I should normally stay on that page and not go back.. <?php session_start(); if(!session_is_registered(username)) { echo "<script>history.back()</script>"; } if($_GET['id'] == '') { echo "<script>history.back()</script>"; } ?> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <script src="scripts/jquery-1.2.6.min.js"></script> <link href="styleff.css" rel="stylesheet" type="text/css"> <title>Events</title> <?php include 'begin.php'; ?> <div id="contentpage"> <center><h1>Events</h1></center> <?php $id=$_GET['id']; list($rightname) = mysql_fetch_row(mysql_query("select username from eventsresponse where id='$id'")); if($rightname != $_SESSION['username'] && $_SESSION['rank'] < '5') { $_SESSION['msg']='You don\'t have the permission to do that'; echo "<script>history.back()</script>"; } $discr=$_POST['discr']; $discr = stripslashes($discr); $discr = str_replace(' ',' ',$discr); $title = $_POST['title']; $title = stripslashes($title); $title = str_replace(' ',' ',$title); mysql_query("UPDATE eventsresponse SET title = '$title' WHERE id='$id'"); $_SESSION['msg']='Saved!'; ?> any help would be welcome :-\ maximeke2
×
×
  • 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.