Jump to content

boushley

Members
  • Posts

    41
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

boushley's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Vim is what I prefer. Had a college professor who made us do our first couple of projects in vim... and then we could use whatever we wanted... But took the time to learn it (and I only know a little) And its amazing! Especially with how many plugins there are to make it work exactly how you want. And on top of that... its free and has all the listed features... and its one of the fastest I've ever worked with. Vim all the way!
  2. Whats the exact error? What values are being passed in? Whats the table structure look like?
  3. Well for starters... the popup is being launched at this line <!-- Hide from older browsers alert("You are already logged in to the system!"); // end hiding --> And that is being run no matter what. There is no if statements anywhere around it... For what you're wanting... if you do this <!-- Hide from older browsers <?php if ($_SESSION['attempt_info'] == "authenticated"){ echo 'alert("You are already logged in to the system!");'; } ?> // end hiding --> And then remove the $msg2 = "alert()"; line from your elseif Also... I don't know what this accomplishes... <?php if (($_SESSION['attempt_info'] == "unauthenticated") || ($_SESSION['attempt_info'] == "first_attempt")) { ?> <?php } ?> Because nothing actually happens with that.
  4. You were right about the include... sorry I didn't think about what I was doing very well As for the parse error... I forgot another, LOL... I'm just messing those up all over today. <?php $files = array( array( 'file'=>'Abbot and Costello - Who\'s On First.avi', 'title'=>'Abbot and Costello- Who\'s on First', 'thumb'=>'wof_thumb.jpg' ), //forgot this comma array( 'file'=>'Abbot and Costello - Who\'s On First2.avi', 'title'=>'Abbot and Costello- Who\'s on First2', 'thumb'=>'wof_thumb2.jpg' ) ); function printLinkRow($file){ $message = "<tr><td>\n"; $message .= "<a href='humor_video_play.php?file=$file&title=$title'>\n<img border='0' src='$thumb_path/$thumb' width='$thumb_width' height='$thumb_height' alt=' '></a></td>\n"; $message .= "<td><a href='humor_video_play.php?file=$file&title=$title'>$title</a><br>\n"; $message .= "<a href='$file_path/$file'>download file</a> | file size: "; include("text_files/filesize.php"); //put this back in $message .= "$size<br>\n"; $message .= "duration : "; $message .= "$duration\n"; $message .= "</td></tr>\n"; return($message); } foreach($files as $file){ print(printLinkRow($file)); }
  5. They both look like they'll do the job... its just what you want to be done. The first one is much shorter and probably more effective... since its made to escape mysql specific things. Instead of just throwing slashes all over.
  6. Post the code where you've included it. We don't need to see the function... more the code where you've included it. And you know that inside of included files you need to use <?php & ?> right? AKA you function when its in an included file must be wrapped by php opening and closing tags.
  7. Well, you could pull the highest ID from the database using SORT DESC LIMIT 0, 1. And then if you do some calculating to figure out which page its on... divide total in thread by however many to a page... Then you can figure out what page its on... and as far as doing the page anchor... you said you can do those in your sleep
  8. Only certain things are sent when you submit a form. Usually input's, select boxes etc. Labels are not one of those things. You can add a hidden input like this <input type="hidden" name="section" value="My Section Name">
  9. Actually... I didn't realize the complexity of all those loops at first... if you do something like this after your three stacked closing brackets. if(!isset($plusvat)){ $plusvat = ''); }
  10. Well, from the notice it looks like the if if ($varname==$varvalue) where you set plustvat $plusvat=number_format($total*1.175,2); isn't being run... so when you get to outputting it... its not set yet. And so php is letting you know. If you put an else on there that set $plusvat=''; then you would eliminate that error
  11. SQL has the LIMIT function... you would want LIMIT 0, 249 (the first page...) then LIMIT 250, 499 (for the second page...) Then you'll only be pulling 250 records from the database... and php won't have to loop over them all.
  12. And for the lazy way... if you have access the the php.ini increase the max execution time. But PhREEEk's suggestion really would be the better. And can you not simply put a LIMIT 250 on you QUERY?
  13. I'm sure there's probably a more efficient way to do this... but this will get the job done.
  14. Yes there should be LOL... good catch. And I guess you could do this foreach($files as $file){ printLinkRow($file); print "<tr><td>\n"; print "<a href='humor_video_play.php?file=$file&title=$title'>\n<img border='0' src='$thumb_path/$thumb' width='$thumb_width' height='$thumb_height' alt=' '></a></td>\n"; print "<td><a href='humor_video_play.php?file=$file&title=$title'>$title</a><br>\n"; print "<a href='$file_path/$file'>download file</a> | file size: "; include("text_files/filesize.php"); print "$size<br>\n"; print "duration : "; print "$duration\n"; print "</td></tr>\n"; } But I was suggesting something like this <?php include("text_files/filesize.php"); $files = array( array( 'file'=>'Abbot and Costello - Who\'s On First.avi', 'title'=>'Abbot and Costello- Who\'s on First', 'thumb'=>'wof_thumb.jpg' ) array( 'file'=>'Abbot and Costello - Who\'s On First2.avi', 'title'=>'Abbot and Costello- Who\'s on First2', 'thumb'=>'wof_thumb2.jpg' ) ); function printLinkRow($file){ $message = "<tr><td>\n"; $message .= "<a href='humor_video_play.php?file=$file&title=$title'>\n<img border='0' src='$thumb_path/$thumb' width='$thumb_width' height='$thumb_height' alt=' '></a></td>\n"; $message .= "<td><a href='humor_video_play.php?file=$file&title=$title'>$title</a><br>\n"; $message .= "<a href='$file_path/$file'>download file</a> | file size: "; //Note, you don't want to include this file over & over $message .= "$size<br>\n"; $message .= "duration : "; $message .= "$duration\n"; $message .= "</td></tr>\n"; return($message); } foreach($files as $file){ print(printLinkRow($file)); } P.S. Threw the backslashes in so that we didn't prematurely end the string. (Single quotes are a little faster since php doesn't try to parse through them looking for variables.
  15. So you want to subtract $x (which is a percent from ) $y. So if $x = 10 (assumed to be a percent) $y = 100 Then after the equation $y should equal 90? Is that what your going for? If this is the case... then $y = $y*($x/100) Or if you set $x=.10 then just $y = $y*$x Or are you looking for something that if you enter a percent or a non percent it still works? I'm kind of confused as to what you're looking for. Did that help? Is that what you're looking for??? ???
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.