Jump to content

techker

Members
  • Posts

    812
  • Joined

  • Last visited

Posts posted by techker

  1. hey guys im trying to figure out why my auto suggest div doesn't show my french characters..

     

    now the script is really simple..

     

    index(form)

     

    
    <form action="V_P.php" method="post" id="search-form" name="search-form" class="pos-rel">
                                       <input type="text" size="25" value="" id="country" onkeyup="suggest(this.value);" onblur="fill();" class="" name="eleve" />
         
          <div class="suggestionsBox" id="suggestions" style="display: none;"> <img src="arrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
            <div class="suggestionList" id="suggestionsList">   </div>
          </div>
                                        <input type="submit" value="Go" id="search-btn" name="search-btn" class="grey search" />
                                    </form>
    

     

     

    and autocomplete.php

     

    link = mysql_connect('localhost', '2', '2');
    mysql_set_charset('iso-8859-1',$link);
    $db_selected = mysql_select_db('2', $link);
    if (!$db_selected) { die ('Database access error : ' . mysql_error());}
    
    ///Fisscal year
    $q3 = "SELECT * FROM  `Settings` ";
    $res3 = mysql_query($q3);
    $row5 = mysql_fetch_assoc($res3);
    
    
    $Table= $row5["Fiscale_Etudiant"];
    $TableS= $row5["Fiscale_Sortie"];
    
    
    
    
    
    
    
    $q=$_GET['q'];
    //$my_data=mysql_real_escape_string($q);
    
    
    
    
    
    
    
    $sql="SELECT Prenom FROM $Table WHERE Prenom LIKE '%$q%' ORDER BY Prenom";
    $result = mysql_query($sql);
    
    
    
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>
    
    <body>
    <?
    
    if($result)
    {
    	while ($row = mysql_fetch_array($result))
    	{
    		//echo htmlentities($row['Prenom'], ENT_QUOTES, 'ISO-8859-1')"\n";
    		//echo $row['Prenom']."\n";
    		echo htmlentities($row['Prenom'], ENT_QUOTES, 'iso-8859-1')"\n";
    	}
    }
    ?>
    </body>
    </html>
    

     

  2. Hey guys im trying to make my notification box pop up when the querry is successfull..

     

    i can only find examples of a button being pres st the the pop up occurs..

     

    i have this that takes the call back but only displays a message..

     

    so my link back would be home.php?success=1

    <?php if (!empty($_GET[success])) { echo "<b>Done!.</b><br><br>"; } //generic success notice ?>
    

     

  3. i tried it with csv instead and my new script works.

     

    //connect to the database 
    $connect = mysql_connect("localhost","2","2"); 
    mysql_select_db("2",$connect); //select the table 
    // 
    
    if ($_FILES[csv][size] > 0) { 
    
        //get the csv file 
        $file = $_FILES[csv][tmp_name]; 
        $handle = fopen($file,"r"); 
         
        //loop through the csv file and insert into database 
        do { 
            if ($data[0]) { 
                mysql_query("INSERT INTO test (nom, prenom, fiche,groupe) VALUES 
                    ( 
                        '".addslashes($data[1])."', 
                        '".addslashes($data[2])."', 
    				'".addslashes($data[0])."',
                        '".addslashes($data[6])."' 
                    ) 
                "); 
            } 
        } while ($data = fgetcsv($handle,1000,",","'")); 
        // 
    
        //redirect 
        header('Location: import.php?success=1'); die; 
    
    } 
    
    ?> 
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
    <title>Import a CSV File with PHP & MySQL</title> 
    </head> 
    
    <body> 
    
    <?php if (!empty($_GET[success])) { echo "<b>Your file has been imported.</b><br><br>"; } //generic success notice ?> 
    
    <form action="" method="post" enctype="multipart/form-data" name="form1" id="form1"> 
      Choose your file: <br /> 
      <input name="csv" type="file" id="csv" /> 
      <input type="submit" name="Submit" value="Submit" /> 
    </form> 
    
    </body> 
    </html> 
    

     

    but i still don't get why csv works better the xls..it seems to that what i find in google...

  4. i tried a fast test with this

     

    $link = mysql_connect("localhost", "1", "2");
    mysql_set_charset('utf8',$link);
    $db_selected = mysql_select_db("3", $link);
    if (!$db_selected) { die ('Database access error : ' . mysql_error());}
    [/php
    
    but i still get the odd caracters..i will continue with more tests
    

  5. Hey guys i go this going.

     

    $db_username="2"; //database user name
    $db_password="2";//database password
    $db_database="2"; //database name
    $db_host="localhost";
    
    
    mysql_connect($db_host,$db_username,$db_password);
    @mysql_select_db($db_database) or die( "Unable to connect to database.");
    
    
    $handle = fopen("http://www.ecoleljp.ca/Upload_/test.xls", "r"); //test.xls excel file name
    if ($handle)
    {
    $array = explode("\n", fread($handle, filesize("test.xls")));
    } 
    
    $total_array = count($array);
    $i = 0;
    
    while($i < $total_array)
    {
    $data = explode(",", $array[$i]);
    $sql = "insert into test (`nom` ,`prenom` ) values ('$data[0]','$data[1]')"; // i have two fields only , in oyour case depends on your table structure
    $result = mysql_query($sql);
    
    $i++;
    }
    echo "completed";
    
    

     

    it inserts but it looks like this lol

     

     

                                                                            id    nom                   prenom

      Edit   Inline Edit   Copy Delete 1 ????

      Edit   Inline Edit   Copy Delete 2 DROID TECH        8?rCal

      Edit   Inline Edit   Copy Delete 3 ?rCalib ##0_);("$"#

      Edit   Inline Edit   Copy Delete 4 ?? ?? ?

      Edit   Inline Edit   Copy Delete 5 ?}

      Edit   Inline Edit   Copy Delete 6 ????}

      Edit   Inline Edit   Copy Delete 7 ?}

      Edit   Inline Edit   Copy Delete 8 ????}

     

    how did i get to this?

     

    my xls file looks like this

     

     

    1  2441343 techker  techker 

    2    .... ... ...

    3 ...

     

     

     

     

     

  6. Hey guys i looking for a tutorial for forms that have drop downs or check boxes that influences other fields..

     

    like if you select yes a box appears with reason why..

     

    if you select no box stays as is...

     

    so i guess IF's in a html form..

     

     

  7. ya now i have it stored with a fiscal year..me to i was thinking of that..think i will leave as is..so now in my admin he selects the fiscal year and it shows only that..

     

    i was just debating if it would be more safe or practicle to have different databases every year..instead of loading all the same database every year...cause there's like over 1000 students..

  8. hey guys i have a web app that i did for a school and i ran into a snag... cause every year they have fiscal years and different students...

     

    so i was wondering.in the admin i wan't to predetermined the fiscal years.so the year after they click on the fiscal year and it creates a database (expl:2011-2012) with all the tables that i need for the app..

     

    is that possible?

  9. i got it going with a more simpler code

     

    http://api.geoio.com/q.php?key=mykey=geoip&d=json&q=<? echo getenv('REMOTE_ADDR'); ?>

     

    but i don't now how to execute that link and show the results on the same page>?

  10. Hey guys i want to do a geobanner that gets the client ip and echo's the location..

     

    i got a API key and and link..

     

    but to echo the perfect ip

    echo ''; 
    if ( isset($_SERVER["REMOTE_ADDR"]) )    { 
        echo '' . $_SERVER["REMOTE_ADDR"] . ' '; 
    } else if ( isset($_SERVER["HTTP_X_FORWARDED_FOR"]) )    { 
        echo '' . $_SERVER["HTTP_X_FORWARDED_FOR"] . ' '; 
    } else if ( isset($_SERVER["HTTP_CLIENT_IP"]) )    { 
        echo '' . $_SERVER["HTTP_CLIENT_IP"] . ''; 
    

     

    and the api link is

    http://api.geoio.com/q.php?key=MYKEY=json&q=HERE I NEED THE IP

     

    could it echo the results of the link instead of clicking the link?

  11. Hey guys i need to make a small app for work..

     

    i have this reference site that has a log in and i would like to make a page that could bypass that log in.but i have no access to that log in page.. that's the tricky part..lol

     

    so i tried to view source copy past in to a new document.

     

    filled in the field with my user and pass..

     

    and put an auto submit on page load..

     

    so my idea was to target the log in page form submit page(same page self)

    i was thinking it would detect the same form and load..but it doesn't it stops at the log in page...

     

    is this the right way to do it?

     

     

  12. still doesnt work..fill the database..

     

    so my goal is to check the rentals done by the loggin in user.

     

    so in rentals is have

    R_ID DVD_ID Employee LP Date

     

    then i want to go in the Locations(dvd's) and get the DVD info that he rented.(DVD_ID)

    L_ID Titre Date Prix Categorie Image Status UPC

     

    so basically when he goes to the account page it shows his rented movies..

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