Jump to content

btellez

Members
  • Posts

    43
  • Joined

  • Last visited

Everything posted by btellez

  1. You can not send mail using the mail function after something has been sent to the browser... You need to call mail before you do any output... <?php /* process */ mail(/*appropriate parameters here*/); ?> <html> ......ect... See the PHP.net Documentation
  2. Does "dbcon.php" print anything? Are you at the very least getting the output you are expecting from PHP? also, you should probably ensure your enclosing your html attribute values in proper quotes to eliminate unexpected parsing of html attributes in your web browser... /* escaped double quotes inside your php double quotes*/ echo "<table border='1' id=\"hor-minimalist-a\" style=\"width:750px\"> <tr> <th>Jisne Diye</th> <th>Kisko diye</th> <th>Kitne Diye </th> <th>Details </th> </tr>"; for($i=0; $i<7; $i++) {for($j=0; $j<7; $j++) { if($arrm[$i][$j]!=0 && $arr[$i]!=$arr[$j]) { echo "<tr>"; echo "<td>" . $arr[$i] . "</td>"; echo "<td>" . $arr[$j] . "</td>"; echo "<td>" . $arrm[$i][$j] . "</td>"; echo "<td><a href=\"viewdet.php?user1=" . $arr[$i]. "&user2=".$arr[$j]."\">View Details </a></td>"; echo "</tr>"; echo '<br>'; } }} ?>
  3. When your script goes live(which i assume it will) you wont be using a localhost address....To test the part you write that writes the contents to a file you can use almost any url, or place a sample file file on a server, for sakes of testing you can use "http://www.phpfreaks.com/forums/index.php?board=1.0" and if the HTML from the page gets written to your file, then it will almost certainly work with other URL's you specify.... Or look into configuring virtual host on your local apache install.
  4. you can use explode to split up a string after a given character. $path = "uploads/thisImage.jpg"; $parts = explode('/', $path); $fileName = $parts[1]; // Or use this if your path is buried in deeper directories... // $fileName = $parts[count($parts)-1];
  5. As an example: When you load the page $username will equal '' (empty string) with your logic, $username != null, so the else is executed, '' /* Validating username field */ if($username != NULL) { /* Bunch of stuff in here*/ } else { echo "<p>Username cannot be Blank</p>"; } I think what you want is something like: /* Validating username field */ if (isset($_POST['submit'])){ // only execute inside if the form was submitted if ($username != NULL) { /* Bunch of stuff in here*/ } else { echo "<p>Username cannot be Blank</p>"; } /* Remaining form validation logic here...*/ }
  6. From what I can tell your just going one too far into your array. Undefined offset refers to your array. eg: Array with 6 elements, has elements numbered 0-5; /* change the comparison to continue while $i < $count, since the index is 1 less than the count...so...*/ for ($i = 0; $i <$count; $i++) { // setup the loop to stop iteration when $count is met echo '<pre><a href="' . $arr[$i] . '>' . $arr[$i] . '</a></pre>'; // Hopefully echo the link list back if all goes well... }
  7. Well what value do your variables hold ?
  8. Looks to me like you mean this: if ($row['kills'] >= 1 && $row['death'] >= 1){ $kdr = $row['kill']/$row['death']; } else { $kdr = '0'; }
  9. They are magic...They are used in object's to "automatically" add properties(class variables) on the fly. So if you don't need to define the variables in your class ahead of time if you define the magic method. The magic method is where you would define how your store your "dynamic variable"(for lack of better word). You would be able to access the property as if it were a public property of the class... Its more of an OOP topic....some of the OOP tutorials on PHPFreaks make mention of it but dont use it...
  10. After a quick google, It appears, the file uploads are allowed, but the file extension would be changed according to the rules you set in your htaccess file. So .php files would get a .nophp extension instead, this keeps them from being executed on the server. Does that aspect of the .htaccess work on your server??
  11. There's plenty of tutorials online to help you do this... here's a couple... http://www.devshed.com/c/a/PHP/Creating-a-Secure-PHP-Login-Script/ a newer one: http://frozenade.wordpress.com/2007/11/24/how-to-create-login-page-in-php-and-mysql-with-session/ If you have code you need help you can post it here...
  12. Here's some code, but why not just keep it in an array if I may ask... $offset = 1; for($count = 0; $count < count($image_all); $count++) { $varName = 'image'.($count + $offset); ${$varName} = $image_all[$count]; } echo $image1; echo $image2;
  13. that is just css thats being echoed. The result is: .. style="display:none;" ... that just keeps the html element from being displayed in your browser....
  14. It's the same as: style="<?php if($D->tabs_state['all']==0 || $D->tab=='all') echo'display:none;' ; ?>" php code is parsed inside the double quotes of the html
  15. ...because you are trying to echo an array. To get something more meaningful, try print_r or var_dump <?php print_r(Placeholders::find_placeholders($pageID)); ?> OR <?php var_dump(Placeholders::find_placeholders($pageID));>
  16. did you use include instead of require for download.php ? The behavior is very peculiar. Have you tried removing the white space between the doctype declaration and the closing php tag?(Kinda a long shot.) //...?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Also, have you tried copying download.php to a new file to try and get rid of any unwanted invisible characters. Also, the space is only visible in IE, top margin is offset by about 10px in Chrome (for me anyways...) so source is identical in chrome(unless you view through inspect element window).... I'm out of ideas on this one...
  17. Just to confirm: this a visual problem you are having, right? Not like an actual space right?
  18. The redir.php script works fine for me on my local php installation. Are there any odd .htaccess rules or anything of that sort that may be affecting the way your routing is getting handled?
  19. Your loop section looks disturbing, you are probably looking for something closer to the following, (if i'm guessing right) while($row = mysql_fetch_array($result)) { /* explode returns an array with your pieces, so assuming login time is split into 2 parts by the space, it should work(eg: "PARTA PARTB" or "MM/DD/YYYY HH:MM:SS") */ $timePieces = explode(" ",$row['logintime']); echo "<tr>"; echo "<td>" . $timePieces[0] . "</td>"; echo "<td>" . $timePieces[1] . "</td>"; echo "</tr>"; } As a side note you may want to look into loop syntax.
  20. Your problem is that you check to see if --- isset ($_POST['loginsubmit'])) --- and its always going to be false, if your not arriving at the page right after filling out the form.. you should have your script check to see if, $_SESSION['username'] or $_SESSION['loggedin'] are valid instead in order to display the login form or welcome message. so maybe something like this... if(isset ($_POST['loginsubmit'])) && !isset($_SESSION['loggedin'])){ /*Log in queries etc. here.*/ } else { /* echo login form here*/ } if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) { /* echo welcome message */ }
  21. Simply put something is outputing (echo() -ing) before the wp_redirect() function in pluggable.php is called. Did you edit any other files when this happened?
  22. echo '<a href="/u/'. $user_info["username"] .'"><img src="'. getUserAvatar($user_info['username']) .'" class="avatar f_left small" title="'. $user_info['display_name'] .'" alt="'.$user_info['display_name'].'" /></a>'; // OR echo '<a href="/u/', $user_info["username"], '"><img src="', getUserAvatar($user_info['username']), '" class="avatar f_left small" title="', $user_info['display_name'], '" alt="', $user_info['display_name'], '" /></a>'; // OR wrapped in double quotes... echo "<a href=\"/u/{$user_info["username"]}\"><img src=\"", getUserAvatar($user_info['username']), "\" class=\"avatar f_left small\" title=\"{$user_info['display_name']}\" alt=\"{$user_info['display_name']}\" /></a>"; Note: that the comas and the periods are not doing the same thing, even though the output may be the same. Although you can use single and double quotes, try to stick to one as your "outside" wrappers to minimize confusion.
  23. NetBeans and Programmers Notepad sometimes Notepad++
  24. I think this depends on what your looking for. I know CodeIgniter has some Shopping Cart Library to make it simpler to write a shopping cart into your site. CakePHP also has some add-on plugin you can add to it. You can create one using almost any framework. If your looking for a more complete, ready to go solution you may want to look into Magento - Feature Rich, but very resource intensive, and has a somewhat steep learning curve. There are others, but I don't have much experience with them. A couple are ZenCart, osCommerce. So you may want to decide what you need your shopping cart to do, then go from there? It's a paint to find out down the road that a feature you need is not readily available or easily implementable.
  25. decbin for decimal to binary...and it looks to work for hex conversion to. These worked out fine for me.. echo decbin(255); echo decbin(0xFF); echo decbin((int)0xFF); php.net show hex2bin available but im not sure it works...it didnt on my local php install.
×
×
  • 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.