Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. Check that PHP is actually reading the php.ini in "c:\program files\php", you can do this by running phpinfo() Look for a line called Loaded Configuration File this should state the full path to the php.ini that PHP is reading for configuration. If its set to (none) then PHP is not reading any php.ini file. Also make sure whenever you edit the php.ini IIS will need to be restarted.
  2. Wow! Thats is pretty awesome.
  3. DarkWater and jonsjava quit the snide comments. If you've got nothing useful/helpful to say don't reply. I will lock this thread if any more snide comments arise. @Riseykins watch the language too.
  4. Don't know if any one noticed but the document root is in the error message! Try $path = "/home/fabu/public_html/layout/"; //// Server path to layout folder
  5. Woops, You're right. Ignore my post.
  6. :after is a type of pseudo-element. With an :after pseudo-element your browser will apply the defined CSS after an element (#main) has been displayed on the page. There is also a :before pseudo-class too, which is the opposite. Pseudo-element tutorial
  7. if it works with a textarea then it means before you was not coding your <input>'s correctly. The only way I see the problem you're having is if you don't wrap attribute values with quotes.
  8. No a function is defined using function function_name(/*... parameters here ...*/) { // code here }
  9. functions have their own variable scope, meaning variables defined outside of the function can not be used within it (and vice-versa ) In order to use a variable from outside of the function, either pass it the function via a parameter, or use the global the keyword (not recommended). examples: function a($var) { echo $var; } $var = 'Hello'; a($var); // 'Hello'; // OR function b() { global $var; echo $var; } $var = 'Hello'; b(); // 'Hello';
  10. Your first the pull whatever row you want to edit from the database, you'll place each column within a form field. When you submit the form you just run an UPDATE query, eg UPDATE TABLE `table_here` SET col1name=`$col1value`, col12name=`$col2value` etc WHERE row_id_col=$rowid
  11. The issue is to do with your css. I have cleaned it up (untested) body { font-family: Verdana, Geneva, Arial, helvetica, sans-serif; background: #365b77; font-size: 14px; margin: 0 auto; /* center the site design */ width: 1000px; } #header { margin: 0; width: 885px; height: 226px; } #main { background: #FFFFFF; width: 760px; margin-left: 51px; } #leftside, #rightside { padding: 5px; margin: 0; } #leftside { width:490px; float: left; } #rightside { width:240px; float: right; } /* the following clears the floats for the left and right columns http://www.positioniseverything.net/easyclearing.html Click the link above to understand this technique DO NOT MODIFY */ #main:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
  12. Technically PHP does not require an installer as such. Whenever installing PHP always download the zipped binaries package, once downloaded extract the contents of the zip to wherever you want PHP installed to. After you have extracted the contents of the zip you'll need to configure whatever HTTP server you're using.
  13. Whats happening in pblock.php?
  14. The best place is always the manual (NOTE: scroll down to the Ternary Operator section).
  15. When using PHP5 you need to use the following loadmodule line LoadModule php5_module "C:/php/php5apache2_2.dll"; Change C:/php to your actual PHP installation folder. Also I assume you're using Apache2.2.x, if you're using Apache 2.0.x then remove _2 from the loadModule line above.
  16. What version of PHP are you using? You should not be having any problems if you're using PHP5 . However you will get that error with PHP4. PHP4 has very limited OOP support. PHP4 does not support visibility keywords (public, private, protected) nor does it support magic function such as __construct
  17. Fixed your code, <?php include "database.php"; if(isset($_POST['base'])) { $tabs = $_POST["base"]; //display all the news $result = mysql_query("SELECY * FROM $tabs ORDER BY id"); //run the while loop that grabs all the news scripts while($r = mysql_fetch_array($result)) { //grab the title and the ID of the news $title = $r["title"];//take out the title $id = $r["id"];//take out the id $rob = $r["id"];//take out the id //make the title a link echo "<a href='editlinks.php?cmd=edit&id=$id&base=$tabs'>$title - Edit</a> | "; echo "<a href='editlinks.php?cmd=delete&id=$rob&base=$tabs'>DELETE</a>"; echo "<br>"; } } elseif(isset($_REQUEST["cmd"]) && $_REQUEST["cmd"] == "edit") { // perform the following when the form below is submitted if(isset($_POST['edit_update'])) { $id = $_POST["id"]; $title = $_POST["title"]; $time = $_POST["time"]; $date = $_POST["date"]; $message = $_POST["message"]; $tabs = $_POST["base"]; $sql = "UPDATE $tabs SET title='$title',time='$time',date='$date',article='$message', WHERE id=$id"; $result = mysql_query($sql) or die(mysql_error()); echo 'Table `'.$tabs.'` updated!'; } // form hasn't been submitted yet, display edit form else { $id = $_GET["id"]; $tabs = $_GET["base"]; $sql = "SELECT * FROM $tabs WHERE id=$id"; $result = mysql_query($sql); $myrow = mysql_fetch_array($result); ?> <form method="post"> <input type=hidden name="id" value="<?php echo $myrow["id"] ?>"> Title:<INPUT TYPE="TEXT" NAME="title" VALUE="<?php echo $myrow["head"] ?>" SIZE=30><br> Name:<INPUT TYPE="TEXT" NAME="name" VALUE="<?php echo $myrow["name"] ?>" SIZE=30><br> Time:<INPUT TYPE="TEXT" NAME="time" VALUE="<?php echo date("g:i a"); ?>" SIZE=30><br> Date:<INPUT TYPE="TEXT" NAME="date" VALUE="<?php echo date("M.j.y"); ?>" SIZE=30><br> Message:<br><TEXTAREA NAME="message" ROWS=15 COLS=40><?php echo $myrow["msg"] ?></TEXTAREA><br> <input type="hidden" name="cmd" value="edit"> <input type="hidden" name="base" value="<?php echo $base; ?>"> <input type="submit" name="edit_update" value="submit"> </form> <?php } } elseif(isset($_REQUEST["cmd"]) && $_REQUEST["cmd"] == "delete") { echo 'Perform delete action here'; } ?>
  18. It basically says Apaches wasn't able to boot due to port 80 not being available. Apache can be configured to use a different port if you so wish.
  19. Woops, add a semi-colon ( ; ) at the end of this line include "database.php"
  20. It is caused due to a logic error try <?php include "database.php" if(isset($_POST['base'])) { $tabs = $_POST["base"]; //display all the news $result = mysql_query("select * from $tabs order by id"); //run the while loop that grabs all the news scripts while($r = mysql_fetch_array($result)) { //grab the title and the ID of the news $title=$r["title"];//take out the title $id=$r["id"];//take out the id $rob=$r["id"];//take out the id //make the title a link echo "<a href='editlinks.php?cmd=edit&id=$id&base=$tabs'>$title - Edit</a> | "; echo "<a href='editlinks.php?cmd=delete&id=$rob&base=$tabs'>DELETE</a>"; echo "<br>"; } } elseif(isset($_REQUEST["cmd"]) && $_REQUEST["cmd"] == "edit") { if (!isset($_POST["submit"])) { $id = $_GET["id"]; $tabs = $_GET["base"]; $sql = "SELECT * FROM $tabs WHERE id=$id"; $result = mysql_query($sql); $myrow = mysql_fetch_array($result); ?> <form method="post"> <input type=hidden name="id" value="<?php echo $myrow["id"] ?>"> Title:<INPUT TYPE="TEXT" NAME="title" VALUE="<?php echo $myrow["head"] ?>" SIZE=30><br> Name:<INPUT TYPE="TEXT" NAME="name" VALUE="<?php echo $myrow["name"] ?>" SIZE=30><br> Time:<INPUT TYPE="TEXT" NAME="time" VALUE="<? echo date("g:i a"); ?>" SIZE=30><br> Date:<INPUT TYPE="TEXT" NAME="date" VALUE="<? echo date("M.j.y"); ?>" SIZE=30><br> Message:<br><TEXTAREA NAME="message" ROWS=15 COLS=40><? echo $myrow["msg"] ?></TEXTAREA><br> <input type="hidden" name="cmd" value="edit"> <input type="hidden" name="base" value="<?php echo $base; ?>"> <input type="submit" name="submit" value="submit"> </form> <?php } else { echo '<pre>' . print_r($_POST, true) . '</pre>'; } } ?>
  21. You cannot have any form of output before the use of session_start(). Change <html> <head> <?php session_start(); if (!$_SESSION['auth'] == 1) { // check if authentication was performed // else die with error die ("ERROR: You must be logged in to view this"); } ?> to <?php session_start(); if (!$_SESSION['auth'] == 1) { // check if authentication was performed // else die with error die ("ERROR: You must be logged in to view this"); } ?> html> <head>
  22. No there's no limit to the number of else if's Your may be better of using: if(isset($_POST['Day']) && trim($_POST['Day']) != '') { switch(strtolower($_POST['Day'])) { case 'monday': $_POST['Day2'] = 0; break; case 'tuesday': $_POST['Day2'] = 1; break; case 'wednesday': $_POST['Day2'] = 2; break; case 'thursday': $_POST['Day2'] = 3; break; case 'friday': $_POST['Day2'] = 4; break; case 'saturday': $_POST['Day2'] = 5; break; case 'sunday': $_POST['Day2'] = 6; break; } } else { $errorstatus = $errorstatus + 1; echo "<br><Strong>ERROR </Strong>"; echo $errorstatus . ':'; echo "<b>No Day entered</b>"; }
  23. They only way is to return an array. Example function test($table, $search, $value) { $query = "SELECT test1, test2, test3 FROM $table WHERE $search = '$value'"; $result = mysql_query($query); $row = mysql_fetch_array($result, MYSQL_ASSOC); return $row; } $row = test($table, $search, $value); echo $row['test1']; echo $row['test2']; echo $row['test3']; // or alternatively, but not recommended extract($row); echo $test1; echo $test2; echo $test3;
  24. You should add the Java Bin folder to the PATH (System Variable) instead. Ensure you restart Vista after changes.
  25. PHP will not require "authentication" to access password protected directories. Unless you're requesting the mp3 file via the http:// protocol.
×
×
  • 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.