Jump to content

floridaflatlander

Members
  • Posts

    671
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by floridaflatlander

  1. 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

  2. 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

  3. 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

  4. 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);

     

  5. 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

    http://answers.microsoft.com/en-us/ie/forum/ie10-windows_7/not-all-the-folders-are-showing-ie10/36835c45-afd9-4573-8ea1-658df0dd4368

    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

  6. 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

  7. 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

  8. 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';}

  9. 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: info@velec.com");

     

    or

     

    mail("$meil2","Test Title", "Test Body", "From: info@velec.com");

     

     

    Hey Katyna, before you do all this change your code to

     

    mail("$meil2","VELEC 2012, Resgister succced!","{$datav}","From: info@velec.com");

    mail("$jobmeil2","VELEC 2012, Register succed!","{$datav}","From: info@velec.com");

     

    and see what happens

  10. 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.

  11. "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: info@velec.com");

     

    or

     

    mail('$meil2',"Test Title", "Test Body", "From: info@velec.com");

  12. 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.

  13. 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:

    1. How quickly the client browser reacts to the redirect
    2. How much time it takes the rest of your script to execute

  14. 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";}
    }
    }
    

×
×
  • 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.