wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
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.
-
Wow! Thats is pretty awesome.
-
Need help retrieving mysql data with " and ' in the value
wildteen88 replied to kts's topic in PHP Coding Help
Woops, You're right. Ignore my post. -
: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
-
Need help retrieving mysql data with " and ' in the value
wildteen88 replied to kts's topic in PHP Coding Help
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. -
[SOLVED] Passing A SQL Var Into A Funtion
wildteen88 replied to phpretard's topic in PHP Coding Help
No a function is defined using function function_name(/*... parameters here ...*/) { // code here } -
[SOLVED] Passing A SQL Var Into A Funtion
wildteen88 replied to phpretard's topic in PHP Coding Help
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'; -
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
-
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; }
-
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.
-
Whats happening in pblock.php?
-
The best place is always the manual (NOTE: scroll down to the Ternary Operator section).
-
changing the php being used in apache2
wildteen88 replied to sss000_007's topic in Apache HTTP Server
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. -
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
-
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'; } ?>
-
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.
-
Woops, add a semi-colon ( ; ) at the end of this line include "database.php"
-
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>'; } } ?>
-
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>
-
[SOLVED] PHP - Limit number of else if's?
wildteen88 replied to grahamb314's topic in PHP Coding Help
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>"; } -
[SOLVED] Creating a function to return more than 1 variable
wildteen88 replied to chris_2001's topic in PHP Coding Help
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; -
[SOLVED] Setting environmental variables windows Vista
wildteen88 replied to peranha's topic in Miscellaneous
You should add the Java Bin folder to the PATH (System Variable) instead. Ensure you restart Vista after changes. -
PHP will not require "authentication" to access password protected directories. Unless you're requesting the mp3 file via the http:// protocol.