![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
only one
-
Posts
437 -
Joined
-
Last visited
Never
Posts posted by only one
-
-
oh i see,
make a new table in youre database, now on the upload page sotre the infromation, like the link (most important) now just give a link just echo all the links and you can return the urls
mysql_query("INSERT INTO table(`url`) VALUES('uploads/".$HTTP_POST_FILES[file name][file type]."')");
edit bold bits
-
doesnt work :-\
look try this
<?
$memyear = 2002;
$memday = 93;
$year = date("Y");
$yearsold = $year - $memyear;
$day = date("z");
$days = $memday - $day;
$daysold = 365 - $days;
if($daysold > $days){
$year = date("Y") - 1;
$yearsold = $year - $memyear;
}
echo "$daysold: $yearsold";
?>
today is the 95th day, its returning that ive been registerd for 367 days and 4 years, should be 5 years and 2 days...
-
ooo never thought of that,
thx btw, i need it too
-
im gonna try it out myself, il get back to you when i get it working
-
$year = date("Y");
$yearsold = $year - $mem[year];
$day = date("z");
$daysold = $mem[day] - $day;
if($daysold<0){
$year = date("Y") - 1;
$daysold = $mem[day] - $day + 365;
}
lmao i dont even know how many days there are in a year
-
lol
it should be a capital Y soz
$year = date("Y");
-
mysql_connect (host, username, password);
mysql_select_db(database) or die('Could not connect to the Database');
your host is usually localhost
-
does it have to be /picture1 or can it be picture.php?id=1...
-
<table width="200" border="1">
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
already have googled it...
-
<tr><td> </td></tr>
you cant open a table row without a column
-
echo "<th></th>";
echo "<th></th>";
echo "<th></th>";
stf is a th?
its td....
echo "<td></td>";
echo "<td></td>";
echo "<td></td>";
-
figured it..
$year = date("y");
$yearsold = $year - registerdyear;
$day = date("z");
$daysold = dayregisterd - $day;
if(daysold<0){
$year = date("y") - 1;
$daysold = dayregisterd - $day + 360;
}
hope it works, ive never tried this before
-
hm, youve now got me cofused :-\, ill get back to you when i figure it
-
-
just echo the <image src=source height='the set height' width='the set width'>
resizing an image is done by GD(i dont know much about GD
check out: for some tutorials
-
from what i can see youve got: $_SESSION['username'] not $_SESSION['s_username']
-
if your website is on GMT this would be alot easyer...
check http://nl2.php.net/date for your time and date functions
its simply a matter of minusing or ading an extra hour to GMT
like
if(perosntimezone==gmt+1)
$hour = date(H) + 1;
now theres gonna be the triky bit,
its when your servers on the 23 hour.. if you add 1 then it becomes 24:00 not 00:00
so if($hour>23){
$hour=00;
-
if(whateveritis==NULL){ }else{ do something.. }
or
if(!whateveritis==NULL){ do something }
or
if(!whateveritis){ }else{ do something.. }
-
oh, you have full control of it.. post your problem here
-
here you go, make a new feild in your users table
<?php $date = date("YmdHi"); $info = mysql_query("SELECT * FROM usertable WHERE lastactive>$date"); // edit this $r = mysql_fetch_array($info); $number = mysql_num_rows($info); echo "users active in last 15 minutes:$number<br /><br />$r['username']"; ?>
to update it:
<?php $lastactive = date("YmdHi") + 15; mysql_query("UPDATE usertable SET lastactive='$lastactive' WHERE username = '$user'"); ?>
using this date format date("YmdHi") will return a number like 200704052048(YearMonthDayHourMinute)
all the numbers have leading zeros like say its 1am it comes up as 01 and if its 1pm it comes up as 13.., this means that you can never return a number thats less only greater, when you add 15 it ads on an extra 15... the only problem is if its 5 minutes and you add an extr 15 it will go up to 74, not the next hour, this means everytime the hour changes the last active gets wiped
-
$username=$_SESSION['s_username'];
$password=$_SESSION['s_password'];etc...
-
ive got an upload script
<?php $path = "uploads/"; if (!isset($HTTP_POST_FILES['userfile'])){ echo " <FORM ENCTYPE=multipart/form-data ACTION=?page=Upload METHOD=POST> <p>The file:<br> <INPUT TYPE=file NAME=userfile style='border: 1px solid #222222; background-color: #111111; color: #888888'> </p> Name: <br><input type=text name=name size=25 style='border: 1px solid #222222; background-color: #111111; color: #888888'> <p> Descritption:<br> <textarea cols=25 name=description style='border: 1px solid #222222; background-color: #111111; color: #888888'></textarea> </p> <p> <INPUT TYPE=submit VALUE=Upload style='border: 1px solid #222222; background-color: #111111; color: #888888'> </p> </FORM> "; }else{ if($name==NULL){ echo "<font color=red>Error!</font>: Please give you image a name<br><FORM ENCTYPE=multipart/form-data ACTION=?page=Upload METHOD=POST> <p>The file:<br> <INPUT TYPE=file NAME=userfile style='border: 1px solid #222222; background-color: #111111; color: #888888'> </p> Name: <br><input type=text name=name size=25 style='border: 1px solid #222222; background-color: #111111; color: #888888'> <p> Descritption:<br> <textarea cols=25' name=description style='border: 1px solid #222222; background-color: #111111; color: #888888'></textarea> </p> <p> <INPUT TYPE=submit VALUE=Upload style='border: 1px solid #222222; background-color: #111111; color: #888888'> </p> </FORM>"; }else{ if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) { if (($HTTP_POST_FILES['userfile']['type']=="image/gif") || ($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/jpeg")) { if (file_exists($path . $HTTP_POST_FILES['userfile']['name'])) { echo "The file already exists, try calling your file a different name.<br>"; }else{ $res = copy($HTTP_POST_FILES['userfile']['tmp_name'], $path . $HTTP_POST_FILES['userfile']['name']); if (!$res) { echo "upload failed!<br>"; exit; } else { echo "upload sucessful<br><br>"; } echo "File Name: ".$HTTP_POST_FILES['userfile']['name']."<br>"; echo "File Path: <a href=uploads/".$HTTP_POST_FILES['userfile']['name']." TARGET=_BLANK>uploads/".$HTTP_POST_FILES['userfile']['name']."</a><br>"; echo "File Size: ".$HTTP_POST_FILES['userfile']['size']." bytes<br>"; echo "File Type: ".$HTTP_POST_FILES['userfile']['type']."<br>"; echo "<img src=uploads/".$HTTP_POST_FILES['userfile']['name']."><br>"; //edit this for your database mysql_query("INSERT INTO table(`sender`, `type`, `name`, `description`, `url`) VALUES('$user','img','$name','$description','uploads/".$HTTP_POST_FILES[userfile][name]."')"); }}}}} ?>
this code has all you want i think... only thing is if you have one image called something and someone else tries to upload another one with the same name it wont work...
dont forget to make a folder called uploads, must be in the same directorie as the page where the files get uploaded
-
its your webhosts problem.... write a complaint
-
then how can i get javascript to echo php? everytime i try it shows the code, it doesnt actually proccess it
user 'd.o.b'
in PHP Coding Help
Posted
lol nope