Jump to content

alen

Members
  • Posts

    64
  • Joined

  • Last visited

    Never

Everything posted by alen

  1. A quick question; what mysql version should I use with Apache2.0.x and PHP4?
  2. 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?
  3. Could you show me an example? Thanks! I'm new to this
  4. 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.
  5. alen

    Include

    <?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?
  6. alen

    Include

    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.
  7. alen

    Include

    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!
  8. I'm so stupid. I'm sorry for all the troubles, but I figured it out. Thanks for the effort.
  9. Nevermind the id then, index.php?side=test&side=whatever - This takes me to not the test page, but the whatever page.
  10. 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
  11. How can I make a php page redirect to another website after.. let's say 3 seconds? Best regards alen
  12. sorry about that... http://anigma.sitees.com/Default.phps
  13. 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?
  14. 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?
  15. nevermind I fixed it.
  16. 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
  17. 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?
  18. i got rid of the errors..
  19. sorry about that, i'm removing the time field.
  20. changed the passwords :)
  21. it doesn't actually matter since it's just a random password on my localhost.
  22. should I just get rid of the errors with adding: error_reporting(E_ALL ^ E_NOTICE);
  23. 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
×
×
  • 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.