richieking 44 Master Poster

Just format your lines well that is \n will do. and you can count your lines by reading one line after the other with increment operator.

If you are happy, you leave a comment ;)

richieking 44 Master Poster

John if the user enter the whole stuff, its still easy. ;)

you split them into various variables and do the check like as if they entered one after one after the other.

print " fooo bar fooo";
$line=<>;
($fo,$bar,$loo)= split(m/ /,$line);

you got what you need to check.

richieking 44 Master Poster

Why dont you ask for the details one after the other?

print "Please enter Record number\n"
$record=<>;
check if the number is in range, if not, ( print "please enter record number\n"; again.

2. if all good. you ask for the second and the third.
once you got all, you can print the record or record them where ever you want.

That is if you intend to take input from a CMD line. Try and ask for info one after the other.

;)

richieking 44 Master Poster

Also i think you must have data to cross check with user inputs. thats is

Record 19 Chicago myfile 25.

It can be a \t delimitered file or a DB.

I dont really get what you want but we will get there.

richieking 44 Master Poster

on line 17, please provide the full file path.

if (! -e "/home/foo/$filepath") # That is if the file check is not in the same cwd.
Also re arrange your code as the logic does not flow well.

The recording part. do you intend to record to a plain file or a DB?

Advice ;)

richieking 44 Master Poster

Well on brother ;)

richieking 44 Master Poster

yes . Ryan311,

Please check the upload code i gave you.
The option and how to delete is there.

;)

richieking 44 Master Poster

Thats easy.

You must have a file to write append your entered data.

Once you quit, You read the size, print 2,3,4lines from the file.

That is any entered input by the user is stored append to the file.

Simple ;)

richieking 44 Master Poster

Because when you upload 10000000000 files with the same name.
You will see and have Only 1 file.

They will over write each other. They must be distinct file names to keep all.

;)

richieking 44 Master Poster
#!/usr/bin/perl -w 
        use IO::Socket; 
        use Net::hostent;              # for OO version of gethostbyaddr 
        $PORT = 9000;

        $server = IO::Socket::INET->new( Proto     => 'tcp',
                                         LocalPort => $PORT,
                                         Listen    => 5,
                                         Reuse     => 1) or die "can't setup server" unless $server;

    print "SERVER Waiting for client connection on port 9000\n";

         while ($client = $server->accept()) {
          $client->autoflush(1);
      print $client "Welcome. Sim is ready.\n";
      print $client "Use 'HELP' for help.\n";
      print $client "Enter the Command:";           
          while ( <$client>) {
            if    (/quit|exit/i)            { exit; }                                     
                                                                                         ########################
                                                                                         ## I DONT SEE ANY FILE READING TO||FROM
            elsif (/"Record 19 Chicago myfile 25"/i ) { print  $client "Recording \n"; } ## ARE YOU READING TO FILE ????
                                                                                         ## IT SEEMS THAT YOU ARE INTERACTING ON SCREEN AND ##SAVING  TO FILE YES?
                                                                                         ########################  
            elsif (/help/i) {                           
              print $client "Command: Record priority location filename time \n"; } 
        else
            { print $client "Command is not supported. \n";}
          } continue { 
             print $client "Command? "; 
          } 
          close $client; 
        }
richieking 44 Master Poster

perl is for nuts!
got so many little tricks. ;)

anyway your code looks very clean ;)

mmm. your appreciation sir.....


;)

mark your query as closed.

richieking 44 Master Poster

Look speak to your hosting company. They are the best to help you. ;)

richieking 44 Master Poster

Check if your DB was connected.

The Link to the DB server was not established.

1. You must connect to your mysql server with your hostname, uername, password.

Do that first . ::)

richieking 44 Master Poster

Mark post as closed ;)

richieking 44 Master Poster

sleep 1 ; # one second

richieking 44 Master Poster

Can you at least post any code ???

What have you done so far ??

;)

richieking 44 Master Poster

Ha ha ha .....

dont quit. Keep on, dont give up. When you get the logic of programming, the rest is easy.
You can do this buddy ;)

richieking 44 Master Poster

At least post what you have ok?

some code will you ;)

richieking 44 Master Poster

Hi Nail,

You are using a check that works only on digits/numbers.
Try and use this.

if ($auth ne "Admin"){
 print "foo";

}

This should work ok?

Have fun ;)

richieking 44 Master Poster

i have a problem in moving a file to my root folder. i try to upload same file. only 1 file put in my root folder.

Ryam311,
root folder as /home/ryan311 ???

What OS?. linux?

If you need system root....
You will need root permission. Php can not give you root perm.

richieking 44 Master Poster

ryan311

hi ritchie i have something to ask, in this line

if (mysql_query($query)){
// You DELETE the file You Uploade.
unlink("uploads/$goodFile");
}

it means delete the file in the path?

that is if you want to delete the file just uploaded because you wish to store that in your DB. It is just an option.

richieking 44 Master Poster

ryan311,

My problem is the file is save on the database not on the path. i want it to transfer into upload file folder.

because if the file save in my dbase it get bigger and slowly to retrieve. i have only 1 question richie, is it possible to change the dbase all i want to save is the name, description of the file and the date user upload the file? i want to add name textbox and description textbox.

You can add any data you want about the file into the DB. No limit. Yes its a good practise to save the path into your database and put the file in its folder on your server. This means you must have the folder created during the whole show. This means your script create one folder per user.

i have 1 more to ask

how can i limit each user to 50mb storage space to their upload?

i mean the total storage of all files upload.

thanks ^^,.

Yes you can do that. a piece of cake. you create the folder as i indicated for each user, have the folder name, folder size field in your DB.
During the upload, you check with ...

1. if the folder exist, if not, you create the folder and save the path to the folder into a variable for future use.
2. If the User already got a folder, you run a query to check if the size …

richieking 44 Master Poster

What error do you receive, ??? and what exactly do you need.??

The multi upload script i wrote you can upload any number of files you need.

Why dont you build on it?

richieking 44 Master Poster

do you want to store the chat in database or plain file?

richieking 44 Master Poster

o hell no,

I dont remember the last time i used microsoft stuff.

why dont you simply use wamp or xamp.??
well thats your taste. if you care to, just google wamp or xamp and start developing. They are better for php my friend ;)

richieking 44 Master Poster

your server is not setup well. This got nothing to do with your mysql stuff.

Did you play around with the apache2 conf or the php ini? ????

need more info :)

richieking 44 Master Poster

Look i will give you a free hosting space for a year if you want.

richieking 44 Master Poster

$HTTP_SESSION_VAR was deprecated in php 4.1.0 by $_SESSION.

mschroeder,

Are you sure about what TheSecOrg needs?
He need session to work on php2. That means http_session_var is what he needs.

He is on php2. my friend ;)

richieking 44 Master Poster

Are you sure???

post your php ini file please?

richieking 44 Master Poster

And also try to read your variables like this..


my $d=param('foo') to check with post and
my $d=uri_param('foo') with get.

debugging stuff ;)

richieking 44 Master Poster

If you're interested in learning Perl for Web apps, the easiest way to do it is to install Wampserver or Apache and Activestate Perl on your machine - Wampserver is an all-in-one with Apache, Perl, PHP and MySQL packaged with it. There are some other servers out there but I personally like Apache.

you cant get a better advice these days like that for free ;)

richieking 44 Master Poster

just normal session start method,
abd letter use that instead of $_SESSION ok?

hope it help ;)

richieking 44 Master Poster

use this old global array

$HTTP_SESSION_VARS['foo']

This is the old php session array.
This will help you ;)

richieking 44 Master Poster

Apache have a very limited permission to execute programs to affect the system directly.

Please post your code. :)

richieking 44 Master Poster

3 Hours Ago
This post is useful and well-written 0 This post is unclear
Re: PHP 'Public' variables?
So what's wrong with my code?

TheSecOrg post your code again if any. Just cant go back on that.

Roll that sir please. ;)

richieking 44 Master Poster

look i tried to help you, the best you did was to flag me bad post because of basic platform i asked you.

mmm ;)

richieking 44 Master Poster

You error must be very simple only i cant understand what you really want.

// select from city

$query= "select city_id from city where( you know what you want)";
//exe query

$result=mysql_query($query) or die();
$row=mysql_fetch_array($rsult));
$city_id=$row['city_id'];
    // then insert into location
if($city_id){
$q= "insert into location values('','$location_nane','$city_id')";
$re=mysql_query($q) or die (mysql_error());
if($re){
echo "roger that";
}
}

this should be out last contact skyhawk 67.
roger that ;)

richieking 44 Master Poster

populate at least some few data in your tables that you query.

if they are empty, you will get no data out.

Do what i told you and post all errors if any.

richieking 44 Master Poster

please get this for me.

1. what is your database engine or type. eg ms sql, mysql, oracle, etc.

2. did you received any errors of any kind.??
a.if yes, post the error
b. if no, make sure you have data in the database for your query.

please advice. ;)

richieking 44 Master Poster

it has always been the case.

locals are always faster. :)

thanks buddy ;)

richieking 44 Master Poster

you must set password for your mysql connection.

example:

$host="localhost";
$user="root";
$pass="SeKr1t";

mysql_connect($host,$user,$pass); // You need a password set ok?

thats all ;)

richieking 44 Master Poster

Well that is his only chance.

doom or gloom :)

ha ha ;)

No other way out my good friend. :)

richieking 44 Master Poster

$query = "INSERT INTO location (loc_id, city_id,loc_city) VALUES('$l_id',(SELECT city_id FROM city WHERE city_id = '$city_id'),'$location')";

Why dont you try simple select query to get the city_id and then insert into location table,

That should work ok? ;)

I also want to see your error mysql prints;

richieking 44 Master Poster

You are welcome good friend :)

richieking 44 Master Poster

There are so many way to cross the river.

Its there something wrong with a different way??

I dont get you?

Yep, that is why they are in double quotes.
Thats the kill friend ;)

richieking 44 Master Poster

This is wrong when you have constants declare with the same name. the concepts is, why do you declare constants using small letters?

If there is no constants declared, no issues.

Note that it is inside a system quote.

$foo="$ba[dd] $s[de]";

They become a string and are passed in a special way.
However with ' ' quote inside that also works the same. This technique takes the concatenation away.

No errors suppressed. try it yourself on your server and put all error report on.

i always have them on.

Explore ;)

richieking 44 Master Poster

watch this simple steps.

$foo="Delete from foo where file_path='$fPath' and name='$name'";
$d= mysql_query($foo);

if($d){
unlink("/path to file/$fPath");
}

you get the idea? :)

richieking 44 Master Poster

i Think its cool.

Just @ the header
@header.

IE will try to mess-up without it on xp sp1.

richieking 44 Master Poster

Hi friend,

Your job is done. be happy :)

<?php

$html[0] = " 1 Full, Gen. 3 TMSWK2D 9 Poor write quality"; 
$html[1] = "2 Full, Gen. 1 TMSWK2C  Read Only, Clean Tape";


$take =preg_split("/\ /", $html[0]);
for($n=0;$n<count($take);$n++){ 
print($take[$n]);
echo "<br/>";
}

?>

Just cut and paste.
 Explore ;)
richieking 44 Master Poster

You need javascript or Ajax my friend ;)