![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
zq29
-
Posts
2,752 -
Joined
-
Last visited
-
Days Won
1
Posts posted by zq29
-
-
You could run it through rsort() afterwards to sort the array in reverse.
-
[!--quoteo(post=377017:date=May 25 2006, 02:48 PM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ May 25 2006, 02:48 PM) [snapback]377017[/snapback][/div][div class=\'quotemain\'][!--quotec--]
prismatic - script does not work. it does not update the progress bar. whatsoever. but (surprise!) it does say it's all done... when it's all done.
p.s.- "omg, I have this strictly PHP progress bar script... but I didn't make it so if it doesn't work.. don't ask support on it!"
... right. you either have a script that works, or you don't.
I was interested in seeing a working script. Even AFTER i had to do much debugging and tweaking just to make it do it's core job - actually xfering file in question - it still does not do what it's supposed to on the surface - showing a progress bar that updates (yeh i didn't see THAT one coming).
[/quote]
And it doesn't actually do what the user originally wanted anyway - To enable a user to upload a file and receive feedback on its progress. I'm sure a script like the one posted has its uses, transfering a file from one server to another, but I just can't think of one right now... -
Could you post up your code for the security features?
-
Change this:
<form action="php.php" method="$_POST" enctype="multipart/form-data">
To this:
<form action="php.php" method="post" enctype="multipart/form-data">
Change this:
$filename = $_GET["$imagename"];
To this:
$filename = $_FILES['imagename']['tmp_name']; -
You can parse a CSV file as easily as something like this:
[code]<?php
$contents = file("http://www.thewebsite.com/file.csv");
foreach($contents as $line) {
$line = explode(",",$line);
//$line is now an array of all of the fields in the current line in the csv.
}
?>[/code]
That code should point you in the right direction, might be worth checking out file functions in the php manual too.
As for running once a day, you'd need to set up a cron job (if using *NIX) or an entry in Scheduler (if using Win). -
Not strictly with PHP no. It can however be done with a mixture of HTML, PHP and JavaScript to create an illusion of a progress bar (i.e. the animated gif method), to get a true progress bar with a percentage and maybe even an upload speed, you'd need something like AJAX or asp.net I guess.
-
What do you mean by "comes to a halt"? Does it give you any error messages? It shouldn't have a problem with assigning the value "<?php" to a variable...
-
There's a class called JPGraph that is excellent for this, and straight forward to use.
You can get the current date with the date() function, and it's possible to grab the users browser with $_SERVER['HTTP_USER_AGENT'] although this doesn't work with [i]all[/i] browsers, but does with the most common ones, so you should be ok. -
You're assigning your files temp name to a variable called $uploadedfile but calling the variable $uploadfile everywhere else.
-
samshel makes a valid point, I didn't bother reading the rest of your code, I just jumped to the bit you was having a problem with. But yes, what is the reasoning behind re-validating?
-
Its quite hard to debug when we can't see the code! Fancy posting it up?
-
No, this can't be done with PHP unless you refresh the page. I'd recommend you go with JavaScript. Heres a little something to get you on your way...
[code]<input type="radio" name="member" value="yes" onclick="showfield('yes')"/> Member<br/>
<input type="radio" name="member" value="no" onclick="showfield('no')"/> Not Member<br/>
<input type="text" name="memberid" id="memberid" style="visibility:hidden;"/>
<script type="text/javascript">
function showfield(x) {
switch(x) {
case "yes":
document.getElementById("memberid").style.visibility = "visible";
break;
case "no":
document.getElementById("memberid").style.visibility = "hidden";
break;
}
}
</script>[/code] -
Unless you have register_globals switched on in your php.ini (which you shouldn't really), you'd need to use your session variable in your query:
[code]$results=mysql_query("SELECT * FROM $month WHERE Username='$_SESSION[Username]'");[/code] -
Please be aware that the PHP Newbie Help forum is for posting specific PHP coding problems, I have moved your topic to the PHP Installation forum.
-
Try this:
[code]<?php
function stringcomp($string1, $string2, $toup) {
$false = 0;
$ct = 0;
if($toup == 1) {
$string1 = strtoupper($string1);
$string2 = strtoupper($string2);
}
if(strlen($string1) <> strlen($string2))
return 0;
while($ct < strlen($string1)) {
if(ord(substr($string1, $ct, 1)) !== ord(substr($string2, $ct, 1)))
$false++;
$ct++;
}
if($false <> 0)
return 0;
else
return 1;
}
?>[/code]I moved the closing bracket on your while.
I don't understand why you have gone to so much trouble though, surely this would do the same thing...
[code]<?php
function stringcomp($string1, $string2, $toup) {
if($toup == 1) {
$string1 = strtoupper($string1);
$string2 = strtoupper($string2);
}
if($string1 !== $string2)
return 0;
else
return 1;
}
?>[/code] -
Maybe you could post up some code? I run a test with the following code and everything appears to work fine, is this how you're doing it?
[code]<?php
$h = fopen("new.php","wb")
fwrite($h,"<?php\r\n phpinfo()\r\n ?>")
fclose($h)
include "new.php"
?>[/code]
Please Note: I have not included the semi-colons on the end of the the functions, there is a forum bug that prevents this. -
Just a simple if/else should do the trick:
[code]<?php
if(isset($_SESSION['username'])) {
echo "Logout";
} else {
echo "Login";
}
?>[/code] -
[a href=\"http://www.regular-expressions.info\" target=\"_blank\"]http://www.regular-expressions.info[/a]
-
Thanks for the link Ober, interesting stuff. Although, something to consider is your target audience, this can make a difference - If you're designing a site about computer games, it's very likely that the target audience will generally be running their res over 1024x768. In the other direction, if it's a news site, it could be anyone viewing it and therefore 800x600 is probably a fair consideration.
Personally, I say screw them. The more sites that are built for a minimum of 1024x768, the better the chance these users will upgrade their equipment and get with the times (I mean come on, 800x600 was considered crap 5+ years ago), and then we can all be happy to disregard the need to design for 800x600. Everyone's a winner. -
Meta refresh?
[code]<meta http-equiv="refresh" content="0;url=login_success.php">[/code] -
I'm moving this topic to out Misc forum - Please be aware that the PHP Help forum is for requesting help with specific problems you are having with scripts that you are developing.
-
Please be aware that the PHP Help forum is for requesting help with scripts that you are writing, not for general questions, so I'll move this over to our Misc forum.
With regards to your question, I personally don't really design things for a minimum of 800x600 any more. I've stepped my minimum up to 1024x768, I'd expect the 800x600 number are dropping by the day by now. I think you can grab the users screen resolution with a bit of JavaScript, although I can't remember what it is off the top of my head. -
You're calling $titel before it has been defined, you need to create, or assign a variable a value before you can use it.
You can't assign an include to a variable either. You could set your variable to a value and then decide what to display depending on that variable.
[code]<?php
if(isset($_GET['game'])) {
$titel = $_GET['game'];
// $content = "";
if(isset($_GET['server'])) {
$titel = $_GET['game']." ".$_GET['server'];
// $content = "";
if(isset($_GET['amount'])) {
$titel = $_GET['game']." ".$_GET['server']." ".$_GET['amount'];
// $content = "";
}
}
} else {
$titel = "News";
$content = "news.php";
}
if(!empty($content)) include $content;
echo "<div class=\"content\">\n";
echo " <div class=\"title\">";
echo $titel.":";
echo "</div>\n";
echo " <div class=\"text\">\n";
echo "</div></div>";
echo "</body>\n";
echo "</html>\n";
?>[/code] -
[code]<?php
include (isset($_GET['page']) && !strpos($_GET['page'],".")) ? $_GET['page'].".php" : default.php;
?>[/code]
print_r()
in PHP Coding Help
Posted
[code]<?php
echo "<pre>";
print_r($array);
echo "</pre>";
?>[/code]