Jump to content

btellez

Members
  • Posts

    43
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://www.htmlandphp.com

Profile Information

  • Gender
    Not Telling

btellez's Achievements

Newbie

Newbie (1/5)

0

Reputation

  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));>
×
×
  • 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.