I need help in PHP

Discussion in 'PHP' started by coun_vincent, Dec 24, 2008.

  1. #1
    Hello guys ,

    i have one prob in my add links exchange .... when someone add his link to exchange it with me ... he put his site info and when he click on Request links exchange to send the request the page re-load and nothing have done like he don't put the info ....and when i check my admin section i don't find any links come to confirm it .

    so i hope someone help me to fix it .

    this's the place : http://www.break4g.com/addlink.php

    and this's the Code of addlink.php :
     
    coun_vincent, Dec 24, 2008 IP
  2. hac

    hac Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This test will fail, and nothing will happen, because $mail has not been set to "sent". Form input and PHP variables are not the same. To access information from your form, use the $_GET array, like this:

    
    // See if the form has been submitted and evaluate
    if($_GET['mail'] == "sent")
    {
    
    Code (markup):
    You must use this method for all of the other form data that you access as well. For example, use the values of $_GET['lsURL'], $_GET['email'], etc.
     
    hac, Dec 24, 2008 IP
  3. allodium

    allodium Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hac, +1
    Global variable should be switched off - for safety.
    I recommend instead of a method GET to use a method POST
     
    allodium, Dec 24, 2008 IP
  4. coun_vincent

    coun_vincent Well-Known Member

    Messages:
    803
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    130
    #4
    Hello ,

    i go and edit the code as u said and working well but when i go to admin to confirm the site i find only space without info about the site added .

    so what i should do for it

    thank you so much again
     
    coun_vincent, Dec 25, 2008 IP
  5. coun_vincent

    coun_vincent Well-Known Member

    Messages:
    803
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    130
    #5
    nobody can help ?
     
    coun_vincent, Dec 26, 2008 IP
  6. bluebenz

    bluebenz Well-Known Member

    Messages:
    876
    Likes Received:
    9
    Best Answers:
    2
    Trophy Points:
    138
    #6
    yes, It think the problem is your register global.
    check your register global in phpinfo().

    if it is off, then you must use $_GET to get the each of input form value, then put it in the sql string:

    VALUES ('" .$_GET['lsURL'] ."' ,'" .$_GET['lsTITLE'] .",'" .$_GET['email'] .",'" .$_GET['location'] .",'0')");
    (check the " and ' above, I am not sure it's correct)..
     
    bluebenz, Dec 27, 2008 IP
  7. coun_vincent

    coun_vincent Well-Known Member

    Messages:
    803
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    130
    #7
    Fixed , thank u so much :)
     
    coun_vincent, Dec 27, 2008 IP