floridaflatlander
-
Posts
671 -
Joined
-
Last visited
-
Days Won
1
Posts posted by floridaflatlander
-
-
I can't get this simple redirect to work
I put it at the beginning of a page to make sure all the needed session are present.
I think the problem is in the user agent, I take that out and it works
Say it's on website/member/index.php?id=1 and I change the user agent it doesn't redirect. It gives me a "This page can't be displayed" error on the same page website/member/index.php?id=1.
function user_loggedin($home){ //if ($_SESSION['agent'] != md5($_SERVER['HTTP_USER_AGENT'])) echo 'NO Match'; else echo 'Match'; // for testing // If not fully logged in with required Sessions redirect if (!isset($_SESSION['id_member']) OR !isset($_SESSION['id_group']) OR !isset($_SESSION['agent']) OR ($_SESSION['agent'] != md5($_SERVER['HTTP_USER_AGENT']))) { header("Location: $home/members/login.php"); exit(); // Quit the script. } }
Thanks
-
Did you check your error logs?
-
Can php.ini really solve this?
I mean - the support guy tried my script and it worked for him.
If my ini-settings had been wrong, the script wouldn't have worked at all, right?
I would think so, are you sure your provider used a photo that was large enough for the test upload?
-
What do you or they have your php.ini memory limit set to?
Two interesting links I found last week were
http://forums.devshed.com/php-development-5/imagecreatefromjpeg-causes-memory-error-667236.html
&
http://www.webdeveloper.com/forum/showthread.php?182328-imagecreatefromjpeg-is-eating-memory
If I remember correctly and did it correctly my 2.91mb photo took up almost 71mb. As a poster noted you definitely want to use imagedestroy
-
Thanks Barand & Requinix, this is I was looking for. I'm saving a little processing taking the thumb from the resized photo and because it's a thumb quality doesn't have to be perfect.
Thanks again
-
Thanks for the reply requinix, I really don't know how it works but I'm assuming that the image is already loaded to make the larger 450*400 picture so it wouldn't be loading twice(I think)
-
-
I'm saving two photos from an upload. One is a larger photo and the other is a thumb.
I was wondering if i used less resources to create the thumb copy of a photo from the reduced larger photo say 450*400 or create the thumb from the original that can be say 3mb and say 2500px * whatever or is it 6 one way or a half dozen another?
imagecopyresampled($photo, $source, 0, 0, 0, 0, $photo_width, $photo_height, $width, $height);
// imagecopyresampled($thumb_photo, $source, 0, 0, 0, 0, $thumb_width, $thumb_height, $width, $height); // OLD WAY
imagecopyresampled($thumb_photo, $photo, 0, 0, 0, 0, $thumb_width, $thumb_height, $photo_width, $photo_height); -
Has anyone had this problem that I solved(I hope) with bleepingcomputer.com
Whenever I tried to upload a photo here or at several other sites from my computer the picture folders wouldn't shown on this or several other sites in ie10, they worked fine with firefox. And yes I was always in the right folder and none of the folders were hidden.
On one of several searches ... "not all the picture folders are showing in ie10 upload" I got this
then this
http://www.bleepingcomputer.com/download/unhide/
This link said ... "Unhide is a program that reverts back the changes made to your files and Windows Registry by the rogue.FakeHDD family of rogue anti-spyware program. This family of malware pretends to be a hard disk repair and system optimization program for Windows. In reality, though, these programs are computer infections that deliberately hide your files and change certain settings in the Windows Registry to make it appear that you have lost data on your hard drive. It will then prompt you to purchase the program to restore the data"
Running a full scan with Norton Security Suite did not help.
Now a week or so ago I did click a link to a site that said I need to run their software to clean my computer of viruses so maybe I got something there.
I ran the above from bleepingcomputer.com and ie upload now reads the photo folders.
So my question is
Has anyone had this problem or heard of it and how it you solve it?
Thanks
-
I have a mysql table of items and was wondering if it would be to confusing to combine the columns used for the different “non-repeating info” that items had.
Instead of having columns for the number of bathrooms, boat length, rv length and camper length have one column called something like num1.
I've always heard that you should name columns in a way that associates with the column info, but if I combine columns I just have to add 18 columns, if I don't combine them I have to add 50 plus columns.
Or .. even though the data is non repeating go ahead and make tables for the info for realestate, boats, autos, rv's and on and on.
Just looking for some ideas
Thanks
-
-
Are php user defined functions defined/redefined every time a page loads?
I have a functions page and function_exist() tells me the function is redefined every time I load a page.
Is this correct, is this the nature of the beast that the functions will be redefined each time the function.inc file is used?
When they(books) say remember, are they taking about a page that uses the function.inc file 2,3,4 5 times?
Thanks
-
You can not use mysqli and mysql together in the same connection.
Yes,I just copied and pasted and should use mysqli if at all posssible.
-
Well you already have this "$num=mysql_num_rows($results);" with the LIMIT 4 and because the data is returned in rows I use $row = mysql_fetch_array($results); Then
$sql = "SELECT * FROM cards ORDER BY RAND() LIMIT 4";
$results = mysql_query($sql);
if ($r && (mysqli_num_rows($r) >= 1)) { // run if there is data
while ($row = mysqli_fetch_array($results, MYSQLI_ASSOC)){
echo '<a href="card.php?cardid=' . $row['id'] . '">' .$row['name'].'</a>';
echo "</br>";
}
} else {echo 'Something or nothing here';}
-
This is common, where do you define subject & detail at?
You could do something like if (isset($detail) {$message = "$detail";} which looks better
or
up at the beginning of the file put something like $subject = $detail = FALSE;
-
floridaflatlander: Variables will not be parsed when inside single quotes, an
"$meil2"
is most definitely not a valid e-mail address.The single quotes may be his issue, I just copied and pasted his code, changed the title & message and did't see that. But as I under stand it, $meil2 is a variable like $to so it should be ...
mail("$meil2","VELEC 2012, Resgister succced! $datav","From: [email protected]");
or
mail("$meil2","Test Title", "Test Body", "From: [email protected]");
Hey Katyna, before you do all this change your code to
mail("$meil2","VELEC 2012, Resgister succced!","{$datav}","From: [email protected]");
mail("$jobmeil2","VELEC 2012, Register succed!","{$datav}","From: [email protected]");
and see what happens
-
I don't understand what this is
"UID - This is auto increment
UID UserId Name Time"
Anyway, I usually run a query and if a certain value is already present in a column or in a column with a user id of xx I wont enter the data.
Also if you verify your data and your form wont process with out the info being filled out you maybe able to reset a value to false after the info is entered. Then it wont be entered again.
-
"php mail function dont accept variable names in the '$to' parameter??"
Yes it does, I use it.
For testing, try hard coding dummy values and/or get rid of one of the parameters. If the simple hard code works it may mean that your format is wrong.
mail('$meil2',"VELEC 2012, Resgister succced! $datav","From: [email protected]");
or
mail('$meil2',"Test Title", "Test Body", "From: [email protected]");
-
I declared the variable $myTextbox and set it equal to the value of the textbox I created in HTML below
You don't define it until you click submit then the value is POSTED to $myTextbox = $_POST['myTextbox'];
Also put your php code in
if (isset($_POST['submit'])) { // this name must match your form input name at <input type = 'submit' name = 'submit'/>
$myTextbox = $_POST['myTextbox'];
if(isset($myTextbox)&&!empty($myTextbox)){
echo 'You Typed: '.$myTextbox;
}
}
as you play more put the footer under the echo and under the footer place exit() to stop the script.
-
What I realized is that in IE it sends it to send_mail.php, doesnt bypass it like firefox does.
....
<form action="send_mail.php" method="post">
....
I must be missing something, your form is sending it to send_mail.php
Do you have exit()'s on redirects in send_mail.php
From stackoverflow
Without the exit call, the exact point/time at which your script will terminate will come down to two factors:
- How quickly the client browser reacts to the redirect
- How much time it takes the rest of your script to execute
- How quickly the client browser reacts to the redirect
-
Also it's a good habit to use exit() after all your redirects, this stops the script from running.
header( "Location: $feedback_page" );
exit;
header( "Location: $thankyou_page" );
exit;
and on and on
-
Either enter your URL here http://validator.w3.org/ or copy and paste the source code and if there is an issue it will tell you.
If you don't get an answer do the same with your css here http://jigsaw.w3.org/css-validator/
Be careful of extra brackets left in your css while editing.
Is this with ie 7/8 or 9?
-
Off the top of my head, you would either have to store this information in a file/database so that you can read it at the top, or you would probably have to use classes.
Also you could try a cookie or session
-
Here's a quick poor mans way to do what I think you're doing.
if(isset($_POST['submitted'])){ $error = FALSE; // Check for a name: if (empty($_POST['name'])) { $error [] = 1; // Or $error [] = '<h5 style="color: red;">* You forgot to enter a name.</h5>'; and then print this array } else { $name= $_POST['name']; $name = mysqli_real_escape_string($dbc, trim($name)); } // Check for a something: if (empty($_POST['somethnig'])) { $error [] = 1; } else { $something= $_POST['something']; $something = mysqli_real_escape_string($dbc, trim($something)); } if (!$error) { $sqlinsert = "INSERT INTO Users (name) VALUES ('$name')"; $r = mysqli_query($dbc, $sqlinsert); // or die("Error: ".mysqli_error($dbc)); if ($r) {$newrecord = "Name created";} } }
I can't get simple redirect to work
in PHP Coding Help
Posted
Thanks for the reply ginerjm, no the conditions on the member page worked, the redirect also worked. The problem was on the login page if there was a session member id it would redirect back to the member page, the page the first redirect came from.
I added ($_SESSION['agent'] == md5($_SERVER['HTTP_USER_AGENT'])) to the condition on the login page and it worked.
Thanks again