Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
hitwalker
Sells PC To Pay For Divorce


Joined:
Posts: 5661

PostPosted: Tue Nov 16, 2004 7:16 pm Reply with quote

Ok here's the story,
All the below should be a guestbook !
A very simple one but part of a bigger script im trying to setup.
I cannot contact the creator of it cause i dont know who it was...

anyway this is the table......

Code:


CREATE TABLE `reacties` (
  `ID` int(7) NOT NULL auto_increment,
  `naam` varchar(50) NOT NULL default '',
  `email` varchar(50) NOT NULL default '',
  `titel` varchar(50) NOT NULL default '',
  `reactie` varchar(50) NOT NULL default '',
  `ip` varchar(10) NOT NULL default '',
  `host` varchar(50) NOT NULL default '',
  `now` varchar(50) NOT NULL default '',
  PRIMARY KEY  (`ID`)
) TYPE=MyISAM AUTO_INCREMENT=2 ;




This part i put together looking at a sample so im not sure if i did this right.....


The next larger part is the whole actual code....
THERE ISNT ANYTHING MORE !
So the database file connect.php is included in the copde so the connection should be ok....
But for some reason it doesnt post .
But there arent any errors also....
So can someone have a look and tell me if this should work or not or if there's something missing......

Note: some parts of include and java kick me out scripts are changed..... Razz


Code:


<link rel="stylesheet" type="text/css" href="stylesheet.css">
</HEAD>
<CENTER>
<BODY marginwidth=0 marginheight=0 topmargin=0 leftmargin=5>

<table width=727 background="../img/blokjes-back.gif" height=400 cellspacing=0 cellpadding=10 border=0>
<TR>
<TD valign=top>
include("menu.php")
</TD>
<TD valign=top>
   <table bgcolor="#1C5F7C" cellspacing=1 cellpadding=3 border=0>
   <TR>
   <TD width=500>
   <span class='kop'>
   <font size="+2">
   Gastenboek...
   </TD>
   </TR>
   <TR>
   <TD width=500 bgcolor='#EDEDED'>
   <span class='text'>
   Dit is het gastenboek.<BR>
       </TD>
   </TR>
   </TABLE>
    <BR>
<table bgcolor="#1C5F7C" cellspacing=0 cellpadding=0 border=0 width=503>
 <?php

 if($submit=="verstuur")
{
    ## checken op gevuldheid
   
    if($naam=="" || $reactie=="")
    {
        die("wel wat invullen he.......");
    }




   if(strlen($naam)>20)
   {
      $alles="niet ok";
   }
   if(strlen($email)>50)
   {
      $alles="niet ok";
   }
   if(strlen($titel)>50)
   {
      $alles="niet ok";
   }
   if(strlen($reactie)>500)
   {
      $alles="niet ok";
   }

    if($alles=="niet ok")
    {
        echo "
             Oops something went wrong.....try again....
             ";
        die();
             
}
    if($alles!="niet ok");
    {
        include("connect.php");
        $naam=strip_tags($naam);
        $email=strip_tags($email);
        $titel=strip_tags($titel);
        $reactie=strip_tags($reactie);
        $ip=$REMOTE_ADDR;

        ## zoek naam op bij andere lui
        $bestand=file("http://cc-www.uia.ac.be/cgi-bin/nslookup-query?hostname=".$ip);
        $deel=strstr($bestand[6], "pointer ");
        $host=substr($deel, 8);
        ## einde zoek ding
       

        ## ip vergelijken met de laatste en de een na laatste
           $ip_opzoek_query="SELECT ip FROM reacties ORDER By id DESC LIMIT 2";
           $result=mysql_query($ip_opzoek_query);
           $teller=1;
           while ($uitkomst_ip = mysql_fetch_array($result))
           {
              if($uitkomst_ip[ip]==$ip)
              {
                  $check[$teller]=1;
                  $teller++;
              }
           }
           if($check[1]==1 && $check[2]==1)
           {
               die("Je hebt al teveel geluld");
           }
         ## einde ip vergelijking
       
        $now=date("Y-m-d H:i:s");
       
      ## invoeren
        $query="INSERT INTO reacties (naam, email, titel, reactie, ip, host, datum) VALUES ('".$naam."' ,'".$email."', '".$titel."', '".$reactie."', '".$ip."', '".$host."', '".$now."')";
        $uitkomst =mysql_query($query);
        echo "<span class='text'>ok je ding is verstuurd..... wacht ff
            </TD>
           </TR>
           ";
        echo "
           script language='javascript'>
           setTimeout(\"document.location.href='guestbook.php'\", 3000)
           <script
            ";
         die();
     } ## einde als $alles!="niet ok"
}  ## einde if $submit==verstuur




if($submit!="verstuur")
{

      include connect.php
     
      $query="SELECT * FROM reacties ORDER BY id DESC LIMIT 35";
      $result=mysql_query($query);
      while ($row = mysql_fetch_array($result))
      {

             ## stuk om date en tijd te preppen



           $datetime=explode(" ", $row[datum]);
           $datum=$datetime[0];
           $tijd=$datetime[1];
            ## einde date stuk
     
             ## om reactie met <BR>'s te vullen


        echo"

          <TR>
         <TD width=503><span class='kop'><a href='mailto:".$row[email]."'>&nbsp;<span class='kop'>".$row[naam]."</a></TD>
         </TR>
         <TR>
         <TD width=503>

               <table width=503 bgcolor='#1C5F7C' cellspacing=1 cellpadding=1>
        <TR>
                    <TD bgcolor='#EDEDED' width=70 valign='top'>
                        <span class='text'><center>".$datum."<BR>".$tijd."</center>
                    </TD>
                    <TD bgcolor='#EDEDED' width=427 valign='top'>
                      <span class='text' ><B>&nbsp;".$row[titel]."</b><BR>&nbsp;".$row[reactie]."</span>
                        <BR><BR>
</TD></tr></TABLE></TD></TR>";
       

      }    ## einde while


      echo "
      </TABLE>
      </TD>
       </TR>
        <tr>
         <td>&nbsp;</td>
          <td>

              <form name='form1' action='guestbook.php' method='post'>
               <table bgcolor='#1C5F7C' cellspacing=1 cellpadding=0 border=0>
                     <TR>
                     <TD width=500>
                     <span class='kop'>
                     <font size='+2'>
                    Bericht toevoegen
                    </TD>
                       </TR>
                       <TR>
                       <TD width=500 bgcolor='#EDEDED'>
                       <span class='text'>
                       &nbsp;Hieronder kunt u uw eigen bericht toevoegen.


                    <table width=505 bgcolor='#EDEDED' cellspacing=0 cellpadding=0 border=0>
    <TR>
      <TD bgcolor='#EDEDED' width=70 valign='top'> <span class='text'>&nbsp;Naam:<BR>
      </td>
      <TD bgcolor='#EDEDED' width=427 valign='top'>
        <input type='text' name='naam' class='text' size=40>
      </td>
      &nbsp; </tr>
    <TR>
      <TD bgcolor='#EDEDED' width=70 valign='top'> <span class='text'>&nbsp;email:<BR>
      </td>
      <TD bgcolor='#EDEDED' width=427 valign='top'>
        <input type='text' name='email' class='text' size=40>
      </td>
      &nbsp; </tr>
    <TR>
      <TD bgcolor='#EDEDED' width=70 valign='top'> <span class='text'>&nbsp;titel
        bericht:<BR>
      </td>
      <TD bgcolor='#EDEDED' width=427 valign='top'>
        <input type='text' name='titel' class='text' size=40>
      </td>
      &nbsp; </tr>
    <TR>
      <TD bgcolor='#EDEDED' width=70 valign='top'> <span class='text'>&nbsp;bericht:<BR>
      </td>
      <TD bgcolor='#EDEDED' width=427 valign='top'>
        <textarea name='reactie' class='text' cols=42 rows=5></textarea>
      </td>
      &nbsp; </tr>
    <tr>
      <TD bgcolor='#EDEDED' width=427 valign='top'>
        &nbsp;<input type='submit' name='submit' value='verstuur'>
      </td>
  </table>


               </form>

   </TD>
   </TR>
   </TABLE>

   ";

}   ## einde als niet verstuur

?>


 </td>
 </tr>
</TABLE>
<table cellspacing=0 cellpadding=0 border=0>
<TR>
<TD colspan=2>
include bottom.php
</TD>
</TR>
</TABLE>
 
View user's profile Send private message
hitwalker
PostPosted: Fri Nov 19, 2004 9:53 am Reply with quote

wauw ....the respons is overwelming....
whats the use raven ....is nobody even responds in 2 days ?
It is solved because of other helpfull people and some hard work by myself but in 2 days no respons is very low ....even for this forum....
 
southern
Client


Joined: Jan 29, 2004
Posts: 591
Location: Texas

PostPosted: Fri Nov 19, 2004 9:26 pm Reply with quote

Hey I was busy with my life! Glad you solved it...it seems to be pure html, I'd try putting php brackets around the include(menu.php)
as in
Code:


<?php include(menu.php) ?>

and
Code:


<?php include(connect.php) ?>

if you didn't have it solved already. Smile
 
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number
hitwalker
PostPosted: Sat Nov 20, 2004 4:49 am Reply with quote

yes like i wrote its solved.
and thanks for responding but ....ehh..."brackets around the include?"
Like i wrote ......"some parts of include and java kick me out scripts are changed..."
All was ok but took that out because posting the parts wasnt accepted first...
Anyway like i said its solved.....this is like a newest century forum.....wait with any help........people might solve it themself..
but i also have a busy life,a private life and a thousand other things i do....
 
southern
PostPosted: Sat Nov 20, 2004 10:27 am Reply with quote

I know, man, I spoke only in jest- not to imply you don't have a busy life too. Smile As I said I'm glad you got it solved.
 
fury
Worker
Worker


Joined: Sep 09, 2003
Posts: 165

PostPosted: Sat Nov 20, 2004 11:59 am Reply with quote

My opinion is when you come to someone elses site to ask for help and you speak the way you do, it shows disrespect for the people that you asking to help you. I for one would be reluctant to help you in the future.
 
View user's profile Send private message
hitwalker
PostPosted: Sat Nov 20, 2004 1:17 pm Reply with quote

its no disrespect......its just being honest.
yeah being honest can be scary but it feels good...
and you dont have to help me in the future my dear fury,your not helping anyway so i wont miss a thing....
have a nice day..
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©