Jump to content

boushley

Members
  • Posts

    41
  • Joined

  • Last visited

    Never

Everything posted by boushley

  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??? ???
  16. Well, if you can guarantee the naming convention will be the title like that... you can parse the title by using substrings to cut off the .avi. You could also write an array like this. $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' ) ); And then turn the printing into a function, and use something like this. foreach($files as $file){ printLinkRow($file); } That way you can reuse most of your code.
  17. You MySQL looks fine... In the php... you want to change this line... while($record = mysql_fetch_object($result)){ And you should see stuff start happening... the mysql_fetch_object functions wants a resource... not the text query.
  18. Well welcome to the world of PHP! Its great! You will find lots of answers to those questions by starting here http://us2.php.net/manual/en/ref.image.php(just went to php.net and typed in image... php.net is your friend) Now, all of those questions you asked are possible. You can filter by name, by file size... and with the correct libraries, even by image size (I believe... haven't done too much image manipulation with php). And I'm pretty sure the functions to resize a picture exist as well. (Actually I'm positive... but again, never used them before.) Now... that said... Probably the easiest way to code would be to filter by file size... but if you had a high resolution small picture... you might end up filtering it too. And having to name your files with 'lrg' can be annoying. So which one you choose is up to you. Off the top of my head I can show you what it would look like for the name one though while ($file = $imgs->read()){ if ( (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file)) && !eregi('^lrg', $file)) $imglist .= "$file "; } *woops forgot a ! (not) fixed*
  19. You said you know how to get the time in php... what are you doing to get the time? if you do something like <?php $hours = date(H); $minutes = date(i); $seconds = date(s); ?> and then echo each of those in their appropriate place. PS All of that came from... http://us3.php.net/manual/en/function.date.php Just went there and typed in time to the function search.
  20. So when someone comes to your site... you want the daily.php to run. Your problem is... that its in a different directory? Or is it that you don't understand how to include at all? (I doubt it... since you've been trying for two weeks) And do you want daily.php only to run once a day? You can include a file over http: or from basically anywhere on the local filesystem... where php has permissions.
  21. I'm not sure if this is a php issue... whats in the adminmain.php, cardsubmenu.php & add1Card.php?
  22. Wouldn't you want to check if $premonth is <= 0... I mean if you have a 12th month, then you can't have a 0th month.
  23. Well, for starters... its never getting inside your if statement... unless somewhere else you've declared Submit as a constant. Its should look like if($_POST['Submit']=="Submit") Also make sure that you have your capitalization correct (variable names are case sensitive). And if you'll check like this... if(isset($_POST['Submit'])) It won't throw a warning when its not set. Other than that it looks like the basic syntax is correct... although you may want to be wary when accepting data straight from the user without removing any malicious characters first.
  24. Yes... its possible. I'm sure there are some built in libraries for parsing through an html file... and you would open the url as if it were a file... with fopen for instance. So just use fopen(urlOfPage, 'r'); and then you can use it as if it was a text document on your local server. Can you do that part of it?... or do you need a little more help?
  25. So whats the problem... you have those keywords and everything integrated in already... The only thing I see... is that when you did this it should look like this... <?php $pgHeading="onlinemortgage101.com - Helping you to improve your web site"; $pgDesc="Helping millions Refinance home and get best mortgage loan rate quotes."; $pgKeywords="Refinance Home, Mortgage Loan, Mortgage lead, Internet Mortgage Lead Talk"; ?> <meta name="description" content="<?php echo $pgDesc ?>"></meta> <meta name="keywords" content="<?php echo $pgKeywords ?>"></meta> You never closed your php tag. And so the meta tags weren't being sent with the html...
×
×
  • 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.