alen
-
Posts
64 -
Joined
-
Last visited
Never
Posts posted by alen
-
-
I'm trying to setup apache2 with an old version php. But there's this one error that I can't seem to figure out.
httpd.exe: Syntax error on line 486 of C:/Server/apache/conf/httpd.conf: Cannot load C:/Server/php/sapi/php4apache2.dll into server: The module could not be found.
I'm 110% certain that php4apache2.dll is in that directory. What could be wrong?
-
Thanks, both of you.
-
No one?
-
Could you show me an example? Thanks!
I'm new to this
-
I made this simple guestbook script which stores everything in a file. I would have used a sql database, but I don't have one. Anyway .. I need to sort the entries. The newest entry comes first.
You can find my script at;
http://anigma.sitees.com/Guestbook/index.phps
http://anigma.sitees.com/Guestbook/lagre.phps (lagre=save)
and you can test my script here;
http://anigma.sitees.com/Gjestebok/index.php
Any idea on what I can do? I know how to sort it with MySQL, but I think it's not quite the same.
-
<?php error_reporting(0); $filnavn = $_GET['var']; $filendelse = '.php'; if (!$filnavn) { $filnavn = 'default'; } $filnavn = 'include'; if (file_exists($filnavn)) { include $filnavn . $filendelse; } else { include "404.php"; } if (!eregi("^((.*)/)", $filnavn)) { include $filnavn . $filendelse; } else { include "404.php"; } ?>
This must be wrong. Couldn't you just help me out a little. Give me a jumpstart?
-
What about this,
<?php error_reporting(0); $filnavn = $_GET['var']; $filendelse = '.php'; if (!$filnavn) { $filnavn = 'default'; } if (!eregi("^((.*)/)", $filnavn)) { include $filnavn . $filendelse; } else { include "404.php"; } ?>
It works fine, but when I go to index.php?var=unknownpage I doesn't include 404.php.
How can I use file_exists() here? I use if (!eregi("^((.*)/)", $filnavn)) so people can't access other folders.
-
This is my include script:
<?PHP $incpath = "include"; $default = "index"; $getarray = "side"; $filendelse = "php"; if (isset($_GET[$getarray])) { include_once ("$incpath/".$_GET[$getarray].".$filendelse"); } else { include_once ("$incpath/$default.$filendelse"); } ?>
It works like this, I have a index.php file in the include folder and a index.php file in the public_html folder. When I enter localhost I get the content of index.php in the include folder since index.php in the public_html folder includes the index file in the include folder. And I have some other links in the include folder too, and I can easily change to another link with http://localhost/index.php?id=name - But let's say I don't have a file named hello.php in the include folder. How can I make the script automatically open a file called 404.php then?
Best regards
Your friendly neighbour Alen!
-
I'm so stupid.
I'm sorry for all the troubles, but I figured it out.
Thanks for the effort.
-
Nevermind the id then, index.php?side=test&side=whatever - This takes me to not the test page, but the whatever page.
-
Hi there!
I have this simple include script,
<?PHP $incpath = "include"; $default = "index"; $getarray = "side"; $filendelse = "php"; if (isset($_GET[$getarray])) { include_once ("$incpath/".$_GET[$getarray].".$filendelse"); } else { include_once ("$incpath/$default.$filendelse"); } ?>
Well, you can probably see what it does. The links are as simple as this, index.php?side=page - how can I make it be something like this, index.php?side=test&id=whatever or something like that... How can I play with this script? Are there any guides or something on the net which explains include basics? And I donæt mean php.net
-
How can I make a php page redirect to another website after.. let's say 3 seconds?
Best regards
alen -
sorry about that...
http://anigma.sitees.com/Default.phps -
I have this include script... But I don't know why I keep getting this up:
Notice: Undefined index: id in C:\home\usr\haslum\Default.php on line 7
What should I do? -
It didn't actually do what I wanted to.. But here's my solution:
[code]
<?
error_reporting(E_ALL ^ E_NOTICE);
mysql_connect("localhost","nancy","blabla");
mysql_select_db("nancy");
if(!isset($_GET["cmd"]))
{
$result = mysql_query("select * from news order by id");
while($r=mysql_fetch_array($result))
{
$title=$r["title"];
$id=$r["id"];
echo "<p>endre nyheter:</p>";
echo "<a href='edit.php?cmd=edit&id=$id'>$title</a><br/>";
}
}
?>
<?
if($_GET["cmd"]=="edit" || $_POST["cmd"]=="edit")
{
if (!isset($_POST["submit"]))
{
$id = $_GET["id"];
$sql = "SELECT * FROM news WHERE id=$id";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
?>
<form action="edit.php" method="post">
<table>
<tr>
<td>tittel:</td>
<td><input type="text" name="title" value="<?php echo $myrow["title"] ?>" size='40'></td>
</tr>
<tr>
<td>forfatter:</td>
<td><input type="text" name="author" value="<?php echo $myrow["author"] ?>" size='40'></td>
</tr>
<tr>
<td>tekst:</td>
<td><textarea name="news" cols='30' rows='5'><? echo $myrow["news"] ?></textarea></td>
</tr>
<tr>
<td></td><br>
<td><input type="hidden" name="cmd" value="edit"><input type="submit" name="submit" value="endre"></td>
</tr>
</table>
</form>
<? } ?>
<?
if ($_POST["submit"])
{
$title = $_POST["title"];
$news = $_POST["news"];
$author = $_POST["author"];
$sql = "UPDATE news SET title='$title',news='$news',author='$author' WHERE id=$id";
$result = mysql_query($sql);
echo "query finished.";
}
}
?>
[/code]
It works fine. But when I echo "query finished", I can see the "endre nyheter" and the link to the news item. I want query finished. to come on a own page. How would I manage to do that?
-
nevermind I fixed it.
-
now i just get:
Parse error: parse error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\Program Files\Server\public_html\news\edit.php on line 10 -
i made a code that's supposed to update the news when i submit.
here is the structure of the code, http://anigma.sitees.com/edit.txt
when i enter the "endre" button, it only returns to the main edit.php site.
what's wrong here? -
i got rid of the errors..
-
sorry about that, i'm removing the time field.
-
changed the passwords :)
-
it doesn't actually matter since it's just a random password on my localhost.
-
should I just get rid of the errors with adding:
error_reporting(E_ALL ^ E_NOTICE); -
I keep getting an error I can't get rid of:
Notice: Undefined index: submit in C:\Program Files\Server\public_html\news\add.php on line 12
and here's my code:
http://anigma.sitees.com/add.txt
Apache 2.2.4 with PHP 4.4.2
in Apache HTTP Server
Posted
A quick question; what mysql version should I use with Apache2.0.x and PHP4?