Jump to content

Scotty13

Member
  • Posts

    59
  • Joined

  • Last visited

Everything posted by Scotty13

  1. With some adjusting to get it just right around the key hole picture, this worked for me. I hope this helps someone else. <body> <a href='http://example.com' style='display:bock; width:115px; height:215px; position:absolute; left:40px; top:15px'></a> </body> Thank you ALL above for helping me. Scott
  2. I'm only a rookie, so I would appreciate any help and please don't answer with to complicated replies. I know how to add an image and make it a link or add a link. However, I have this background image on my website (image attached). All the images you see are one picture. I want my members to be able to hover over any part of the “key hole” and be able to click and send them to my home page. Is this even possible to do? Script… <?php ob_start(); ?> <!doctype html> <html> <head> <title>Page Title</title> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <style type="text/css"> <!-- body { background-image:url('app/web/img/login_logo.jpg'); background-position:center top; background-repeat:no-repeat; } .center { text-align: center; } --> </style> </head> <body> {APP_TPL} </body> </html> <?php include 'listings.php'; ?> Thank you, Scott
  3. I'm only a rookie, so I would appreciate any help and please don't answer with to complicated replies. I’m following tuts to build a social network from someone on youtube. My echo $announcerDisplayList; I attached an image so you can see what my announcer display list does. PHP entry… $announcerDisplayList .= '<table width="100%" align="center" cellpadding="4" style="background-color:#CCCCCC; border:#999 1px solid;"> <tr> <td width="12%" bgcolor="#FFFFFF" valign="top"><a href="root/res.php?id=' . $uid . '">' . $announcer_pic . '</a> </td> <td width="100%" bgcolor="#F9F9F9" style="line-height:1.5em;" valign="top"><span class="liteGreyColor textsize10"> ' . $whenAnno . ' <a href="root/res.php?id=' . $uid . '"><strong>' . $username . '</a> Announced: </span><br /> via <em>' . $anno_device . '</em></span><br /> <span class="textsize10"> ' . $the_anno . '</span> </td> </tr> </table>'; } } </head> <body> <p> <?php print "$MemberDisplayList"; ?> </p> </div> </div> <?php print "$announcerDisplayList"; ?></td> </table> <br /> <br /> </td> </tr> </table> <?php include_once "footer_template.php"; ?> </body> </html> 1. Why are the entries all spaced out? 2. Why “_” between each word. Thanks, Scott
  4. I'm only a rookie, so I would appreciate any help and please don't answer with to complicated replies. Error coming from line 82 (marked below along with script entry). Warning: move_uploaded_file(tktedmembers/24/image01.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/*******/public_html/edit_res.php on line 82 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php0GS4bb' to 'tktedmembers/24/image01.jpg' in /home/*******/public_html/edit_res.php on line 82 // ------- PARSING PICTURE UPLOAD --------- if ($_POST['parse_var'] == "pic"){ // If a file is posted with the form if ($_FILES['fileField']['tmp_name'] != "") { $maxfilesize = 51200; // 51200 bytes equals 50kb if($_FILES['fileField']['size'] > $maxfilesize ) { $error_msg = '<font color="#FF0000">ERROR: Your image was too large, please try again.</font>'; unlink($_FILES['fileField']['tmp_name']); } else if (!preg_match("/\.(gif|jpg|png)$/i", $_FILES['fileField']['name'] ) ) { $error_msg = '<font color="#FF0000">ERROR: Your image was not one of the accepted formats, please try again.</font>'; unlink($_FILES['fileField']['tmp_name']); } else { $newname = "image01.jpg"; LINE 82: $place_file = move_uploaded_file( $_FILES['fileField']['tmp_name'], "tktedmembers/$id/".$newname); } } } // ------- END PARSING PICTURE UPLOAD --------- I tried everything that "I" could think of. Thanks, Scott
  5. WOW! I didnt even catch that, but unfortunately that didnt help.
  6. Trying to get my main table to connect. Keeping getting the same error… Success in database CONNECTION..... no TABLE created. You have problems in the system already, backtrack and debug! My table in my script/ Dreamweaver CS 4 matches exactly to entries I have in phpMyAdmin. What ‘am I missing here? <?php require_once "connect_to_mysql.php"; // Tell ourselves on screen if we have connected print "Success in database CONNECTION.....<br />"; // Create the members main table in your new database $result = "CREATE TABLE myMembers ( id int(11) NOT NULL auto_increment, uid int(11) NOT NULL, username varchar(255) NOT NULL, firstname varchar(255) NOT NULL lastname varchar(255) NOT NULL, maidenname varchar(255) NULL, city varchar(255) NOT NULL, state_province varchar(255) NOT NULL, country varchar(255) NOT NULL, workstatus varchar(255) NOT NULL, seniority date NOT NULL default '0000-00-00' airline varchar(255) NOT NULL, currentairline varchar(255) NOT NULL, previousairline varchar(255) NOT NULL, myfirstairline varchar(255) NOT NULL, email varchar(255) NOT NULL, locator varchar(255) NOT NULL, made_res_date datetime NOT NULL default '0000-00-00', last_ckin_date datetime NOT NULL default '0000-00-00', bio_body text NULL, website varchar(255) NULL, ipaddress varchar(255) NOT NULL, passenger_array text NULL, ts timestamp NULL default '0000-00-00 00:00:00', account_type enum('a','b','c') NOT NULL default 'a', email_activated enum('0','1') NOT NULL default '0', private enum('0','1') NOT NULL default '0', PRIMARY KEY (id), UNIQUE KEY email (email) ) "; if (mysql_query($result)){ print "Success in TABLE creation!...... <br /><br /><b>That completes the table setup, now delete the file <br /> named 'create_Table.php' and you are ready to move on. Let us go!</b>"; } else { print "no TABLE created. You have problems in the system already, backtrack and debug!"; } exit(); ?> Thanks, Scott
  7. It maybe the myMembers_table.php I get this error when I test it... Success in database CONNECTION..... no TABLE created. You have problems in the system already, backtrack and debug! <?php require_once "connect_to_mysql.php"; print "Success in database CONNECTION.....<br />"; $result = "CREATE TABLE myMembers ( id int(11) NOT NULL auto_increment, username varchar(255) NOT NULL, firstname varchar(255) NOT NULL lastname varchar(255) NOT NULL, maidenname varchar(255) NULL, ) "; if (mysql_query($result)){ print "Success in TABLE creation!...... <br /><br /><b>That completes the table setup, now delete the file <br /> named 'create_Table.php' and you are ready to move on. Let us go!</b>"; } else { print "no TABLE created. You have problems in the system already, backtrack and debug!"; } exit(); ?> Thanks, Scott
  8. Tried both, like the one below. No errors, but still reading username. if ($firstname != "") { $mainNameLine = $username . ' ' . $maidenname . ' ' . $lastname; $username = $firstname; } else { $mainNameLine = $username; }
  9. This just displays the username aka first name. I want it to also display the member’s last name and maiden name if they have one. /////// Mechanism to Display Real Name Next to Username - real name(username) ////////////////////////// if ($firstname != "") { $mainNameLine = "$firstname $maidenname $lastname ($username)"; $username = $firstname; } else { $mainNameLine = $username; $maidenname; $lastname; } I want to display maiden and last name along with the user name. I've tried everything I could think of. Any suggestions? Thanks, Scott
  10. @ Ben. I did catch that, thanks. Spoke too soon. It works perfect in IE broser. When I test in Chrome, Safari and Firefox I get the following error... Warning: Cannot modify header information - headers already sent by (output started at /home/******/public_html/root/wi_class_files/autoMakeLinks.php:15) in /home/myglobal/public_html/root/res.php on line 45 // ------- ESTABLISH THE PAGE ID ACCORDING TO CONDITIONS --------- if (isset($_GET['id'])) { $id = preg_replace('#[^0-9]#i', '', $_GET['id']); // filter everything but numbers } else if (isset($_SESSION['idx'])) { $id = $ckinOptions_id; } else { Line 45: header("location: index.php"); exit(); } // ------- END ESTABLISH THE PAGE ID ACCORDING TO CONDITIONS ---------
  11. FIXED (changed).... LINE 185: if (preg_match("/".$Match."/", $agent)) { LINE 247: $anno_device = $row["anno_device"]; Scotty
  12. My profile page is giving me the following errors. Deprecated: Function eregi() is deprecated in /home/******/public_html/root/res.php on line 185 Notice: Undefined index: device in /home/******/public_html/root/res.php on line 247 LINES 185 & 247 are marked below. Using PHP 5.3.x On line 185, I've tried preg and preg_match. They both gave me errors. I appreciate any help and please don't answer with to complicated replies. I'm only a rookie and as you can see this is all I could achieve. Thanks, Scott // ------- DETECT USER DEVICE ---------- $user_device = ""; $agent = $_SERVER['HTTP_USER_AGENT']; if (preg_match("/iPhone/", $agent)) { $user_device = "iPhone Mobile"; } else if (preg_match("/Android/", $agent)) { $user_device = "Android Mobile"; } else if (preg_match("/IEMobile/", $agent)) { $user_device = "Windows Mobile"; } else if (preg_match("/Chrome/", $agent)) { $user_device = "Google Chrome"; } else if (preg_match("/MSIE/", $agent)) { $user_device = "Internet Explorer"; } else if (preg_match("/Firefox/", $agent)) { $user_device = "Firefox"; } else if (preg_match("/Safari/", $agent)) { $user_device = "Safari"; } else if (preg_match("/Opera/", $agent)) { $user_device = "Opera"; } $OSList = array ( // Match user agent string with operating systems 'Windows 3.11' => 'Win16', 'Windows 95' => '(Windows 95)|(Win95)|(Windows_95)', 'Windows 98' => '(Windows 98)|(Win98)', 'Windows 2000' => '(Windows NT 5.0)|(Windows 2000)', 'Windows XP' => '(Windows NT 5.1)|(Windows XP)', 'Windows Server 2003' => '(Windows NT 5.2)', 'Windows Vista' => '(Windows NT 6.0)', 'Windows 7' => '(Windows NT 6.1)|(Windows NT 7.0)', 'Windows NT 4.0' => '(Windows NT 4.0)|(WinNT4.0)|(WinNT)|(Windows NT)', 'Windows ME' => 'Windows ME', 'Open BSD' => 'OpenBSD', 'Sun OS' => 'SunOS', 'Linux' => '(Linux)|(X11)', 'Mac OS' => '(Mac_PowerPC)|(Macintosh)', 'QNX' => 'QNX', 'BeOS' => 'BeOS', 'OS/2' => 'OS/2', 'Mac OS' => 'Mac OS', 'Search Bot'=>'(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp)|(MSNBot)|(Ask Jeeves/Teoma)|(ia_archiver)' ); // Loop through the array of user agents and matching operating systems foreach($OSList as $CurrOS=>$Match) { // Find a match LINE 185: if (eregi($Match, $agent)) { break; } else { $CurrOS = "Unknown OS"; } } $device = "$user_device : $CurrOS"; // ------- END DETECT USER DEVICE ---------- // ------- POST NEW BLAB TO DATABASE --------- $anno_outout_msg = ""; if (isset($_POST['anno_field']) && $_POST['anno_field'] != "" && $_POST['anno_field'] != " "){ $annoWipit = $_POST['annoWipit']; $sessWipit = base64_decode($_SESSION['wipit']); if (!isset($_SESSION['wipit'])) { } else if ($annoWipit == $sessWipit) { // Delete any annos over 50 for this member $sqlDeleteAnnos = mysql_query("SELECT * FROM announcing WHERE tkt_id='$id' ORDER BY anno_date DESC LIMIT 50"); $bi = 1; while ($row = mysql_fetch_array($sqlDeleteAnnos)) { $anno_id = $row["id"]; if ($bi > 20) { $deleteAnnos = mysql_query("DELETE FROM announcing WHERE id='$anno_id'"); } $bi++; } // End Delete any annos over 20 for this member $anno_field = $_POST['anno_field']; $anno_field = stripslashes($anno_field); $anno_field = strip_tags($anno_field); $anno_field = mysql_real_escape_string($anno_field); $anno_field = str_replace("'", "'", $anno_field); $sql = mysql_query("INSERT INTO announcing (tkt_id, the_anno, anno_date, anno_type, anno_device) VALUES('$id','$anno_field', now(),'a','$anno_device')") or die (mysql_error()); $anno_outout_msg = "Your announcement has been posted!"; } } // ------- END POST NEW BLAB TO DATABASE --------- // ------- MEMBER BLABS OUTPUT CONSTRUCTION --------- /////// Mechanism to Display Pic if (file_exists($check_pic)) { $anno_pic = '<div style="overflow:hidden; height:40px;"><a href="res.php?id=' . $id . '"><img src="' . $check_pic . '" width="40px" border="0" /></a></div>'; } else { $anno_pic = '<div style="overflow:hidden; height:40px;"><a href="res.php?id=' . $id . '"><img src="' . $default_pic . '" width="40px" border="0" /></a></div>'; } /////// END Mechanism to Display Pic $sql_annos = mysql_query("SELECT id, tkt_id, the_anno, anno_date, anno_type, anno_device FROM announcing WHERE tkt_id='$id' ORDER BY anno_date DESC LIMIT 30"); while($row = mysql_fetch_array($sql_annos)){ $annoid = $row["id"]; $announcer_id = $row["tkt_id"]; $the_anno = $row["the_anno"]; $the_anno = ($activeLinkObject -> makeActiveLink($the_anno)); $anno_date = $row["anno_date"]; $convertedTime = ($myObject -> convert_datetime($anno_date)); $whenAnno = ($myObject -> makeAgo($convertedTime)); $anno_date = $row["anno_date"]; $anno_type = $row["anno_type"]; LINE 247: $anno_device = $row["device"]; $announcerDisplayList .= ' <table style="background-color:#FFF; border:#999 1px solid; border-top:none;" cellpadding="5" width="100%"> <tr> <td width="10%" valign="top">' . $anno_pic . '</td> <td width="90%" valign="top" style="line-height:1.5em;"> <span class="liteGreyColor textsize9">' . $whenAnno . ' <a href="res.php?id=' . $announcer_id . '"><strong>' . $mainNameLine . '</strong></a> via <em>' . $anno_device . '</em></span><br /> ' . $the_anno . ' </td> </tr></table>'; }
  13. When I test view_thread.php, I get this echo response from line 13 ERROR: That thread does not exist. DIV is at line 167-191 (marked). FYI - The two database Tables for this Forum that I'm "trying" to build are up and running. <?php session_start(); include_once "../scripts/connect_to_mysql.php"; // Connect to the database // Connect to the class file for converting date_time to "Ago" format include_once ("../wi_class_files/agoTimeFormat.php"); $myAgoObject = new convertToAgo; // Establish the object // Get the "id" URL variable and query the database for the original post of this thread $thread_id = preg_replace('#[^0-9]#i', '', $_GET['id']); $sql = mysql_query("SELECT * FROM forum_posts WHERE id='$thread_id' AND type='a' LIMIT 1"); $numRows = mysql_num_rows($sql); if ($numRows < 1) { echo "ERROR: That thread does not exist."; exit(); } while($row = mysql_fetch_array($sql)){ $post_author = $row["post_author"]; $post_author_id = $row["post_author_id"]; $date_time = $row["date_time"]; $date_time = strftime("%b %d, %Y", strtotime($date_time)); $section_title = $row["section_title"]; $section_id = $row["section_id"]; $thread_title = $row["thread_title"]; $post_body = $row["post_body"]; } ?> <?php // Now query any responses out of the database and place in a dynamic list $all_responses = ""; $sql = mysql_query("SELECT * FROM forum_posts WHERE otid='$thread_id' AND type='b'"); $numRows = mysql_num_rows($sql); if ($numRows < 1) { $all_responses = '<div id="none_yet_div">Nobody has responded to this yet, you can be the first.</div>'; } else { while($row = mysql_fetch_array($sql)){ $reply_author = $row["post_author"]; $reply_author_id = $row["post_author_id"]; $date_n_time = $row["date_time"]; $convertedTime = ($myAgoObject -> convert_datetime($date_n_time)); $whenReply = ($myAgoObject -> makeAgo($convertedTime)); $reply_body = $row["post_body"]; $all_responses .= '<div class="response_top_div">Re: ' . $thread_title . ' • ' . $whenReply . ' <a href="../res.php?id=' . $reply_author_id . '">' . $reply_author . '</a> Said:</div> <div class="response_div">' . $reply_body . '</div>'; } } ?> <?php // Be sure the user session vars are all set in order to show them the "replyButton" $replyButton = 'You must <a href="http://www.***********.com/ckin.php">CHECK IN</a> to respond'; if (isset($_SESSION['id']) && isset($_SESSION['username']) && isset($_SESSION['useremail']) && isset($_SESSION['userloca'])) { $replyButton = '<input name="myBtn1" type="submit" value="Post a Response" style="font-size:16px; padding:12px;" onmousedown="javascript:toggleForm(\'reponse_form\');" />'; } // Check the database to be sure that their ID, locator, and email session variables all match in the database $u_id = mysql_real_escape_string($_SESSION['id']); $u_name = mysql_real_escape_string($_SESSION['username']); $u_email = mysql_real_escape_string($_SESSION['useremail']); $u_loca = mysql_real_escape_string($_SESSION['userloca']); $sql = mysql_query("SELECT * FROM myMembers WHERE id='$u_id' AND username='$u_name' AND email='$u_email' AND locator='$u_loca'"); $numRows = mysql_num_rows($sql); if ($numRows < 1) { $replyButton = 'You Must <a href="../ckin.php">CHECK IN</a> to Respond'; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="style/style.css" rel="stylesheet" type="text/css" /> <script src="../js/jquery-1.7.1.js" type="text/javascript"></script> <title><?php echo $thread_title; ?></title> <script language="javascript" type="text/javascript"> function toggleForm(x) { if ($('#'+x).is(":hidden")) { $('#'+x).slideDown(200); } else { $('#'+x).slideUp(200); } } $('#responseForm').submit(function(){$('input[type=submit]', this).attr('disabled', 'disabled');}); function parseResponse ( ) { var thread_id = $("#thread_id"); var post_body = $("#post_body"); var fs_id = $("#forum_section_id"); var fs_title = $("#forum_section_title"); var u_id = $("#tktedmembers_id"); var u_loca = $("#tktedmembers_locator"); var url = "parse_post.php"; if (post_body.val() == "") { $("#formError").html('<font size="+2">Please type something</font>').show().fadeOut(3000); } else if (post_body.val().length < 2 ) { $("#formError").html('<font size="+2">Your post must be at least 2 characters long').show().fadeOut(3000); } else { $("#myBtn1").hide(); $("#formProcessGif").show(); $.post(url,{ post_type: "b", tid: thread_id.val(), post_body: post_body.val(), fsID: fs_id.val(), fsTitle: fs_title.val(), uid: u_id.val(), uloca: u_loca.val() } , function(data) { $("#none_yet_div").hide(); var myDiv = document.getElementById('responses'); var magicdiv1 = document.createElement('div'); magicdiv1.setAttribute("class", "response_top_div"); magicdiv1.htmlContent = 'Re: <?php echo $thread_title ?>'; magicdiv1.innerHTML = 'Re: <?php echo $thread_title ?>'; myDiv.appendChild(magicdiv1); var magicdiv = document.createElement('div'); magicdiv.setAttribute("class", "response_div"); magicdiv.htmlContent = data; magicdiv.innerHTML = data; myDiv.appendChild(magicdiv); $('#reponse_form').slideUp("fast"); document.responseForm.post_body.value=''; $("#formProcessGif").hide(); $("#myBtn1").show(); }); } } </script> <style type="text/css"> <!-- .topic_div { background-color: #D9F9FF; font-size:16px; padding:16px; border: #01B3D8 1px solid; margin-bottom:6px; font-weight: 500; color:#069; } .response_top_div { background-color: #E4E4E4; color: #666; font-size:14px; padding:4px; border: #CCC 1px solid; border-bottom:none; color: #999; } .response_div { background-color: #FFF; font-size:14px; padding:12px; border:#CCC 1px solid; margin-bottom:6px; width:639px; overflow:hidden; } #none_yet_div { background-color: #E4E4E4; font-size:16px; padding:16px; border: #CCC 1px solid; margin-bottom:6px; color: #999; } --> </style> </head> <body> <?php include_once("template_header.php"); ?> <table style="background-color: #FFFFFF; border:#069 1px solid; border-top:none;" width="900" border="0" align="center" cellpadding="12" cellspacing="0"> <tr> <td width="666" valign="top" style="line-height:1.5em;"> <div id="breadcrumbs"><a href="http://www.***********.com/root/index.php">Return Home: My Global PNR</a> ← <a href="http://***********.com/root/forum/index.php">Return: Work & Trip Forum</a> ← <a href="section.php?id=<?php echo $section_id; ?>"><?php echo $section_title; ?></a></div> <br /> <span class="topicTitles"><?php echo $thread_title; ?></span><br /><br /> LINE 167: Topic Started by, TKTed Member: <a href="../res.php?id=<?php echo $post_author_id; ?>"><?php echo $post_author; ?></a> Created: <span class="topicCreationDate"><?php echo $date_time; ?></span> <div class="topic_div"><?php echo $post_body; ?></div> <div id="responses"> <p> </p> <?php echo $all_responses; ?></div> <!-- START DIV that contains the form --> <div id="reponse_form" style="display:none; background-color: #BAE1FE; border:#06C 1px solid; padding:16px;"> <form action="javascript:parseResponse();" name="responseForm" id="responseForm" method="post"> Please type in your response here <?php echo $u_name; ?>:<br /><textarea name="post_body" id="post_body" cols="64" rows="12" style="width:98%;"></textarea> <div id="formError" style="display:none; padding:16px; color:#F00;"></div> <br /><br /><input name="myBtn1" id="myBtn1" type="submit" value="Submit Your Response" style="padding:6px;" /> <span id="formProcessGif" style="display:none;"><img src="../images/loading.gif" width="28" height="10" alt="Loading" vspace="2" hspace="48" /></span> or <a href="#" onclick="return false" onmousedown="javascript:toggleForm('reponse_form');">Cancel</a> <input name="thread_id" id="thread_id" type="hidden" value="<?php echo $thread_id; ?>" /> <input name="forum_section_id" id="forum_section_id" type="hidden" value="<?php echo $section_id; ?>" /> <input name="forum_section_title" id="forum_section_title" type="hidden" value="<?php echo $section_title; ?>" /> <input name="tktedmembers_id" id="tktedmembers_id" type="hidden" value="<?php echo $_SESSION['id']; ?>" /> <input name="tktedmembers_locator" id="tktedmembers_locator" type="hidden" value="<?php echo $_SESSION['userloca']; ?>" /> </form> </div> <p> <!-- END DIV that contains the form --> LINE 191: <?php echo $replyButton; ?></p> <p> <br /> <br /> </p></td> <td width="184" valign="top"><div style=" width:160px; height:600px; background-color: #F0F0F0; color: #CCC; padding:12px;"> <br /> <br /> <br /> <h3>Contact us to place your AD here.</h3> </div></td> </tr> </table> <?php include_once("template_footer.php"); ?> </body> </html> Thanks in advance, Scott
  14. FIXED IT!!! The entry is good, I missed a word that I had changed in other scripts and didnt see it on this sections.
  15. If its not one thing its another. Im a newbie just trying to build a social network website from some tutorials online. When I try to change my picture, I get these errors… Warning: move_uploaded_file(members/6/image01.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/******/public_html/edit_res.php on line 70 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php7MzLn5' to 'members/6/image01.jpg' in /home/******/public_html/edit_res.php on line 70 Warning: move_uploaded_file(members/6/image01.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/******/public_html/edit_res.php on line 95 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php7MzLn5' to 'members/6/image01.jpg' in /home/******/public_html/edit_res.php on line 95 (Lines 70 & 95 are marked below) // ------- IF WE ARE PARSING ANY DATA ----------------------------------------------------- if (!isset($_POST['parse_var'])) { $_POST['parse_var'] = "undefined"; } if($_POST['parse_var'] == "undefined") { //Code to handle undefined exception } if ($_POST['parse_var'] == "pic"){ // If a file is posted with the form if ( isset($_FILES['fileField']) && ! empty($_FILES['fileField']['tmp_name']) ) { $maxfilesize = 2097152; // equal to 2 mb if($_FILES['fileField']['size'] > $maxfilesize ) { $error_msg = '<font color="#FF0000">ERROR: Your image was too large, please try again.</font>'; unlink($_FILES['fileField']['tmp_name']); } else if (!preg_match("/\.(gif|jpg|png)$/i", $_FILES['fileField']['name'] ) ) { $error_msg = '<font color="#FF0000">ERROR: Your image was not one of the accepted formats, please try again.</font>'; unlink($_FILES['fileField']['tmp_name']); } else { $newname = "image01.jpg"; (LINE 70) $place_file = move_uploaded_file( $_FILES['fileField']['tmp_name'], "members/$id/".$newname); } } } // ------- PARSING PICTURE UPLOAD --------- if ($_POST['parse_var'] == "pic"){ // If a file is posted with the form if ($_FILES['fileField']['tmp_name'] != "") { $maxfilesize = 51200; // 51200 bytes equals 50kb if($_FILES['fileField']['size'] > $maxfilesize ) { $error_msg = '<font color="#FF0000">ERROR: Your image was too large, please try again.</font>'; unlink($_FILES['fileField']['tmp_name']); } else if (!preg_match("/\.(gif|jpg|png)$/i", $_FILES['fileField']['name'] ) ) { $error_msg = '<font color="#FF0000">ERROR: Your image was not one of the accepted formats, please try again.</font>'; unlink($_FILES['fileField']['tmp_name']); } else { $newname = "image01.jpg"; (LINE 95) $place_file = move_uploaded_file( $_FILES['fileField']['tmp_name'], "members/$id/".$newname); } } } // ------- END PARSING PICTURE UPLOAD --------- THANK YOU FOR YOUR HELP! Scott
  16. FIXED! I removed "TKTed" from the other scripts and NO errors in any of the four browsers. Thanks for your help. Scott
  17. The orig. variable is MemberDisplayList I added "TKTed" If I test in IE its good with the TKTed in front of MemberDisplayList and if I test in Chrome, Firefox or Safari they all give me an error. I removed TKTed and just left MemberDisplayList. I tested in IE and gave me the error and in Chrome, Firefox or Safari everything is good. IE is the problem.
  18. If I pull up http://mywebsite.com/ In index.php... </div> <p> <?php print "$TKTedMemberDisplayList"; ?> <div style="width:728px; height:827px; border: #999 thin solid; overflow:auto;"><?php print "$announcerDisplayList"; ?> </div> I get this one error in between a table and some pictures that show on my home page. Notice: Undefined variable: TKTedMemberDisplayList in /home/*******/public_html/index.php on line 89 (should show members picture) I use TKTedMemberDisplayList in other php pages and no problem. However; If I pull up http://mywebsite.com/root/index.php The error is not there and the TKTedMemberDisplayList shows members pictures. Thanks in advance Scott
  19. and this if (!isset($_SESSION['wipit'])) { // Check to see if session wipit is set yet session_makeareservation('wipit'); // Be sure to register the session if it is not set yet } $thisRandNum = rand(9999999999999,999999999999999999); $_SESSION['wipit'] = base64_encode($thisRandNum);
  20. Okay, Thank you! Now I get this error & php below... Notice: Undefined index: thisWipit in /home/*****/public_html/edit_profile.php on line 46 Your session expired from inactivity. Please click here to refresh it.. // ------- IF WE ARE PARSING ANY DATA ----------------------------------------------------------------------------------------------------- $thisWipit = $_POST['thisWipit']; $sessWipit = base64_decode($_SESSION['wipit']); // if (!isset($_SESSION['wipit']) || !isset($_SESSION['idx'])) { echo 'Error: Your session expired from inactivity. Please <a href="index.php">click here to refresh it.</a>.'; exit(); } // if ($sessWipit != $thisWipit) { echo 'Your session expired from inactivity. Please <a href="index.php">click here to refresh it.</a>.'; exit(); } // if ($thisWipit == "") { echo 'Error: Missing Data... click back in your browser please.'; exit(); }
  21. My "error" is that it shows the first link and not the second one. I want both to titles and links to show. THANK U!
  22. I’m a newbie, me gentle on me. I never had this error until my web hosting company upgraded PHP from PHP 5.2.x to PHP 5.3.x. My edit profile page is giving me this following error… Notice: Undefined index: parse_var in /home/*****/public_html/edit_profile.php on line 152 & line 172 Line 152... if ($_POST['parse_var'] == "links"){ $website = $_POST['website']; $website = strip_tags($website); $website = str_replace("http://", "", $website); $website = str_replace("'", "'", $website); $website = str_replace("`", "'", $website); $website = mysql_real_escape_string($website); $youtube = preg_replace('#[^A-Za-z_0-9]#i', '', $_POST['youtube']); // filter everything but desired characters $sqlUpdate = mysql_query("UPDATE myMembers SET website='$website', youtube='$youtube' WHERE id='$id' LIMIT 1"); if ($sqlUpdate){ $success_msg = '<img src="images/round_success.png" width="20" height="20" alt="Success" />Your links and API connections have been updated successfully.'; } else { $error_msg = '<img src="images/round_error.png" width="20" height="20" alt="Failure" /> ERROR: Problems arose during the information exchange, please try again later.</font>'; } } Line 172... if ($_POST['parse_var'] == "bio"){ $bio_body = $_POST['bio_body']; $bio_body = str_replace("'", "'", $bio_body); $bio_body = str_replace("`", "'", $bio_body); $bio_body = mysql_real_escape_string($bio_body); $bio_body = nl2br(htmlspecialchars($bio_body)); // Update the database data now here for all fields posted in the form $sqlUpdate = mysql_query("UPDATE myMembers SET bio_body='$bio_body' WHERE id='$id' LIMIT 1"); if ($sqlUpdate){ $success_msg = '<img src="../root/images/round_success.png" width="20" height="20" alt="Success" />Your description information has been updated successfully.'; } else { $error_msg = '<img src="../root/images/round_error.png" width="20" height="20" alt="Failure" /> ERROR: Problems arose during the information exchange, please try again later.</font>'; } } Thanks in advance, Scotty13
  23. } else { // If no SESSION id is set, which means we have a person who is not logged in $interactionBox = '<div style="border:#CCC 2px solid; padding:5px; background-color:#E4E4E4; color:#999; font-size:13px;"> <a href="makeareservation.php">Make A Reservation</a> or <a href="ckin.php">CHECK IN</a> to interact with ' . $username . ' </div>'; $the_anno_form = '<div style="background-color:#BDF; border:#999 1px solid; padding:8px;"> <textarea name="anno_field" rows="3" style="width:99%;"></textarea> <a href="makeareservation.php">Make A Reservation</a> or <a href="ckin.php">CHECK IN</a> to write on ' . $username . '\'s Announcement Board </div>'; } In my edit profile page (error response), Im trying to add an additional link. Im trying to add ckin.php. What am I doing wrong? Thanks in advance. Scotty
  24. I’m a newbie, be gentle on me. Im following a tutorial series online and Im building a social network website. I want my member to sign up with their first name, last name, etc… Q. I’m confused when it comes time to use the firstname in my scripts and when to use username. I have firstname and username in myTable. Example below… <td align="right" class="alignRt"><div align="right">First Name:<span class="brightRed"> <span class="answerquestion">*</span></span> </div></td> <td align="left" class="alignleft"><input name="username" type="text" class="formFields" id="username" value="<?php print "$username"; ?>" size="32" maxlength="36" /></td> Like algebra, its simple when you get it, I can not get it when it comes to this. Thanks in advance, Scott
  25. Yes, thats the name of the file. I've downloaded this script for free from a php script website. I just test that page and got the error... Fatal error: Hacking attempt! in /home/myglobal/public_html/root/myvcphotos6/include/common.inc.php on line 1 Heres the script... <?php defined('PHPWG_ROOT_PATH') or trigger_error('Hacking attempt!', E_USER_ERROR); // determine the initial instant to indicate the generation time of this page $t1 = explode( ' ', microtime() ); $t2 = explode( '.', $t1[0] ); $t2 = $t1[1].'.'.$t2[1]; @set_magic_quotes_runtime(0); // Disable magic_quotes_runtime // // addslashes to vars if magic_quotes_gpc is off this is a security // precaution to prevent someone trying to break out of a SQL statement. // if( !@get_magic_quotes_gpc() ) { function sanitize_mysql_kv(&$v, $k) { $v = addslashes($v); } if( is_array( $_GET ) ) { array_walk_recursive( $_GET, 'sanitize_mysql_kv' ); } if( is_array( $_POST ) ) { array_walk_recursive( $_POST, 'sanitize_mysql_kv' ); } if( is_array( $_COOKIE ) ) { array_walk_recursive( $_COOKIE, 'sanitize_mysql_kv' ); } } if ( !empty($_SERVER["PATH_INFO"]) ) { $_SERVER["PATH_INFO"] = addslashes($_SERVER["PATH_INFO"]); } // // Define some basic configuration arrays this also prevents malicious // rewriting of language and otherarray values via URI params // $conf = array(); $page = array(); $user = array(); $lang = array(); $header_msgs = array(); $header_notes = array(); $filter = array(); if (is_file(PHPWG_ROOT_PATH .'local/config/multisite.inc.php')) { include(PHPWG_ROOT_PATH .'local/config/multisite.inc.php'); define('PWG_LOCAL_DIR', $conf['local_dir_site']); } else { define('PWG_LOCAL_DIR', 'local/'); } @include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR .'config/database.inc.php'); if (!defined('PHPWG_INSTALLED')) { header('Location: install.php'); exit; } foreach( array( 'array_intersect_key', //PHP 5 >= 5.1.0RC1 'hash_hmac', //(hash) - enabled by default as of PHP 5.1.2 'preg_last_error', // PHP 5 >= 5.2.0 'json_encode', // PHP 5 >= 5.2.0 ) as $func) { if (!function_exists($func)) { include_once(PHPWG_ROOT_PATH . 'include/php_compat/'.$func.'.php'); } } include(PHPWG_ROOT_PATH . 'include/config_default.inc.php'); @include(PHPWG_ROOT_PATH. 'local/config/config.inc.php'); if (isset($conf['local_dir_site'])) { @include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR. 'config/config.inc.php'); } // that's for migration from 2.2, will be deprecated in 2.4 if (isset($conf['order_by'])) { $conf['order_by_custom'] = $conf['order_by']; } if (isset($conf['order_by_inside_category'])) { $conf['order_by_inside_category_custom'] = $conf['order_by_inside_category']; } include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$conf['dblayer'].'.inc.php'); if(isset($conf['show_php_errors']) && !empty($conf['show_php_errors'])) { @ini_set('error_reporting', $conf['show_php_errors']); @ini_set('display_errors', true); } include(PHPWG_ROOT_PATH . 'include/constants.php'); include(PHPWG_ROOT_PATH . 'include/functions.inc.php'); include( PHPWG_ROOT_PATH .'include/template.class.php'); // Database connection try { $pwg_db_link = pwg_db_connect($conf['db_host'], $conf['db_user'], $conf['db_password'], $conf['db_base']); } catch (Exception $e) { my_error(l10n($e->getMessage()), true); } pwg_db_check_charset(); load_conf_from_db(); if (!$conf['check_upgrade_feed']) { if (!isset($conf['piwigo_db_version']) or $conf['piwigo_db_version'] != get_branch_from_version(PHPWG_VERSION)) { redirect(get_root_url().'upgrade.php'); } } load_plugins(); // users can have defined a custom order pattern, incompatible with GUI form if (isset($conf['order_by_custom'])) { $conf['order_by'] = $conf['order_by_custom']; } if (isset($conf['order_by_inside_category_custom'])) { $conf['order_by_inside_category'] = $conf['order_by_inside_category_custom']; } include(PHPWG_ROOT_PATH.'include/user.inc.php'); if (in_array( substr($user['language'],0,2), array('fr','it','de','es','pl','hu','ru','nl') ) ) { define('PHPWG_DOMAIN', substr($user['language'],0,2).'.piwigo.org'); } elseif ('zh_CN' == $user['language']) { define('PHPWG_DOMAIN', 'cn.piwigo.org'); } else { define('PHPWG_DOMAIN', 'piwigo.org'); } define('PHPWG_URL', 'http://'.PHPWG_DOMAIN); if(isset($conf['alternative_pem_url']) and $conf['alternative_pem_url']!='') { define('PEM_URL', $conf['alternative_pem_url']); } else { define('PEM_URL', 'http://'.PHPWG_DOMAIN.'/ext'); } // language files load_language('common.lang'); if ( is_admin() || (defined('IN_ADMIN') and IN_ADMIN) ) { load_language('admin.lang'); } trigger_action('loading_lang'); load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, array('no_fallback'=>true, 'local'=>true) ); // only now we can set the localized username of the guest user (and not in // include/user.inc.php) if (is_a_guest()) { $user['username'] = l10n('guest'); } // template instance if (defined('IN_ADMIN') and IN_ADMIN ) {// Admin template $template = new Template(PHPWG_ROOT_PATH.'admin/themes', $conf['admin_theme']); } else { // Classic template $template = new Template(PHPWG_ROOT_PATH.'themes', $user['theme'] ); } if ( !isset($conf['no_photo_yet']) ) { include(PHPWG_ROOT_PATH.'include/no_photo_yet.inc.php'); } if (isset($user['internal_status']['guest_must_be_guest']) and $user['internal_status']['guest_must_be_guest'] === true) { $header_msgs[] = l10n('Bad status for user "guest", using default status. Please notify the webmaster.'); } if ($conf['gallery_locked']) { $header_msgs[] = l10n('The gallery is locked for maintenance. Please, come back later.'); if ( script_basename() != 'identification' and !is_admin() ) { set_status_header(503, 'Service Unavailable'); @header('Retry-After: 900'); header('Content-Type: text/html; charset='.get_pwg_charset()); echo '<a href="'.get_absolute_root_url(false).'identification.php">'.l10n('The gallery is locked for maintenance. Please, come back later.').'</a>'; echo str_repeat( ' ', 512); //IE6 doesn't error output if below a size exit(); } } if ($conf['check_upgrade_feed']) { include_once(PHPWG_ROOT_PATH.'admin/include/functions_upgrade.php'); if (check_upgrade_feed()) { $header_msgs[] = 'Some database upgrades are missing, ' .'<a href="'.get_absolute_root_url(false).'upgrade_feed.php">upgrade now</a>'; } } if (count($header_msgs) > 0) { $template->assign('header_msgs', $header_msgs); $header_msgs=array(); } if (!empty($conf['filter_pages']) and get_filter_page_value('used')) { include(PHPWG_ROOT_PATH.'include/filter.inc.php'); } else { $filter['enabled'] = false; } if (isset($conf['header_notes'])) { $header_notes = array_merge($header_notes, $conf['header_notes']); } // default event handlers add_event_handler('render_category_literal_description', 'render_category_literal_description'); if ( !$conf['allow_html_descriptions'] ) { add_event_handler('render_category_description', 'nl2br'); } add_event_handler('render_comment_content', 'render_comment_content'); add_event_handler('render_comment_author', 'strip_tags'); add_event_handler('render_tag_url', 'str2url'); add_event_handler('blockmanager_register_blocks', 'register_default_menubar_blocks', EVENT_HANDLER_PRIORITY_NEUTRAL-1); trigger_action('init'); ?>
×
×
  • Create New...