floridaflatlander
-
Posts
671 -
Joined
-
Last visited
-
Days Won
1
Posts posted by floridaflatlander
-
-
?, is there a link?
-
Good
-
is this another subject?
anyway three arguments str_replace("Replace this', 'With This', $in_this);
Did this come about after the above?
-
syntax error, unexpected ';'
Usually means you need an extra closing parentheses or bracket or you have an extra parenthesis or bracket.
-
echo str_replace(array('<h3>', '</h3>'), array('<h1>', '</h1>', ob_get_clean());
Are you missing a closing ) on the end?
-
Can you use
while ($row = mysqli_fetch_array($rp, MYSQLI_ASSOC)){
echo '<a title="'.$row['title'].'" href="'.$plink.''.$row['pid'].'">';
}
-
10 seconds is not enough time to prevent a double-submit.
Or even one second
Or you can try
if (isset($_POST['submit'])) { // Check for a name: if (empty($_POST['name'])) { $error [] = 1; $name_e = '<h5 style="color: red;">* You forgot to enter a name.</h5>'; } else { $name = $_POST ['name']; $name = mysqli_real_escape_string($dbc, trim($name)); } // The other $_POST if (!$error) { // Run UPDATE query if ($results){ // Or mysqli_affected_rows might be better $name_submitted = ''; // Or any variable that would make sense. } } }
<input type="text" name="name" size="90" value="<?php if (!empty($name_submitted)) {echo $name_submitted;} elseif (!empty($name)) {echo $name;} ?>" />
-
Think of forum posts here...
I see
Can you right it so the check will be for the last 10 seconds?
If they are double clicking it and I think they are I bet the odds are you'll need less than 10 seconds, you may need less than one second.
You may need something like this
PS - You should also disable your button onclick with javascript to prevent double-submission at the client side -
floridaflatlander - some clients use the same email for all their department.
Is it ok for 2 users with the same email to submit topics at the same time. I just don't want that each one of them will submit the same topice twice...
If that's the case you have to do what ever is unigue. name/title etc.
-
Hello,
From time to time I found duplicated records (rows) in my database. Its looks like the user double click on the submit button.
recently its happen more often so I add code that check when the last submit happened (I save the linux time) and check if there is 10 second delay:
if (mysql_num_rows($query))
{
}
I don't know why but its not working.
is there any better way to prevent double submiting?
Roi.
Okay so all you're doing is checking for duplicates right?
Why do you need to use date in your select, can user name or email and title be enough? Unless I'm wrong it just adds stuff.
Also I'd use either client or email but not both since a member's name and email are both unique(I would think). So I'd try
$query = "SELECT title FROM tkts_topics WHERE email = '$email' AND title = '$title' ";
$r = mysqli_query($dbc, $query);
-
... I use $member_id.time() for file(picture) names.
Actually I use member id then an underscore and then time
As long as it is UNIQUE and FIXED-WIDTH, I really don't care...
Well, and it shouldn't advertise "non-public" info like "member ID", so maybe I disagree some...
Debbie
Okay #113246
-
... I use $member_id.time() for file(picture) names.
Actually I use member id then an underscore and then time
-
Will people use the same name for a photo? I don't hash my photo names but I use $member_id.time() for file(picture) names.
-
XAMPP totally. It is fast, neat and everything you want it to be.
I don't know about totally but I agree with the rest of the statement.
-
How do I say echo $result['product_id'] because that doesn't work.
$result['product_id'] isn't returning a value? So you have a php problem not a css problem .... ??
-
... 1s logged it shows rlly weird..
It looks almost like the front page to me.
-
See if his helps, plug your URL in here
This is a usefull site, it says you have 32 errors, it seems most are because you defined your site as strict.
I use <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Also get and use firefoxes firebug it displays colored fields to help you see whats what.
-
I don't know if this will help but urlencode().
-
How do you get your info to the destination page? Using something like <form action="destination.php" method="post" >
-
Is "$this = $_GET ['this'];" on another page/file.
-
What do you mean wont die? A couple of months ago I was doing some stuff with a cookie that would cease when the browser was closed and look and it was still present in name after I closed and reopened the browser however the cookie would not work on the site, it had expired. I can't remember which browser using.
PS. open your browser and click the cookie name, it will tell you when it expires. If it is a past date or time it is no good, it's just listed in the browser waiting to be deleted.
-
if (!empty($row[username])) // he got it.
{
$_SESSION[username] = $row[username];
echo "Welcome $_POST[username]! You've been successfully logged in. <a href=\"/index.php\" title=\"Click here to go back to the homepage.\">Home Page</a></li></ul>";;
exit();
}
I don't know why you have two semi colons above.
you need session_start(); at the top of every page that you're going to use sessions, it needs to be the first thing on the page after the opening php tag and a few comments if any.
you can
echo "Welcome {$row['username']}! You've been successfully logged in. <a href=\"/index.php\" title=\"Click here to go back to the homepage.\">Home Page</a></li></ul>";
or
echo "Welcome {$_SESSION[username]} You've been successfully logged in. <a href=\"/index.php\" title=\"Click here to go back to the homepage.\">Home Page</a></li></ul>";
or get rid of all that double quote stuff
echo 'Welcome '.$_SESSION[username].'! You've been successfully logged in. <a href="/index.php" title="Click here to go back to the homepage.">Home Page</a></li></ul>';
-
Yeah, when they close their browser the session ends
$_SESSION[username] = $row[username]; doesn't set a time to stay active.
-
I don't know because it's not my site, if I want to do that in a div, then how do I do it?
You're not looking at the code? Depending on floats or positions put the image in the div
My Blog
in Website Critique
Posted
What is it, what are you doing? I see ads and subjects for everything. It looks every plain to me. Why would anyone want to go there. Want's your angle? What are you doing?