why isnt this working=????

hey!

can anyone tell me why my little shoutbox (http://aspfreeserver.com/formatc/sb.php) displays all kind of errors? if you need the code its here for download:
http://home.arcor.de/dannielreds/sb.php
(arcor doensnt support php so it will simply download to the hard drive)
please explain it in an easy way as i just started with php ;)
thanx a lot for help!
«1

Comments

  • hmm,

    if (!file_exists(${dataFile}))

    i'd replace this with

    if (!file_exists($dataFile))

    im not sure this is the problem. But those { } around datafile is something i've NEVER seen before so it might be wrong. It also says that undefined constant.. It could be that $dataFile is not a valid variable at all, it does not exist.



    : hey!
    :
    : can anyone tell me why my little shoutbox (http://aspfreeserver.com/formatc/sb.php) displays all kind of errors? if you need the code its here for download:
    : http://home.arcor.de/dannielreds/sb.php
    : (arcor doensnt support php so it will simply download to the hard drive)
    : please explain it in an easy way as i just started with php ;)
    : thanx a lot for help!
    :

    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    url--> http://space.servehttp.com (ssh,ftp,http,smtp,jabber etc etc)

  • hey!

    well i removed the {} stuff and its still not working on the server, but it works fine when i test it offline... and what does that "undefined index: admin" or "undefuned index: message" ... mean? i know that those are the things that are read from the dataFile thing (although the e-mail field is hidden), the admin thing is the textfield where you input a new admin password and so on... i'll upload the original file without my modifications to see if it works...
  • http://aspfreeserver.com/formatc/guestbooktest.php, still not working, so it must be a server problem?? sry i really dont know what to do
  • ic that i was misled the previous time i looked at your code. The line numbers just don't match with the original that u use.

    there can be a parse error @ line 513 that comes from lines above. but not an index error.

    my 513 =

    if (!isset($admin))
    {
    // assin

    the { = 513 :-D

    so it comes down to these llines of code:
    $name=$HTTP_POST_VARS["name"];
    $email=$HTTP_POST_VARS["email"];
    $message=$HTTP_POST_VARS["message"];
    if (!isset($name)) { $name=""; $message=""; }
    if ($name=="" || $message=="")

    yes, ic the problem

    with register_globals off you need this:

    $name = $_POST['name'];

    must solve THIS problem



    : http://aspfreeserver.com/formatc/guestbooktest.php, still not working, so it must be a server problem?? sry i really dont know what to do
    :

    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    url--> http://space.servehttp.com (ssh,ftp,http,smtp,jabber etc etc)

  • [b][red]This message was edited by daniel rojas at 2003-9-22 16:57:16[/red][/b][hr]
    hey!

    well thanx but it still doesnt work :(
    http://aspfreeserver.com/formatc/sb.php
    i replaced every $http_post_vars with $_POST and still have problems

    but at least someone kinda understands whats going on! ;)

    {edit}: what i really dont understand is the last error, something with header information or what


  • Bah, an index error. Kinda hard for me because i've never encountered an index error before. Anyway, your last error is caused by raising the previous error. When the index problem is solved. the other will leave to...

    index error.. bah

    : [b][red]This message was edited by daniel rojas at 2003-9-22 16:57:16[/red][/b][hr]
    : hey!
    :
    : well thanx but it still doesnt work :(
    : http://aspfreeserver.com/formatc/sb.php
    : i replaced every $http_post_vars with $_POST and still have problems
    :
    : but at least someone kinda understands whats going on! ;)
    :
    : {edit}: what i really dont understand is the last error, something with header information or what
    :
    :
    :

    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    url--> http://space.servehttp.com (ssh,ftp,http,smtp,jabber etc etc)

  • have you turned safe-mode on? register_globals off? etc ? Are those post variables correct? do you really use the same name to send as to retrieve?

    your code looks fine

    : hey!
    :
    : can anyone tell me why my little shoutbox (http://aspfreeserver.com/formatc/sb.php) displays all kind of errors? if you need the code its here for download:
    : http://home.arcor.de/dannielreds/sb.php
    : (arcor doensnt support php so it will simply download to the hard drive)
    : please explain it in an easy way as i just started with php ;)
    : thanx a lot for help!
    :

    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    url--> http://space.servehttp.com (ssh,ftp,http,smtp,jabber etc etc)

  • : have you turned safe-mode on? register_globals off? etc ?

    well i think i cant do that on aspfreeserver.com... i dont know how its configured
    : Are those post variables correct?
    well, i replaced $http_post_vars with $_POST
    : do you really use the same name to send as to retrieve?
    whats that sorry
    or do you have an ABSOLUTELY SIMPLE GUESTBOOK CODE THAT YOU KNOW IT WORKS? IT ONLY NEEDS A FIELD FOR THE NAME AND ONE FOR THE MESSEGE. ADMIN FUNCTION NOT ABSOLUTELY NECESSARY, BUT IT WOULD MAKE THINGS EASIER...
    thanx
  • oh my, thats 30 minutes of work :D:D:D

    ill go to bed now and ill fix you a tiny guestbook tomorrow

    ABSOLUTELY SIMPLE GUESTBOOK CODE THAT YOU KNOW IT WORKS? IT ONLY NEEDS A FIELD FOR THE NAME AND ONE FOR THE MESSEGE. ADMIN FUNCTION NOT ABSOLUTELY NECESSARY, BUT IT WOULD MAKE THINGS EASIER...
    : thanx
    :

    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    url--> http://space.servehttp.com (ssh,ftp,http,smtp,jabber etc etc)

  • u need to modify things.. of course

    I am VERY SURE that the code is working properly. I hop your php settings or apache settings won't screw it up for you.

    make SQL table:

    CREATE TABLE `guestbook` (
    `ID` INT NOT NULL AUTO_INCREMENT ,
    `name` TEXT NOT NULL ,
    `content` TEXT NOT NULL ,
    PRIMARY KEY ( `ID` )
    );

    [code]
    <?php

    mysql_connect("localhost","mark","evilmark");
    mysql_select_db("mark");
    //mysql_connect("<server>","","");
    //mysql_select_db("");

    if ((isset($_POST['name'])) && (isset($_POST['content']))) {
    // Aha, someone posted a name and some content. Let's make some checks
    $name = $_POST['name'];
    $content = $_POST['content'];

    if ((strlen($name) < 4) or (strlen($name) > 20)) {
    echo 'Invalid name. Must be between 4 and 20 characters in length.';
    exit();
    }
    if ((strlen($content) < 10) or (strlen($content) > 255)) {
    echo 'Invalid content. Must be between 10 and 255 characters in length.';
    exit();
    }
    // We can check more but i won't. Let's asume it's ok and put it in the DB
    mysql_query("INSERT into guestbook (name,content) VALUES ('$name','$content')");
    }

    // Let's display the content of the guestbook here.

    $queryresult = mysql_query("SELECT * FROM guestbook");
    while ($buffer = mysql_fetch_array($queryresult)) {
    $name = $buffer['$name'];
    $content = $buffer['content'];

    echo "Signed by: $name
    $content

    ";
    }
    ?>

    add something to the guestbook here


    name:

    content:




    [/code]

    : oh my, thats 30 minutes of work :D:D:D
    :
    : ill go to bed now and ill fix you a tiny guestbook tomorrow
    :
    : ABSOLUTELY SIMPLE GUESTBOOK CODE THAT YOU KNOW IT WORKS? IT ONLY NEEDS A FIELD FOR THE NAME AND ONE FOR THE MESSEGE. ADMIN FUNCTION NOT ABSOLUTELY NECESSARY, BUT IT WOULD MAKE THINGS EASIER...
    : : thanx
    : :
    :
    : [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    : url--> http://space.servehttp.com (ssh,ftp,http,smtp,jabber etc etc)
    :
    :

    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    url--> http://space.servehttp.com (ssh,ftp,http,smtp,jabber etc etc)

  • hey!

    oh damn well thank you! that really is a SMALL gb! ;) the only problem is that theres an error with the password and i dont even know where that password can bne changeed (locally (localhost) and on aspfreeserver.com)!! :(
    but thanx a lot anyway now i know there are people who really know how to deal with php and mysql! :p
  • what do you mean, a problem with your password? Keep in mind that it's quite useful for, if we can see the error. Without any doubt, i can say that you just add the wrong password.

    Have you got a mysql database anyway???

    you mustnt forget to fill in YOUR username, password and database name in the first few lines of code. But it can only be done if your server has mysql. You also mustnt forget to use that query i gave you, to create the mysql table.

    i can't find any other problem.


    hey!
    :
    : oh damn well thank you! that really is a SMALL gb! ;) the only problem is that theres an error with the password and i dont even know where that password can bne changeed (locally (localhost) and on aspfreeserver.com)!! :(
    : but thanx a lot anyway now i know there are people who really know how to deal with php and mysql! :p
    :

    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    url--> http://space.servehttp.com (ssh,ftp,http,smtp,jabber etc etc)


  • Aspnet, the dotnet platform. vb.net, c# and more
    Microsoft Active Server Pages [asp] Scripting
    Ms Access Database
    PHP scripting and Perl for windows.
    FSO component- access, create, delete files on your folder

    well, it doesnt look like that youve got a mysql database. then you have a problem ;-) php usually works with mysql, it can use an ms access database as well IIRC. but code snippets ansd such are mysql stuff.

    perhaps find another server? :-D


    : what do you mean, a problem with your password? Keep in mind that it's quite useful for, if we can see the error. Without any doubt, i can say that you just add the wrong password.
    :
    : Have you got a mysql database anyway???
    :
    : you mustnt forget to fill in YOUR username, password and database name in the first few lines of code. But it can only be done if your server has mysql. You also mustnt forget to use that query i gave you, to create the mysql table.
    :
    : i can't find any other problem.
    :
    :
    : hey!
    : :
    : : oh damn well thank you! that really is a SMALL gb! ;) the only problem is that theres an error with the password and i dont even know where that password can bne changeed (locally (localhost) and on aspfreeserver.com)!! :(
    : : but thanx a lot anyway now i know there are people who really know how to deal with php and mysql! :p
    : :
    :
    : [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    : url--> http://space.servehttp.com (ssh,ftp,http,smtp,jabber etc etc)
    :
    :

    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    url--> http://space.servehttp.com (ssh,ftp,http,smtp,jabber etc etc)

  • hey!

    well thats funny then why do i have a db folder in my account??
    if i should change server, then itd be nice if u told me a good ohe with php mysql no ads at least 10megas and if possible htaccess... (if not htaccess id be interested ina password protection with php;))

    or maybe a guestbook without mysql? only php? i found some on the net but all produced errors!?

    or whats that filesystemobject thing? i heard it can be used with vb ( i know vb very good) so if anyone knows how to use it on a server i cpould make a vb guestbook... but i think it would only work with windows huh? thanx anyway... ;)
  • Sigh... You can make a guestbook by using files instead of mysql. Just a matter of replacing the mysql functions with fopen/ fgets and fputs.. No time now... gotta go

    : hey!
    :
    : well thats funny then why do i have a db folder in my account??
    : if i should change server, then itd be nice if u told me a good ohe with php mysql no ads at least 10megas and if possible htaccess... (if not htaccess id be interested ina password protection with php;))
    :
    : or maybe a guestbook without mysql? only php? i found some on the net but all produced errors!?
    :
    : or whats that filesystemobject thing? i heard it can be used with vb ( i know vb very good) so if anyone knows how to use it on a server i cpould make a vb guestbook... but i think it would only work with windows huh? thanx anyway... ;)
    :

    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    url--> http://space.servehttp.com (ssh,ftp,http,smtp,jabber etc etc)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories