Jump to content

inkzoid

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

About inkzoid

  • Birthday 01/01/1981

Contact Methods

  • Website URL
    http://www.inkzoid.com

Profile Information

  • Gender
    Male
  • Location
    North Bay, ON

inkzoid's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Firefox says when I click on gallery.php: The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. * This problem can sometimes be caused by disabling or refusing to accept cookies.
  2. Line 1 of gallery.php <?php header("Location: http://www.inkzoid.com/shoutbox/shout.php"); ?> Here's shoutbox/shout.php: <?php @session_start(); // calling session_start() the function which starts our authentication session // connecting to mysql server $l = mysql_connect ( "999.999.999.999" , "inkzoid" , "999" ) or die("Error connecting:<BR><BR>".mysql_error()); mysql_select_db( "inkzoid" ) or die("Error getting db:<BR><BR>".mysql_error()); // defining getShouts() which is our function that gets all of our shouts function getShouts() { echo '<div align="left"> <table width="800" bgcolor="#128911" border="0" cellspacing="0" cellpadding="0"> <tr> <td> '; $query = mysql_query("SELECT * FROM shouts ORDER BY id DESC LIMIT 10") or die(mysql_error()); while ($row = mysql_fetch_array($query) ) { //print_r($row); $name = stripslashes($row['name']); $contact = stripslashes($row['contact']); $shout = stripslashes($row['shout']); if(empty($contact)) { echo '<p><span class="author">'.$name.'</span> - <span class="shout">'.$shout.'</span></p>'; } else { echo '<p><span class="author"><a href="'.$contact.'" target="_blank">'.$name.'</a></span> - <span class="shout">'.$shout.'</span></p>'; } // if empty contact } // while row mysqlfetcharray query echo '<br><br>'; echo ' </td> </tr> <tr> <td height="10"> </td> <form name="shout" method="post" action="shout.php"> <div align="center"> <input name="name" type="text" id="name" value="Name" size="25" maxlength="10"><br> <input name="contact" type="text" id="contact" value="http://" size="25"><br> <input name="message" type="text" id="message" value="Message" size="25"><br> <input name="shout" type="submit" id="shout" value="Shout!"> </div> </form> </td> </tr> </table> </div> '; } // function getshouts // our processing if control statement if ( isset ( $_POST['shout'] ) ) { $name = addslashes($_POST['name']); $contact = addslashes($_POST['contact']); $message = $_POST['message']; if ( ( isset($name) ) && ( isset($message) ) ) { // getting smilie list $smilies = mysql_query("SELECT * FROM smilies") or die(mysql_error()); while($get = mysql_fetch_array ($smilies)) { $alt = $get['Alt']; $smilie = $get['URL']; $message = str_replace( $get['Symbol'] , '<img src="smilies/'.$smilie.'" border="0" width="15" height="15" alt="'.$alt.'">' , $message); $themessage = addslashes($message); // replacing all smilies } mysql_query("INSERT INTO shouts (name, contact, shout) VALUES ( '$name' , '$contact' , '$message' )") or die(mysql_error()); $_SESSION['has_posted'] = 'yes'; header("Location: http://www.inkzoid.com/shoutbox/shout.php"); // if required fields aren't empty, process into database } else { echo '<script>alert("Some fields were not filled out!");</script>'; header("Location: http://www.inkzoid.com/shoutbox/shout.php"); // if required fields were left empty, show an error dialog } }/* else { echo '<script>alert("Please follow the form to this page.");</script>'; header("Location: http://www.inkzoid.com/shoutbox/shout.php"); // if they weren't even referred from the form, show error dialog and redirect } // if isset post shout /* STARTING THE MAIN SCRIPT NOW */ // starting the table //displaying the shouts getShouts(); mysql_close($l); ?>
  3. Ok I'm trying to go through in my head thinking what exactly I'm doing wrong here... My syntax for gallery.php line 1 is correct In shout.php the header location points to itself (shoutbox/shout.php) and there is no slash at the beginning this time, so the path is correct... I can get gallery.php to show the shoutbox only and not the rest of the gallery page, so I'm partway there...
  4. Alright so the header location has been changed to shoutbox/shout.php in the gallery.php file and in the shout.php file the 2 references to header location are shoutbox/shout.php. I have the same error as before. I also go the same error when I changed them both to header location gallery.php . Obviously I am doing something wrong...
  5. Oh crap Alright I'll change it to link to shout.php and see if I can get a different result
  6. @PFMaBiSmAd - Thanks for pointing out my path error...it has been corrected. @fortnox007 - I apologize but I'm a beginner to PHP...did you mean I should cut the header line from my shout.php script and paste it before the html in my gallery.php file, or copy and paste it instead? I copied it and put it before the html in gallery.php and got a Firefox error (Firefox has detected that the server is redirecting the request for this address in a way that will never complete). This is what I currently have above the html tag on line 1 of gallery.php: <?php header("Location: http://www.inkzoid.com/gallery.php"); ?>
  7. I'm trying to take the comment box and put it at the bottom of my gallery page ( http://www.inkzoid.com/gallery.php ) where the old comment box that I'm currently using is. The error message I'm getting when I try to use the php include function to include the php script in my gallery.php page is a typical header location error. It says: Warning: include(/shoutbox/shout.php) [function.include]: failed to open stream: No such file or directory in D:\Hosting\5612165\html\gallery.php on line 190 Warning: include() [function.include]: Failed opening '/shoutbox/shout.php' for inclusion (include_path='.;C:\php5\pear') in D:\Hosting\5612165\html\gallery.php on line 190 I know this is coming up because the session_start(); function of my shoutbox.php file is not the very first line on my gallery page (the whole file is included near the bottom of gallery.php), but if I put the shoutbox.php file at the top of gallery.php using include, then the shoutbox will show up at the top of the page, which is not where I want it to show up.
  8. I've got a comment box that is functioning correctly and is set up to a database to retrieve and display comments, but what I am trying to do is place it on a different page. I want it on my gallery.php page, and when I try to include it, I get one of those header errors because it isn't included immediately on line 1. I know I can solve the problem by including it on line 1, but I want my comment box somewhere else down the page and don't know what I have to do to put it somewhere else. <?php @session_start(); // calling session_start() the function which starts our authentication session // connecting to mysql server $l = mysql_connect ( "999.999.999.999" , "inkzoid" , "999" ) or die("Error connecting:<BR><BR>".mysql_error()); mysql_select_db( "inkzoid" ) or die("Error getting db:<BR><BR>".mysql_error()); // defining getShouts() which is our function that gets all of our shouts function getShouts() { echo '<div align="left"> <table width="800" bgcolor="#128911" border="0" cellspacing="0" cellpadding="0"> <tr> <td> '; $query = mysql_query("SELECT * FROM shouts ORDER BY id DESC LIMIT 10") or die(mysql_error()); while ($row = mysql_fetch_array($query) ) { //print_r($row); $name = stripslashes($row['name']); $contact = stripslashes($row['contact']); $shout = stripslashes($row['shout']); if(empty($contact)) { echo '<p><span class="author">'.$name.'</span> - <span class="shout">'.$shout.'</span></p>'; } else { echo '<p><span class="author"><a href="'.$contact.'" target="_blank">'.$name.'</a></span> - <span class="shout">'.$shout.'</span></p>'; } // if empty contact } // while row mysqlfetcharray query echo '<br><br>'; echo ' </td> </tr> <tr> <td height="10"> </td> <form name="shout" method="post" action="shout.php"> <div align="center"> <input name="name" type="text" id="name" value="Name" size="25" maxlength="10"><br> <input name="contact" type="text" id="contact" value="http://" size="25"><br> <input name="message" type="text" id="message" value="Message" size="25"><br> <input name="shout" type="submit" id="shout" value="Shout!"> </div> </form> </td> </tr> </table> </div> '; } // function getshouts // our processing if control statement if ( isset ( $_POST['shout'] ) ) { $name = addslashes($_POST['name']); $contact = addslashes($_POST['contact']); $message = $_POST['message']; if ( ( isset($name) ) && ( isset($message) ) ) { // getting smilie list $smilies = mysql_query("SELECT * FROM smilies") or die(mysql_error()); while($get = mysql_fetch_array ($smilies)) { $alt = $get['Alt']; $smilie = $get['URL']; $message = str_replace( $get['Symbol'] , '<img src="smilies/'.$smilie.'" border="0" width="15" height="15" alt="'.$alt.'">' , $message); $themessage = addslashes($message); // replacing all smilies } mysql_query("INSERT INTO shouts (name, contact, shout) VALUES ( '$name' , '$contact' , '$message' )") or die(mysql_error()); $_SESSION['has_posted'] = 'yes'; header("Location: http://www.inkzoid.com/shoutbox/shout.php"); // if required fields aren't empty, process into database } else { echo '<script>alert("Some fields were not filled out!");</script>'; header("Location: http://www.inkzoid.com/shoutbox/shout.php"); // if required fields were left empty, show an error dialog } }/* else { echo '<script>alert("Please follow the form to this page.");</script>'; header("Location: http://www.inkzoid.com/shoutbox/shout.php"); // if they weren't even referred from the form, show error dialog and redirect } // if isset post shout /* STARTING THE MAIN SCRIPT NOW */ // starting the table //displaying the shouts getShouts(); mysql_close($l); ?>
  9. I've got a comment box that connects to a MySQL database. I've got this error message here when I use the PHP include function to call on this script on my main page http://www.inkzoid.com/index.php ... <?php // calling session_start() the function which starts our authentication session session_start(); // connecting to mysql server $l = mysql_connect ( "999.999.999.999" , "inkzoid" , "999) or die("Error connecting:<BR><BR>".mysql_error()); mysql_select_db( "inkzoid" ) or die("Error getting db:<BR><BR>".mysql_error()); // defining getShouts() which is our function that gets all of our shouts function getShouts() { echo '<div align="center"> <table width="150" border="0" cellspacing="0" cellpadding="0"> <tr> <td> '; $query = mysql_query("SELECT * FROM shouts ORDER BY id DESC LIMIT 10") or die(mysql_error()); while ($row = mysql_fetch_array($query) ) { $name = stripslashes($row['Name']); $contact = stripslashes($row['Contact']); $shout = stripslashes($row['Shout']); if(empty($contact)) { echo '<p><span class="author">'.$name.'</span> - <span class="shout">'.$shout.'</span></p>'; } else { echo '<p><span class="author"><a href="'.$contact.'" target="_blank">'.$name.'</a></span> - <span class="shout">'.$shout.'</span></p>'; } // if empty contact } // while row mysqlfetcharray query echo '<br><br>'; echo ' </td> </tr> <tr> <td height="10"> </td> <form name="shout" method="post" action="shout.php"> <div align="center"> <input name="name" type="text" id="name" value="Name" size="25" maxlength="10"><br> <input name="contact" type="text" id="contact" value="http://" size="25"><br> <input name="message" type="text" id="message" value="Message" size="25"><br> <input name="shout" type="submit" id="shout" value="Shout!"> </div> </form> </td> </tr> </table> </div> '; } // function getshouts // our processing if control statement if ( isset ( $_POST['shout'] ) ) { $name = addslashes($_POST['name']); $contact = addslashes($_POST['contact']); $message = $_POST['message']; if ( ( isset($name) ) && ( isset($message) ) ) { // getting smilie list $smilies = mysql_query("SELECT * FROM smilies") or die(mysql_error()); while($get = mysql_fetch_array ($smilies)) { $alt = $get['Alt']; $smilie = $get['URL']; $message = str_replace( $get['Symbol'] , '<img src="smilies/'.$smilie.'" border="0" width="15" height="15" alt="'.$alt.'">' , $message); $themessage = addslashes($message); // replacing all smilies } mysql_query("INSERT INTO shouts (Name, Contact, Shout) VALUES ( '$name' , '$contact' , '$message' )") or die(mysql_error()); $_SESSION['has_posted'] = 'yes'; header("Location: shout.php"); // if required fields aren't empty, process into database } else { echo '<script>alert("Some fields were not filled out!");</script>'; header("Location: shout.php"); // if required fields were left empty, show an error dialog } }/* else { echo '<script>alert("Please follow the form to this page.");</script>'; header("Location: shout.php"); // if they weren't even referred from the form, show error dialog and redirect } // if isset post shout /* STARTING THE MAIN SCRIPT NOW */ // starting the table //displaying the shouts getShouts(); mysql_close($l); ?> I was told that I should put ob_start(); at the top of my page and ob_end_clear(); at the end of my page, but should that code go on the shout.php file or my index.php file (index.php is where I want my comment box to go)? I was using session_start(); but I got some error messsages about headers already being sent because I had originally used the php include function at the top of index.php to include shout.php. After reading up on it I found out that the error was caused by not having session_start(); being the first line of code. So my problem was that I wanted the comment box to be somewhere other than at the top of the page. Not sure how to move it. Anyways I'm pretty confused right now and if someone could give me some advice it would be appreciated.
  10. I've been looking up tutorials for the past 3 days...probably have spent 10 hours reading tuts. And I'm still stuck, so if someone can help me it would be greatly appreciated! Here's my site: http://www.inkzoid.com/our_gallery.html I love the comment box. But it's someone else's and there are therefore many features I can't change like modifying the profanity filter and allowing commenters to have their own avatars. I'm trying to use a PHP script I found to make a comment box that doesn't take you to another page in order to submit a comment. The PHP script I found does take you to a new page but I'd basically like it to be able to look exactly like the one I have now so maybe I can insert it into the DIV where my current comment box is right now. The script I got came with a bunch of files such as: captcha.php guestbook.php guestbook.txt include.php sign.php font.gdf I've uploaded them to my server and have made a comment but I think something's incomplete. Maybe I shouldn't even be using this... Thanks Alex [attachment deleted by admin]
×
×
  • 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.