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 ;)
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 ;)
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.
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.
;)
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.
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 ;)
Well on brother ;)
yes . Ryan311,
Please check the upload code i gave you.
The option and how to delete is there.
;)
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 ;)
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.
;)
#!/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;
}
perl is for nuts!
got so many little tricks. ;)
anyway your code looks very clean ;)
mmm. your appreciation sir.....
;)
mark your query as closed.
Look speak to your hosting company. They are the best to help you. ;)
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 . ::)
sleep 1 ; # one second
Can you at least post any code ???
What have you done so far ??
;)
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 ;)
At least post what you have ok?
some code will you ;)
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 ;)
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.
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.
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 …
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?
do you want to store the chat in database or plain file?
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 ;)
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 :)
Look i will give you a free hosting space for a year if you want.
$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 ;)
Are you sure???
post your php ini file please?
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 ;)
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 ;)
just normal session start method,
abd letter use that instead of $_SESSION ok?
hope it help ;)
use this old global array
$HTTP_SESSION_VARS['foo']
This is the old php session array.
This will help you ;)
Apache have a very limited permission to execute programs to affect the system directly.
Please post your code. :)
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. ;)
look i tried to help you, the best you did was to flag me bad post because of basic platform i asked you.
mmm ;)
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 ;)
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.
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. ;)
it has always been the case.
locals are always faster. :)
thanks buddy ;)
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 ;)
Well that is his only chance.
doom or gloom :)
ha ha ;)
No other way out my good friend. :)
$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;
You are welcome good friend :)
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 ;)
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 ;)
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? :)
i Think its cool.
Just @ the header
@header.
IE will try to mess-up without it on xp sp1.
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 ;)
You need javascript or Ajax my friend ;)