ashneet 0 Junior Poster

Hello,

I am using a GeoLite Country ip csv and storing it in the db.
it contains ip numbers which are normally huge.

My problems comes when I search for some of these numbers.

my query:

SELECT * FROM range WHERE range1 >= 1213099967

This query works fine but, the problem is that some of the numbers I get from the database are a lot smaller then 1213099967 which does not make sense to me.

Please share any opinions.

ashneet 0 Junior Poster

Hi,

Only way I could think of is by saving the excel sheet in CSV format and opening it in PHP and retrieving the value using the fgetcsv() function.

Here is an example... I just wrote this on the fly and it may have some mistakes
ex:

$file = fopen("test.csv", "r"); 

while($line = fgetcsv($file))  //extracted 1 row
{
   echo $line[0] . '<br />'; //column 1
   echo $line[1] . '<br />'; //column 2
   echo $line[2] . '<br />'; //column 3
   echo $line[3] . '<br />'; //column 4
   echo $line[4]; //column 5
}

fclose($file);
ashneet 0 Junior Poster

Thanks.. Ill look into them.

ashneet 0 Junior Poster

Hello everyone

Just wanted to ask if any one know a reliable and reputable hosting company.
I am going to be hosting a e-commerce website on it so i need it to be good.

I dont want the hosting to be too expensive but something like godaddy.com wont work because they charge money for every small feature which is annoying..

ashneet 0 Junior Poster

Thanks A lot, I'll looks into them.

ashneet 0 Junior Poster

I know how to use PHP very well and I want to learn how I can implement XML into it. This is because I am planning on developing multi-part program with one main core.

Can any one tell me good books which can help me learn XML and how to use it with php.

Any help would be appreciated.

ashneet 0 Junior Poster

Thanks to all. I could not have done this without you all.

ashneet 0 Junior Poster

well for the time being I now dont care about the height.

Almost all of my problems are solved so I am happy.

though I will look into how I can set the size of the container to the size of the screen without over flowing later.

Enough with the layout. Got to make the website now. :)

ashneet 0 Junior Poster

Java Script method is bad either its just that diffrent browsers need diffrent commands.

ashneet 0 Junior Poster

I understand what you mean its just the when I set height 100% for the container the page gets too big and the scroll bar comes even if there is no content in the page.

Why display a scroll bar when you are not suppose to see it.

ashneet 0 Junior Poster

I think I figured it out but it may cause some trouble.

I made this change to css:

#leftcol {
 float: left;
 top: 0;
 bottom: 0;
 margin: 0 -1px 0 -150px;
 padding: 0;
 width: 150px;
 background-color: #EEEEEE;
 text-align: center;
 /* IE Bug Fixes - # Hack may only work for IE 5/6 - 7 doesn't need it */
 #display: inline; /* Stops IE implimenting the Double MArgin Float Bug */
 #position: relative; /* Stops IE from botching negative placement */
 position: absolute;
}

is is alright to have two positions. since I am not sure as other one is a IE hack.

ashneet 0 Junior Poster

Thanks MidiMagic,
but that wont work. since I dont have multiple navigation and contents. I just have 1 content box and one navigation box. basically using php I will be modifying the contents of the navigation and content box.

ashneet 0 Junior Poster

How can I get nav height to be same as the content.

I have tried many ways but they dont work.

ashneet 0 Junior Poster

looks like my last post bugged now I tried posting it again and my last one is now there.. so its all good.

ashneet 0 Junior Poster

well I have fixed the layout for now will fix rest of the css later.

is ther any way to get the nav to be same size as the content unless there is more stuff in nav then content is the same size as nav.

^sorry for lousy wording; cant think of any way to explain this :D

so far I have tried to set min-height and height to 100% but there is no effect.

well anyway I changed the css and is now working on the test web.

ashneet 0 Junior Poster

Thanks a lot autocrat.

I will fix them up as soon as I can.

btw how do you know how to fix bugs in ie...

ashneet 0 Junior Poster

Arg - Validate man, Validate :)

http://validator.w3.org

That will show you a whole bunch of issues with the code...

Still, as you are willing to make the effort - so will I.

Keep an eye on her, I will paste you some code :)

I validated the page all those errors are from yahoo pasting a small script at the end of the page. that should not cause any problems.

ashneet 0 Junior Poster

Thanks autocrat that help me get rid of tables.

now the tables are gone but two issue still remain.

1) the container wont touch the bottom even when I set height to 100% - Ignorable issue.

2) the nav is not the same height as content.

I made the modifications at http://test.eezs.com

ashneet 0 Junior Poster

You can position div inside a div and float it or position it wherever you want. just use a universal class * to set the margin to 0 and the padding to 0. then you can set the divs individually where you want them. Almost like a table but with out the restrictions.

I will try that see what happens.

ashneet 0 Junior Poster

You are asking for the impossible. It might fit YOUR browser, but the following items will change the final size of any page:

All the things you mentioned are correct. its just that I expect the scrollbars to help me when the screen resolution gets small.
This is why the header image is 770 in width. so that there are less chances of getting a horizontal scroll bar.

ashneet 0 Junior Poster

this is the main html of the page with any tables:

<div id="header"><img src="images/head.gif" height="100"></div>
<div id="main">
<table class="content">
    <tr>
      <td rowspan="2" class="navi">
      +++++++navi here+++++++++++++++
      <td>
      <td class="data">main content here+++++++
      </td>
    </tr>
    <tr class="footer">
      <td>++++++footer++++++td>
    </tr>
  </table>
</div>

and the css for this is:

body {
 font-family: Arial, Helvetica, sans-serif;
 font-size: 11px;
 background-color: #ABCDEF;
 margin: 0px;
 padding: 0px;
 border: 0px;
 height: 100%;
 max-height: 100%;
}
#header {
 position: absolute;
 top: 0px;
 left: 0px;
 width: 100%;
 height: 100px;
 text-align: left;
 background-color: #ABCDEF;
}
#main {
 position: absolute;
 top: 101px;
 bottom: 0px;
 right: 0px;
 left: 0px;
}
#main .content {
 width: 100%;
 height: 100%;
 background-color: #FFFFFF;
}
#main .data {
 vertical-align: top;
}
#main .footer {
 vertical-align: bottom;
 text-align: center;
 color: #0099FF;
 background-color: #FFFFFF;
 border-top-width: thin;
 border-top-color: #ABCDEF;
 border-top-style: dotted;
}

ok I want the nav and the content to look like a single identy which I was not able to do so with just divs and want footer, nav and main content touch the bottom of the page until there is more content on the page then that can be displayed on the screen.

if you say you can split up the nav and content and have them beside each other with same height regardless the content then please tell me.

ashneet 0 Junior Poster

well the tables is not my concern as only reason I need it is so that I have somewhere i can put navigation which can be controlled easily rather then flying all over. The table is inside a div which whenever I set its height to 100% the scrollbar comes and you are actually able to move it up and down on a empty page.

ashneet 0 Junior Poster

Hello,

I have uploaded a test page on http://test.eezs.com/

The problem is that the content part of the page is not touching the bottom of the page.

I have run this site in FireFox and it displays the way I want it to display but in IE it wont work.

Thanks
If you need anything else such as css tell me I will post here.

ashneet 0 Junior Poster

ok Thank You,
I see what the problem is. there were few more bugs which I found out and fixed.

ashneet 0 Junior Poster

Ok looks like my server had a problem. I talked to my server ppl and they fixed the problem.

Now I get the message and all I see is

Content-Type: multipart/alternative;
boundary="alt-0d384c9fef45078c0aa547592bd6fb46"
 
--alt-0d384c9fef45078c0aa547592bd6fb46 
Content-Type: text/plain; charset="iso-8859-1" 
Content-Transfer-Encoding: 7bit
 
Dear test,
 
As requested your password has arrived, if you did not authorize this please use
the information below to login and change your password.
Please use the fallowing information to login:
 
Your User Name: [EMAIL="test@test.com"]test@test.com[/EMAIL]
Password: test
Suggestion: Copy and
paste your password as it appears in gray box above.
 
Please login in to your account anytime you like.
 
Thanks and regards,
test
Note: Please do not reply to this message, as we will not be able to respond. 
 
--alt-0d384c9fef45078c0aa547592bd6fb46 
Content-Type: text/html; charset="iso-8859-1" 
Content-Transfer-Encoding: 7bit
 
<font face="Arial" size="2">Dear test<br>
<br>
As requested your password has arrived, if you did not authorize this please 
use the information below to login and change your password.<br>
Please use the fallowing information to login:<br>
<br>
Your User Name: <span style="background-color:
#C0C0C0">test@test.com</span><br>
Your Password:&nbsp; test <span style="background-color: #C0C0C0"></span><br>
</font><font face="Arial" size="1"><span style="background-color: #99CCFF"><b>
Suggestion:</b> Copy and paste your password as it appears in gray box
above.<br>
</span></font><font face="Arial" size="2"><br>
Please login in to your account anytime you like.<br>
<br>
Thanks and regards,<br>
test<br>
<font color="#008000"><b>Note:</b> Please do not reply to this message, as we 
will not be able to respond.</font></font>
 
--alt-0d384c9fef45078c0aa547592bd6fb46--

One thing I have the hardest time with is sending emails through php as I cant send pure html because half of the people …

ashneet 0 Junior Poster

I did set

$MESSAGE = ob_get_contents();

and did

var_dump($MESSAGE);

it displayed the message of screen.
I have no idea what is wrong here.

ashneet 0 Junior Poster

Hi

I made a function which is suppose to send email, only problem is that I can send the email but its blank so can anyone tell me what I am going wrong.

//Function that send multipart emails
function email2($TO, $PREMADE, $FROM = false)
{
 //headers for emails
 
 //create a boundary string. It must be unique 
 //so we use the MD5 algorithm to generate a random hash
 $random_hash = md5(date('r', time()));
 
 if (!$FROM)
 {
  $Header = 'From: '.EMAIL_FROM. "\r\n";
 }
 else
 {
  $Header = 'From: '.$FROM. "\r\n";
 }
 
 $Header .= "\r\nContent-Type: multipart/alternative; boundary=\"alt-".$random_hash."\"";
 
 
 ob_start(); //Turn on output buffering
 switch($PREMADE)
 {
  case 'signup':
   $SUBJECT = "Thank you for signing up with test.com";
   ?>
--alt-<?php echo $random_hash; ?>  
Content-Type: text/plain; charset="iso-8859-1" 
Content-Transfer-Encoding: 7bit
Dear <?php echo $_POST[name];?>,
Thank you for submitting your company information to test.com.
Information you provided will be reviewed, on approval you will be sent a E-Mail with your password to access our website.
It generally takes one to two business days for approval.
Thanks and regards,
test
Note: Please do not reply to this message, as we will not be able to respond. 
--alt-<?php echo $random_hash; ?>  
Content-Type: text/html; charset="iso-8859-1" 
Content-Transfer-Encoding: 7bit
<font face="Arial" size="2">Dear <?php echo $_POST[name];?>,<br>
<br>
Thank you for submitting your company information 
to test.com.<br>
Information you provided will be reviewed, on approval you will be sent a E-Mail 
with your password to access our website.<br>
It generally takes one to two business days for approval.<br>
<br>
Thanks and regards,<br>
test<br>
<font color="#008000"><b>Note:</b> Please …
ashneet 0 Junior Poster

Thanks
That helps..:)

ashneet 0 Junior Poster

ok, In css I use lowercase letters so I am safe there. Can you tell me where I can find these W3C standards as when ever I go on their website I cant find them.. its like then hide them lol

ashneet 0 Junior Poster

well the problem with the page was that 'test text1', 'test text2' text would come over the head image.

what do you mean by lowercase, as to what I know it does not matter, but then again I am still new to css.

Also can you please specify how would you spell 'Height' as I could not think of any other spelling.

ashneet 0 Junior Poster

Since no one could figure out the why the FireFox could not display the page right, here is my solution to the problem.

For some reason Firefox is unable to apply the css Height command so I used to min-height command as it is accepted by all the browsers.

Regardless what anyone says the best browser is the one that came with windows.. Just my opinion not trying to start any arguments lol..

ashneet 0 Junior Poster

Hi

I am you can say a novice website designer and I made a layout for my website and it works in some browser and have issue in other.

Here is a link to where you can see my template:
http://71.185.46.175:8080/

If you dont feel safe opening the link or if the link is not working I have included a zip file with this post

This template works in:
IE
Opera
Have issue in:
FireFox
Netscape Navigator

Can some one please tell me what I can do to solve this problem. I have a feeling that Navigation is the problem but have no idea on how I can fix it.

ashneet 0 Junior Poster

Sorry for the trouble.

I figured it out. lol
For 4 hrs I could not figure the problem out and after posting, 1min later solved....

ashneet 0 Junior Poster

Here is a function I made:

function dis_sub(CID,ALI,NAME,PIC,EID)
{
  SUB_CAT+CID.ALI.value = ALI;
  SUB_CAT+CID.NA.value = NAME;
  SUB_CAT+CID.IDD.value = EID;
}

It is saying that I have syntax error right after the = sign.
Also SUB_CAT is not a variable.

ashneet 0 Junior Poster

lol, that one won't work.. you can still see it with View --> page source :D

That is why I said it will only slow a person down.:P

ashneet 0 Junior Poster

One way I can think of which can prevent a novice computer literate person is by using a No Right Click Java Script.

This method can only slow down a person from viewing your source as there are many other way to get the source.
Also you may want to read this Article on why not to use a No Right Click Java Script :
http://websiteowner.info/articles/ethics/norightclick.asp

The Article also mentions few ways to prevent source code to be easily read.
Hope that helps...:)

ashneet 0 Junior Poster

You may want to phpinfo your server and check what the value for post_max_size is set to.
if it is set lower then your picture size then there is your problem.
I think Default for php is 2MB but not sure.

ashneet 0 Junior Poster

I dont really have code for this but here it goes.

First of all I have basic knowledge of JavaScript and have moderate knowledge of php.

What I am trying to do is when someone click on a link. It will display a hidden form via Javascript modifying CSS(which I can do).
What I have no idea on how to do is update the input fileds so that it shows information about the the link. Basically I want it to fetch data from Mysql and put the data in their fields.

Also there can be multiple links on the page and that is why I dont want to load almost identical forms multiple time while disabling their display through CSS.

Is it even possible... If you think it is not possible can you suggest any alternatives. Thanks

ashneet 0 Junior Poster

Thanks,
it is a lot faster, but its gona take me day or two to figure out what the code is doing as there are some new things in it.

ashneet 0 Junior Poster

sorry for the late reply.

Instead of me copying and pasting my code here, i have put it in a zip file.

I am using microsoft visual c# express and a newb coder so I dont comment my code much.

ashneet 0 Junior Poster

That helps a little but it does not work on files which are less then a KB.

it speeds up the program but by very little like a minute or 30s difference.

any more suggestions would be nice.

ashneet 0 Junior Poster

I made a small program which will encrypt my files using xor encryption method.

It work but to encrypt 11MB file it take like 20 mins.

any suggestions on how to make it faster would be nice.

This is the function that encrypt (this is a thread):

publicvoid encrypt()
{
int let = 0;
long length;
this.go = true;
FileStream fopen = new FileStream(this.open, FileMode.Open);
FileStream fsave = new FileStream(this.save, FileMode.OpenOrCreate);
length = fopen.Length;
progressBar.Invoke((MethodInvoker)delegate
{
progressBar.Maximum = Convert.ToInt32(length);
});
while (length > fopen.Position && this.go == true)
{
if (this.password.Length != let)
{
fsave.WriteByte(Convert.ToByte(fopen.ReadByte() ^ this.password[let]));
progressBar.Invoke((MethodInvoker)delegate
{
progressBar.Value++;
});
let++;
}
else
{
let = 0;
}
}
fopen.Dispose();
fopen.Close();
fsave.Dispose();
fsave.Close();
if (this.go == false)
{
File.Delete(this.save);
}
 
}

and this function also decrypts the file you encrypt.

ashneet 0 Junior Poster

That helps a lot. I think i can make this program even better if I start to use threads.

ashneet 0 Junior Poster

Thanks for the quick reply. I will take your advice make a cancel button instead of clicking anywhere but, I have no idea on how to use Thread. I was researching on how to use them but I only got confused.

This is a really newb quest but how exactly do threads work.

ashneet 0 Junior Poster

I am new at c# so i am not even sure if this is possible.

This application i am making is a win app and its purpose is to make xor encrypted file.

when i try to encrypt large file it takes long time so i am trying to make the program to ask user if he or she wants to continue when they click anywhere on the program.

this is the function which i want to pause when someone click anywhere on the program:

private bool encryptt()
       {
           int let = 0;
           long length;
           fl.go = true;
           FileStream open = new FileStream(fl.open, FileMode.Open);
           FileStream save = new FileStream(fl.save, FileMode.OpenOrCreate);
           length = open.Length;
           this.enc_progressbar.Maximum = Convert.ToInt32(open.Length);
           while(length > open.Position && fl.go == true)
           {
               if (fl.key.Length != let)
               {
                   save.WriteByte(Convert.ToByte(open.ReadByte() ^ fl.key[let]));
                   this.enc_progressbar.Value++;
                   let++;
               }
               else
               {
                   let = 0;
               }
               while (fl.pause == true) ;
           }
           open.Close();
           open.Dispose();
           save.Close();
           save.Dispose();
           if(fl.go == true)
           {
               return true;
           }
           else
           {
               File.Delete(fl.save);
               return false;
           }
       }

basically i want this code to be activated while the function above is active:

if (fl.go == true)
           {
               fl.pause = true;
               DialogResult d = MessageBox.Show("Did you want to cancel this process.", "Stop Process", MessageBoxButtons.YesNo);
               if (d == DialogResult.Yes)
               {
                   fl.go = false;
               }
           }

if u need any information on what the code above is doing please ask me.

ashneet 0 Junior Poster

Thanks I will try that too.

ashneet 0 Junior Poster

Thanks A lot.
That worked really nice.
I never really understood JOIN commands, even if i read the books for SQL they only comfused me more LOL.

ashneet 0 Junior Poster

Well i need to make a program which would display a certain string in a triangle form in the middle of the console something like this:

t
   eee
  sssss
   ttttttt

it wont display right here but i think you get the point.

I am somewhat able to do that but i need to slow the display so that it looks like it is a triangle and want to be able to run it for as long as possible as this program is just for show...

using System;
class test {
     //Creating global variables
     protected static int orix;
     protected static int oriy;
 
     //Function to print string in diffrent areas
     protected static void echo(string s, int x, int y) {
      try {
       Console.SetCursorPosition(orix+x, oriy+y);
          Console.Write(s);       
      }
      catch(ArgumentOutOfRangeException error) {
       Console.Clear();
         Console.WriteLine(error.Message);
      }
     }
 
     //MAIN PROGRAM
     static void Main()
      {
       string str = Console.ReadLine();
       int strlength = str.Length;//variable that keep string length
       int width = Console.WindowWidth, height = Console.WindowHeight;
 
       //check to see if string is exist
       if(strlength != 0) {
        Console.Clear();
        orix = Console.CursorTop;
        oriy = Console.CursorLeft;
 
        //check to see if the console width is 80 or set it
        if(width != 80) {
         Console.SetWindowSize(80, height);
        }
 
 
        int y = 0;
        while(true) {
        int hw = Console.WindowWidth/2;
        int halfway = hw;
        int ht = hw - strlength;
        int inc = 2;
        int incy = 0;
        int s = 1;
 
 
 
        for(int i=0;i<strlength;i++) {
         if(i == strlength-1) {
          inc = -2;
         }
 
         string stri = "";
         for(int n=0;n<s;n++) {
          stri += str[i];
         } …
ashneet 0 Junior Poster

Problem:
I have two tables and those two table have one field in common which is "S_ID"

first table have 2 fields:
"S_ID", "T_ID"
second table have these fields:
"S_ID", "First", "Last"
----------------------------------

What i want to do is that i need to extract the the field "S_ID" from the first table and order them by the field "Last" which is in the other table.

any one know how i can do that in one or 2 query.
Also I am using php.

ashneet 0 Junior Poster

well it kind of matters as who ever sees this info will have to know that if it was daytime saving or not when they view it but at this time I can go without it unless they say it is must.
I dont even know why there is daytime saving.