|
did you consider googling PHP zip ?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
|
How can i take a menu made in javascript inside a particular column of a table ???
|
|
|
|
|
your question is not so clear. provide some code so that it can be answered.
|
|
|
|
|
I am going to presume you mean a html table made in php.
answer is just like you would in html.
If you have designed the code in html and have it working then to get the same results in php just echo or print the html + javascript.
for example if this:
<table><tr>
<td>
<script>
my_js_menu();
</script>
</td>
</tr></table>
works in an html page, then to get the same from a php page you can echo the html text of weave the php around the html.
inside php it would look like....
or weaving the php around the html would look like...
<table><tr>
<td>
<script>
my_js_menu();
</script>
</td>
</tr></table>
|
|
|
|
|
Hi!
I'm new to linux, and find it very interesting, I decide to learn linux ARM after days,could someone give me some advise,also introduce some good book,thanks!
modified on Sunday, January 31, 2010 7:10 PM
|
|
|
|
|
start by reading this[^] book which explains application programming in Linux. Also you need to learn vi editor and if you want to do GUI development then learn QT.
|
|
|
|
|
Himanshu Joshi / Black belt programmer wrote: Also you need to learn vi editor
That's a cruel thing to do to a newbie. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
|
Yeah, me to , I think we can study linux together! my OS is ubuntu
and my email is wbgjj@163.com
|
|
|
|
|
you can login to the www.verycd.com website,where you may find some books that you want.I have a book(Wiley Linux Bible 2010 Edition)!! 
|
|
|
|
|
Hi everybody!
1. I registered with google analysis already. This tool help me to report visitors and so on...
2.I im finished my site at http://soft-overtime.com
3.I verified this site with google successfully(sitemap and meta tag).
When i point these bellow items(in googleWebmaster tools), no data available.
# Your site on the web
* Top search queries
* Links to your site
* Keywords
* Internal links
* Subscriber stats
I've got some question:
1. How can i do to let google know which keywords users searched on my site.
The same question for others Items.
Thanks !
|
|
|
|
|
1. Set page encoding (UTF-8)
2. The text page should be about 5-7% of your keywords.
3. Apply with <strong> these keywords
4. If your site is new, it is in the sandbox Google - must wait until released from the sandbox.
Take these simple steps and you will get an answer to many of your questions.
More information - html tutorials
|
|
|
|
|
hey, ok its going to take some time for some data to arrive such as links, search terms etc, also on the right hand side of the webmaster tools page you can change the time range from 7days to dec, jan etc.
|
|
|
|
|
Okay, I tried using W3Schools to "UPDATE" a timestamp, upon logging in, here is my code:
$sql = mysql_query('UPDATE `DBNAME`.`TABLENAME` SET `lastactive` = NOW() WHERE `TABLENAME`.`username` = $username ;');
Here is the login code:
if(isset($_POST['login'])){
$username= trim($_POST['username']);
$password = trim(md5($_POST['password']));
if($username == NULL OR $password == NULL){
$final_report.="Please complete all the fields below..";
}else{
$check_user_data = mysql_query("SELECT * FROM `members` WHERE `username` = '$username'") or die(mysql_error());
if(mysql_num_rows($check_user_data) == 0){
$final_report.="The username that you submitted does not exist..";
}else{
$get_user_data = mysql_fetch_array($check_user_data);
if($get_user_data['password'] == $password){
$start_idsess = $_SESSION['username'] = "".$get_user_data['username']."";
$start_passsess = $_SESSION['password'] = "".$get_user_data['password']."";
That is the code above the timestamp issue. The page loads and everything, it just doesn't update it into the database... Please Help. Thanks!
|
|
|
|
|
The user name will be a text string, so you need to enclose it in quotes:
$sql = mysql_query("UPDATE members SET lastactive=NOW() WHERE username='$username'");
I've also replaced the DBNAME and TABLENAME with the actual name of your table, and replaced the single quotes around the SQL string with double quotes so that $username will be expanded.
Also, instead of:
$password = trim(md5($_POST['password']));
you probably want:
$password = md5(trim($_POST['password']));
- an MD5 hash won't have any spaces in it, but the password you pass to it might.
|
|
|
|
|
You are still not sanitizing your data inputs, to protect you from SQL Injection Attacks[^]. Use: mysql_real_escape_string[^]
thebiostyle wrote: "".$get_user_data['username'].""
That does nothing useful. You don't need the empty strings either side, they do nothing, just have the variable.
thebiostyle wrote: $start_passsess = $_SESSION['password'] = "".$get_user_data['password']."";
Are you sure you want to keep the hashed password as a session variable?
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
I need to determine, for an events scheduling app, what days in the future are... As an example, someone may want to schedule an event for Sat, Jan. 30th, 2010, and every Saturday for the following 8 weeks... Got the rest of it working, just need a way to take an input field of "20100130", feed it into "perl date routine" and add to/loop thru to get my dates...
I've looked around, seems like date::manip has what I want, but I'm not sure I'll be able to get that installed... does anyone know of a way to do this with "localtime"? I have searched extensively, can't find any instances of parms fed to localtime EXCEPT when it's adding time to today, etc... I need to first establish my date, by converting it from an input field, then adding to the result... sounds pretty simple, but I am not getting anywhere...
and I'd be fine with a reference to read, if I've missed something... please forgive the clutter to this great board if I missed this somewhere....
thanks
M. Holliday
|
|
|
|
|
Try POSIX::mktime() - you can use that to turn dates and times into a time_t , then add N weeks worth of seconds and turn it back using localtime() .
|
|
|
|
|
I have to do program, that must do something like this: you enter position of sector as argument and result of this must be info of this sector and it must show if any file is part of it, if yes, which file/s? This could be solved with bash right? And i must do this for Reiserfs which is probably similar as bash-programming for ext2/3? Please can you give me few hints how to make this?
Thanks in advance
|
|
|
|
|
Aljaz111 wrote: This could be solved with bash right
I doubt it, I'd guess that you need something kernel level to find out this sort of information. You can still look for some command to do it (here[^] or here[^]) but I doubt you'll find one.
Aljaz111 wrote: bash-programming for ext2/3
Bash is file system agnostic. It works the same on all FSs.
|
|
|
|
|
Hi,
I am trying to create a perl date difference script. I would like to put the date2 from a file and put it
into an array. Then find the difference between that day and today. Here is what i got (it dont work). Please help.
#!/usr/bin/perl
# date calculator
use Date::Calc qw(Delta_Days check_date);
open (DATEFILE, "date.txt")|| die "couldn't open the file!";
@date2 = <datefile>;
close DATAFILE;
open (TODAYFILE, "today.txt") || die "couldn't open the file";
@today = <todayfile>;
print @today;
print "\n" ;
print @date2;
print "\n";
$difference = Delta_Days(@today, @date2);
print "There are $difference days before password expires\n";
close TODAYFILE;
|
|
|
|
|
Do you have to read in today's date from a file?
iirc if you do
$date = Date::EzDate->new();
it would be able to give you today's date
|
|
|
|
|
This should work
#!/usr/bin/perl
# date calculator
use Date::Calc qw(Delta_Days check_date);
open (DATEFILE, "date.txt")|| die "couldn't open the file!";
@date2=<DATEFILE>;
close DATEFILE;
open (TODAYFILE, "today.txt") || die "couldn't open the file";
@today;
@today=<TODAYFILE>;
print @today;
print "\n";
print @date2;
print "\n";
$difference = Delta_Days(@today, @date2);
print "There are $difference days before password expires\n";
close TODAYFILE;
date.txt
2010
01
20
today.txt
2010
01
15
|
|
|
|
|
Thanks that works great.
Here is what i came up with.
#!/usr/bin/perl
use Date::Calc qw(Delta_Days);
use Time::Piece;
($sec, $min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
open (MYDATA, "data.txt") or die ("Error: cannot open file 'ARGV[0]'\n");
my @lines1 = <MYDATA>;
# chomp @lines1;
my $t = Time::Piece->strptime("@lines1",
"%b %d,%Y");
$year1 = $year + 1900;
$mon1 = $mon + 1;
$mday1 = $mday;
$year2 = ( $t->strftime("%Y"));
$mon2 = ( $t->strftime("%m"));
$mday2 = ( $t->strftime("%d"));
$difference = Delta_Days($year1, $mon1, $mday , $year2, $mon2, $mday2);
print "There were $difference days between Nat and Bree\n";
print "email user\n" if $difference <= 15;
data.txt
Jan 24, 2010
|
|
|
|