PHP - Friend-request Script With An Error Hidden Somewhere I Cant Find... Help Please
Im working on a "Friend-request"-script, but something is wrong in my "answer"-script... See the script below: Code: [Select] if (isset($_POST['submit_ansReq_answer'])) { $answer = $_POST['ansReq_what']; $uid= $_SESSION['userid']; $fid= $_POST['fid']; $db=friend_db; $dbname=bannaky_basic; include('config.php'); ///////////// IF ACCEPTED if ($answer == "acceptReq") { $reqStat = "YES"; $reqEcho = "Answered YES"; } ///////////// ELSE IF DENIED else if ($answer == "denyReq") { $reqStat = "NO"; $reqEcho = "Answered NO"; } $query = "UPDATE $db SET req_accept='$reqStat' WHERE friend_id='$uid' AND user_id='$fid'"; mysql_query($query); echo "$reqEcho"; If the user hits the Accept-button, everything works fine and is registered in the SQL database. But when hitting the Deny-button nothing happens... I get to the page and $regEcho works, but $reqStat=NO; wont save in the SQL database... Probably a simple solution to this that im not seeing.... Please help me out before i loose my mind. Similar TutorialsI have a php script wihich updates data in mysql db named 'trial' and table named 'tab' I am using jquery and ajax to update the db. but the script is not working. edit-profile.php <code> <?php session_start(); $img=$_SESSION['img']; ?> <html> <head> <title>Tgmc</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link href="default.css" rel="stylesheet" type="text/css" media="screen" /> <script type="text/javascript" src="jquery-1.5.min.js"> </script> <script type="text/javascript"> $(function(){ $('#submit').click(function(){ $('#load').append('<img src="ajax-loader.gif" id="loading" alt="image" />'); var about= $('#about').val(); var contact= $('#contact').val(); var present= $('#present').val(); var inter= $('#inter').val(); var high= $('#high').val(); var books= $('#books').val(); var sports= $('#sports').val(); var pastime= $('#pastime').val(); var interest= $('#interest').val(); console.log (about); $.ajax({ url:'update-profile.php', type:'POST', data: 'contact=' + contact + '&about=' + about + '&present=' + present + '&inter=' + inter + '&high=' + high + '&books=' + books + '&sports=' + sports + '&pastime=' + pastime + '&interest=' +interest, success: function(result){ $('#response').remove(); $('#load').append('<p id="response">' + result + '</p>'); $('#loading').fadeOut(500,function(){ $(this).remove(); }); } }); return false; }); }); </script> </head> <body> <!-- start header --> <div id="wrapper"> <div id="header"> <div id="logo"> <h1><a href="#">ABC</a></h1> <p><a href="#">cinemas</a></p> </div> <?php { if(isset($_SESSION['name'])){ echo "<p id=\"welcome\">"; echo "Welcome ".$_SESSION['name']; echo " "; echo "<a href=\"logout.php\">"; echo "Logout"; echo "</a>"; echo "</p>"; } }?> </div> </div> <!-- end header --> <!-- star menu --> <div id="menu"> <ul> <li class="current_page_item"> <?php { if(isset($_SESSION['name'])){ echo "<a href=\"index1.php\">Home</a></li>"; } else{ echo "<a href=\"index.html\">Home</a></li>";}} ?> <li><a href="shows.php">Shows</a></li> <li><a href="umovies.php">Upcoming Movies</a></li> <li><a href="#">Reviews</a></li> <li><a href="#">Book Tickets</a></li> <li><a href="contact.html">Contact</a></li> </ul> </div> <!-- end menu --> <!-- start page --> <div id="page"> <!-- start ads --> <!-- end ads --> <!-- start content --> <div id="content"> <div class="post"> <div class="title"> <h2>My Profile <a href="edit-profile.php">Edit Profile</h2></a> </div> <div class="entry"> <form action="update-profile.php" method="post"> <p style="color:white"><a href="upload.php">Change photo</a><br/> <img src=<?php echo $_SESSION['img'] ?> width='120px' height='140px' class='left' alt='image' /> <strong>Contact:-</strong><input type="text" name="contact" id="contact" value="<?php echo $_SESSION['contact']; ?>" /><br/> About:-<textarea name="about" id="about" rows="5" cols="38" ><?php echo $_SESSION['about']; ?> </textarea><br/> </p> </div> <p style="color:white">Education:<br/> <strong>Present:-</strong> <input type="text" id="present" name="present" size="25" value="<?php echo $_SESSION['present']; ?>" /> <br/> <strong>Inter:- </strong><input type="text" id="inter" name="inter" size="25"value="<?php echo $_SESSION['inter']; ?>" /><br/> <strong>High School:-</strong><input type="text" id="high" name="high" size="25" value="<?php echo $_SESSION['high']; ?>" /><br/> <br><br> <strong>Favourite Books:-</strong><input type="text" id="books" name="books" size="30" value="<?php echo $_SESSION['books']; ?>" /><br/> <strong>Favourite Sport:-</strong><input type="text" id="sports" name="sports" size="30" value="<?php echo $_SESSION['sports']; ?>" /><br/> <br/><br/> <strong>Pastimes:-</strong><input type="text" name="pastime" id="pastime" size="25" value="<?php echo $_SESSION['pastime']; ?>" /><br/> <strong>Interests:-</strong><input type="text" name="interest" id="interest" size="25" value="<?php echo $_SESSION['interests']; ?>" /><br/><br/> <input type="submit" id="submit" value="Update" /> <div id="load></div> </form> </div> <!-- end page --> <!-- start footer --> <div id="footer"> <p class="legal"> ©2010ABC Cinemas. All Rights Reserved. • Design by <a href="#/">Pulkit</a> </p> <p class="links"> <a href="http://validator.w3.org/check/referer" class="xhtml" title="This page validates as XHTML">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a> • <a href="http://jigsaw.w3.org/css-validator/check/referer" class="css" title="This page validates as CSS">Valid <abbr title="Cascading Style Sheets">CSS</abbr></a> </p> </div> </div> <!-- end footer --> </body> </html> </code> update-profile.php <code> <?php session_start(); $connection=mysql_connect("localhost","root",""); mysql_select_db("TRIAL",$connection); if(mysql_query("UPDATE tab SET about='$_POST[about]',contact='$_POST[contact]',present='$_POST[present]',inter='$_POST[inter]',high='$_POST[high]',books='$_POST[books]',sports='$_POST[sports]',pastime='$_POST[pastime]',interests='$_POST[interest]' WHERE name='$_SESSION[name]'")){ echo "Successfully uploaded the data.<a href='index.php'>Click here</a> to return back."; } else echo "Unable to upload"; ?> </code> I have a simple tell a friend script that works fine for the moment. its a simple.... $email = $_POST['email']; { mail("$email","Request","Dear Member, \n\nbla bla bla bla bla\n\n\n\n"); } I have an issue now though. The form now needs to be able to send 5 separate emails to 5 different people. How would this be done or is this even possible with the code I have? $email1 = $_POST['email1']; $email2 = $_POST['email2']; Hey everyone, I'm currently working on a friends online script and i have a slight problem that i need help with. Basically the code first searches "TBL_Friends" to see if you have any friends added. If it returns results it then turns your friends ID's into a variable. It then searches "TBL_Users_Online" to see if any body is logged based on the friend's ID it returned before. The first bit of the code works and it retrieves all the friends i got added. The second half is odd, if i have one or two friends added it will show that one is online. If i have more then three friends added it returns no results. I know my code is a bit sloppy and probably not the best way of writing it, im still learning PHP. Anyways this is the code, any help is appreciated. Code: [Select] <?php $FriendsOnline = mysql_query("SELECT Sender_ID FROM TBL_User_Friends WHERE Reciever_ID = $UserID"); while($fo=mysql_fetch_array($FriendsOnline)) { $FriendsOnlineID = $fo[Sender_ID]; $FriendsOnlineNumber = mysql_query("SELECT * FROM TBL_Users_Online WHERE User_ID = $FriendsOnlineID"); $FriendsNumber = mysql_num_rows($FriendsOnlineNumber); echo $FriendsNumber; } ?> $SenderID = Friends ID $Reciever_ID = User ID $UserID = User ID hey, I get this error on line 69 which is the end of my code, but I just can't find the missing or wrong curly bracket :s <!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=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <p> <?php if(isset($_POST['_submit_check'])){ if($form_errors = validate_form()){ show_form($form_errors);} else{ process_form();}} else{ show_form();} function process_form(){ print "Hello, ".$_POST['user'];} if(array_key_exists('user', $_POST)){ process_form();} else{ show_form(); } function validate_form(){ $errors = array(); if(strlen($_POST['user']) < 1){ $errors[] = 'Your name must be at least 1 letter long.'; } return $errors;} if(array_key_exists('_submit_check', $_POST)){ if(validate_form()){ proces_form(); } else{ show_form();} } else{ show_form(); } function show_form($errors = ''){ if($errors){ print 'please correct these errors: <ul><li>'; print implode('</li><li>', $errors); print '</li></ul>'; } print<<<_HTML_ <form method = "POST" action="$_SERVER[PHP_SELF]"> Your name: <input type="text" name="user"> </br> <input type="submit" value="Verzenden"/> </br> <input type="hidden" name="_submit_check_" value="1"> </form> _HTML_; } ?> </p> </body> </html> Hi, long story short a webhost has renewed my hosting for 12 months even though my auto renewal was OFF and I did not authorise a renewal, despite the fact I had not even used the hosting for ~8 months, so clearly I was not interested in renewing.. but they are money grabbing and are ignoring my emails and just copy and paste their "cancellation policy" which is ridiculous.
So seeing as they aren't cancelling my account, I want to make a PHP script to fully maximize the server resources. An infinite loop of whatever uses the most memory/cpu/network so they will CANCEL my account. Can anyone help? What is the best way to waste/maximize/slow down a web server? I would appreciate any help.
Thanks! Hello I am a total beginner and don't know first thing about php, but still trying to figure this out. So what I am trying to achieve is, send a http request from a software to my website with a ticket number, is it possible in php to receive that request and show it on a different webpage of the same site? It would be helpful if you can point me to some related articles. Hi, Could somebody please explain to me why the following code returns a 400 error. I've been sitting looking at it for hours and I can't see anything wrong with it, but then again I don't know too much about cURL. Code: [Select] <?php // INSTANTIATE CURL. $curl = curl_init(); // CURL SETTINGS. curl_setopt($curl, CURLOPT_URL, "http://twitter.com/statuses/user_timeline/96966578.xml"); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0); // GRAB THE XML FILE. $response = curl_exec($curl); // Get information about the response $responseInfo=curl_getinfo($curl); // Close the CURL connection curl_close($curl); curl_close($curl); // Make sure we received a response from Twitter if(intval($responseInfo['http_code'])==200){ // Display the response from Twitter $content .= "Success code response:". $response; }else{ // Something went wrong $content .= "Error: " . $responseInfo['http_code']; } // SET UP XML OBJECT. $xmlObjTwitter = simplexml_load_string( $response ); $content .="<h3>Your last 10 twitter posts....</h3>\n" ; $content .= "<ul> \n"; $tempCounter = 0; foreach ( $xmlObjTwitter -> item as $item ) { // DISPLAY ONLY 10 ITEMS. if ( $tempCounter < 11 ) { $content .= "<li><a href=\"{$item -> guid}\">{$item -> title}</a></li> "; } $tempCounter += 1; } $content .="</ul>\n"; echo $content ; ?> Hello I am new thought I would ask help here as I was not getting much help on another forum. I have this code Code: [Select] <?php header("content-type: text/xml"); $rssfeed = '<?xml version="1.0" encoding="UTF-8"?>'; $rssfeed .= '<rss version="2.0">'; $rssfeed .= '<channel>'; $rssfeed .= '<title>My Price Savings Coupons.com Feed</title>'; $rssfeed .= '<link>http://www.mypricesavings.com</link>'; $rssfeed .= '<description>This is coupons.com feed</description>'; $rssfeed .= '<language>en-us</language>'; $rssfeed .= '<copyright>Copyright (C) 2011 mypricesavings.com</copyright>'; function compareFeeds($a, $b){ //this function will compare the "val" array element of each $itemRSS if ($a["val"] == $b["val"]) { return 0; } return ($a["val"] < $b["val"]) ? -1 : 1; } $doc = new DOMDocument(); $doc->load('http://rss.coupons.com/xmlserve.asp?go=14520kk5210'); $arrFeeds = array(); foreach ($doc->getElementsByTagName('item') as $node) { $itemRSS = array ( 'val' => $node->getElementsByTagName('value')->item(0)->nodeValue, 'image' => $node->getElementsByTagName('image')->item(0)->nodeValue, 'link' => $node->getElementsByTagName('link')->item(0)->nodeValue, 'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue, 'exp' => $node->getElementsByTagName('activedate')->item(0)->nodeValue ); array_push($arrFeeds, $itemRSS); } usort($arrFeeds, 'compareFeeds'); foreach($arrFeeds as $itemRSS){ $descrip = '<![CDATA[ <p><a href="'.$itemRSS["link"].'"><img src="'. $itemRSS["image"].'" align="left" border="0" height="80" width="80" alt="'.$itemRSS["desc"].'"/></a></p>]]>'; $descrip .= '' .$itemRSS["desc"]; $rssfeed .= '<item>'; $rssfeed .= '<title>' . $itemRSS["desc"] . '</title>'; $rssfeed .= '<link>' . $itemRSS["link"] . '</link>'; $rssfeed .= '<pubDate>' . $itemRSS["exp"] . '</pubDate>'; $rssfeed .= '<description>'. $descrip . '</description>'; $rssfeed .= '</item>'; } $rssfeed .= '</channel>'; $rssfeed .= '</rss>'; echo $rssfeed; ?> The purpose of this code is to take http://rss.coupons.com/xmlserve.asp?go=14520kk5210 and turn it into a true RSS Feed. I currently have the php above at mypricesavings.com/coupons/couponsfeed.php I receive the error in google chrome on mac, however, in safari it does work, If I were to use RSS Graffiti on facebook it also errors Thank you for any help, Also, If there is a better more efficient way to accomplish what I am trying to do, please share with me so I may learn better Derrick this code works fine it I take out the checkboxes(repair & replace) in the html & PHP ? Code: [Select] <form name="form" action="<?php $_SERVER[PHP_SELF] ?>" method="post"> <input type="text" size="2" name="apt" id="apt" onkeyup="getResults();if(this.value.length==this.size)document.form.datereceived.focus();" />Apt<br /> <input type="text" size="25" name="name" id="name" />Name<br /> <INPUT TYPE="text" size=10 name="datereceived" onKeyUp="if(this.value.length==this.size)document.form.time.focus();">Date Received<br /> <INPUT TYPE="text" size=7 name="time">Time Received<br /> <br>Kitchen <select name="item"> <option value="kitchen blinds" selected>kitchen blinds</option> <option value="kitchen bifolds">kitchen bifolds</option> <option value="kitchen lights">kitchen light fixtures</option> <option value="kitchen bulbs">kitchen light bulbs</option> <option value="kitchen tile">kitchen tile/linoleum</option> <option value="kitchen countop">kitchen counter top</option> <option value="kitchen cabinets">kitchen cabinets</option> <option value="kitchen drawers">kitchen drawers</option> <option value="fridge">refidgerator</option> <option value="stove">stove</option> <option value="range hood">stove hood</option> <option value="kitchen sink">kitchen sink</option> <option value="under kitchensink">under kitchen sink</option> <option value="kitchen faucet">kitchen faucet</option> <option value="kitchen drain">kitchen drain</option> <option value="kitchen screens">kitchen windows & screens</option> <option value="fire extinguisher">fire extinguisher</option> <option value="kitchen wall plates">kitchen switch plates</option> <option value="kitchen outlets">kitchen electrical outlets</option> <option value="kitchen ceilings">kitchen ceiling paint</option> <option value="kitchen wallpaint">kitchen wall paint</option> </select> <br> repaired <input type=checkbox name="repair" value="Y"> replaced <input type=checkbox name="replace" value="Y"><br> </p> action<INPUT TYPE="text" size=100 name="action"><br /> <INPUT TYPE="text" size=2 name="compday" MAXLENGTH=2 onKeyUp="if(this.value.length==this.size)document.form.compmoyr.focus();"> <INPUT TYPE="text" size=7 name="compmoyr" MAXLENGTH=7 Date Completed - <font color=red>day then mm/yyyy</font <br /><br /> cost<INPUT TYPE="text" size=4 name="cost"> charge<INPUT TYPE="text" size=4 name="charge"> Order#<INPUT TYPE="text" size=4 name="ordno"> - If Insp <p> <INPUT type="submit" value="submit data" /> </p> </form><?php if (isset( $_POST['apt']) ) { $apt=$_POST['apt']; $name=$_POST['name']; $datereceived=$_POST['datereceived']; $time=$_POST['time']; $item=$_POST['item']; $repair=$_POST['repair']; $replace=$_POST['replace']; $action=$_POST['action']; $compday=$_POST['compday']; $compmoyr=$_POST['compmoyr']; $cost=$_POST['cost']; $charge=$_POST['charge']; $ordno=$_POST['ordno']; $stat = mysql_connect("localhost","root","") or die('Unable to connect to database: ' . mysql_error()); $stat = mysql_select_db("maintdb") or die('Unable to select database: ' . mysql_error()); $query = " INSERT INTO maintdata (apt,name,datereceived,time,item,repair,replace,action,compday,compmoyr,cost,charge,ordno) VALUES('$apt','$name','$datereceived','$time','$item','$repair','$replace','$action','$compday','$compmoyr','$cost','$charge','$ordno')"; echo "apt $apt data inserted</font><br /><br />"; $stat = mysql_query($query) or die('Query failed: ' . mysql_error()); mysql_close(); } ?> Hello, I'm new to this forum, but after searching for a while I'm trying to find out what script is being used on a particular site. Not sure if direct links are cool here, so I won't post it until I know, unless someone wants to private message me of course. Trying to clone the type of site for a client. Thanks for the help. jbx Hello
I'm new in PHP but I need a help If it possible.
I want to Know which domain used my php script .
For example when some one run installer or run index.php an email send to me that contain the domain name.
Or some thing like this that I used for any php code.
so thanks
I'm having trouble with my script. I'm getting pictures from the database and showing it in 3 columns and putting some information in each table location with the picture. But I made a change and now the table still works but I get a full blank page and have to scroll down to see the pictures. Can anybody see where my problem exists, it was working fine but now it doesn't. Any help would be appreciated. Thanks in advance. Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <title></title> <head> <link rel="stylesheet" href="./stylesheet/stylesheet1.css" media="screen"> <style type="text/css" media="screen">@import url("./stylesheet/stylesheet2.css");</style> </head> <body> <center><table cellspacing="5" cellpadding="5" width="800" border="1"> <?php include "connect.php"; $query = "SELECT * FROM promo_vet ORDER BY year"; $result = mysql_query($query) or die("There was a problem with the SQL query: " . mysql_error()); if($result && mysql_num_rows($result) > 0) { $i = 0; $max_columns = 3; while($row = mysql_fetch_array($result)) { // make the variables easy to deal with extract($row); // open row if counter is zero if($i == 0) echo "<tr>"; // make sure we have a valid product ALIGN='CENTER' if($year != "" && $year != null) echo "<td align='center'><a><img src=\"$picture\"></a><br>$testshot<FONT COLOR='red'><b>$year</b></FONT><br>$description <br> $boxno<br>$convertible<br>$coupe </td><BR>"; // increment counter - if counter = max columns, reset counter and close row if(++$i == $max_columns) { echo "</tr>"; $i=0; } // end if } // end while } // end if results // clean up table - makes your code valid! if($i < $max_columns) { for($j=$i; $j<$max_columns;$j++) echo "<td> </td>"; } ?> </tr> </table></center> </body> </html> line 11 the while loop <?php //include connect $connect = mysql_connect("localhost","root","") or die ("Could Not Connect To Server"); mysql_select_db('npcs') or die ("Could Not Select Database"); $query = mysql_query("SELECT * FROM npc WHERE LEVEL=1") or die ("Could Not query Database"); echo "<table width='220' border='1' align='center'><tr><th>NPC NAME</th><th>JOB DESCRIPTION</th></tr><tr><th>LEVEL</th></tr><tr><th>EXPERIENCE</th></tr><tr><th>CASH</th></tr><tr><th>REPUTATION</th></tr>" while ($row = mysql_fetch_array($query)) { //set varibles from query $npcname = $row['npcname']; $level = $row['level']; $jobdes = $row['jobdes']; $exper = $row['exper']; $cash = $row['cash']; $rep = $row['rep']; //end getting varibles echo "<tr align='center'><td>{$row['npcname']}</td><td>{$row['jobdes']}</td><td>{$row['level']}</td><td>{$row['exper']}</td><td>{$row['cash']}</td><td>{$row['rep']}</td></tr>"; } ?> Hey all, Basically I have this code which technically should work, but I have put an error in the logic somewhere and am really struggling to find it, I've been going over it for about an hour now :/ The error is that in the second part (// Enter them into the activities database if they're not already there), it won't enter them, and it won't show the word 'Randomevent1' either, so clearly somehow I have put in something to prevent it performing that step. Can anybody help me out? I'd be amazingly grateful, I have no clue how I've screwed it up. if(isset($_POST['submit'])){ $ownerid = $_SESSION['id']; // If completed = Y give an error $completeyn = "SELECT completed FROM activities WHERE playerno='$ownerid' AND activityno = '1'"; $completecheck=mysql_query($completeyn) or die(mysql_error()); while($row = mysql_fetch_array( $completecheck )) { if($row['completed'] == 'Y'){ echo 'Oops, you\'ve already done this twice today!';} else { // Enter them into the activities database if they're not already there $stepno2 = "SELECT playerno, timesdone FROM activities WHERE playerno='$ownerid' AND activityno = '1'"; $stepnoanswer2=mysql_query($stepno2) or die(mysql_error()); $num_rows2 = mysql_num_rows($stepnoanswer2); echo $num_rows2; if($num_rows2 == '0'){ $putintodb2 = mysql_query("INSERT INTO activities (playerno, activityno, timesdone) VALUES ('$ownerid', '1', '1')") or die("Error: ".mysql_error()); echo 'Randomevent1'; }else{ // If they are already there update their stepcount $updatestepcount2=("UPDATE activities SET timesdone=timesdone+'1' WHERE playerno='$ownerid' AND activityno = '1'"); $newstepcount2=mysql_query($updatestepcount2); echo 'Randomevent2';} // If this new stepcount is equal to 2, set completed to Y $checkstep = "SELECT timesdone FROM activities WHERE playerno='$ownerid' AND activityno = '1'"; $checkstepresult=mysql_query($checkstep) or die(mysql_error()); while($row = mysql_fetch_array( $checkstepresult )) { if($row['timesdone'] == '2'){ echo $row['timesdone']; $updatestepcount22=("UPDATE activities SET completed = 'Y' WHERE playerno='$ownerid' AND activityno = '1'"); $newstepcount22=mysql_query($updatestepcount22); } }}}} Hi I am trying to learn php and am working on a cms website. I keep on getting this error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[id]' at line 1 I looked at the MySql manual and cannot find what is wrong any suggestion would be greatly appreciated. Thank you. The is the line of code to link to the Edit.php page and holds the id of the post. echo "<a href=\"edit.php?id=$posts[ID]\">Edit</a>"; This is in the Edit page and it gives me the error above. <?php include('Connection.php'); $query = 'SELECT * FROM site_content WHERE ID = $_GET[id]'; $result = mysql_query($query) or die(mysql_error()); $post = mysql_fetch_array($result); ?> I cannot see the error. I'm getting syntax errors on line 61 and line 67 indicated in comments on form. What am I missing? <?php $submit = $_POST['submit']; // Form Data $email = strip_tags($_POST['email']); $salonname = strip_tags($_POST['salonname']); if ($_POST[submit]) { echo "TRUE - CONTINUE_1"; //echo $_SESSION[key].' - '.$_POST[user_code].'<br>'; if ($_SESSION[key]==$_POST[user_code]) { echo "TRUE - CONTINUE_2"; $_SESSION[key]=''; } if ($salonname); { echo "TRUE - CONTINUE_3"; $email = trim($_POST['email']); if(!checkEmail($email)) { echo 'Invalid email address!'; echo "FALSE - STOP_4"; } else { echo "TRUE - CONTINUE_4"; // RUN Database Query } }//End IF salonname = TRUE else //LINE 61 {// STOP CODE echo "FALSE - STOP_3"; }// End salonanme check else //LINE 67 {// STOP CODE echo "FALSE - STOP_2"; }// End user code }// End if Sumbit else {// STOP CODE echo "FALSE - STOP_1"; } ?> I just need another pair of eyes as I am not seeing the syntax error. I'm sure I'll figure it out right after I post this as that has happened many times before. query: <?php $sql = " INSERT INTO views (user_id,show,show_id,episode,episode_id) VALUES ( '" . $_SESSION['user']['id'] . "', '" . $showTitle . "', '" . $showID . "', '" . $episodeTitle . "', '" . $episodeID . "')"; ?> output: <?php $output = " INSERT INTO views (user_id,show,show_id,episode,episode_id) VALUES ('1','Criminal Minds','9','Episode Title','1')"; ?> error: Code: [Select] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show,show_id,episode,episode_id) VALUES ( '1', 'Criminal Minds', '9',' at line 2 I get the following error: Quote Parse error: syntax error, unexpected ';' in /hermes/web06/b1946/moo.rghollenbeck/index.php on line 35 But here is the only php code on the whole page: . . .more html code above <?php // PHP version: 5.2.12 // MySQL Version: 5.0.77 $link = mysql_connect('path', 'username', 'pword'); if (!$link) { die('Could not connect: ' . mysql_error()); } mysql_select_db(guestlist); $Users_IP_address = $_SERVER["REMOTE_ADDR"] ; echo "<input type='hidden' name='ip' value="; echo $Users_IP_address; echo ">"; $first_name=mysql_query("SELECT 'fname' FROM tblMain; WHERE 'ip'=" . $Users_IP_address); // pseudocode section: // If $first_name !null{ // echo "Hello " . $first_name; // } // end pseudocode section: // something like that ?> more html code below. . . Thank you. I'm developing a javascript widget to display on other people's websites that will have a php file(on my hosting account) as its source. Is there a way for php to get the domain of the site that is requesting the php file? I want the user to be able to specify if they want the widget to only display on their website. So i would store the user's domain name in my db and then write in the php script to check to see if the website requesting the widget matches whats in my db...if so display widget...if not..don't. Say I have... Code: [Select] <? echo("do something"); include("include_file.php"); echo("do something else"); ?> include_file.php Code: [Select] <? $a_$string = "a string"; echo($a_string); ?> I have put an error in the include_file.php an extra $ in the variable name. The first script would kick up an error that there is a problem with file include_file.php as line 3 or what ever the line may be. How can I have it so I can choose what the error message is, say a cryptic code and the line number without having the file names show as this is showing up my hidden includes folder and the file name which means that someone may try to visit this page alone and this can cause security issues. Adding in extra lines to every file to see if it is being use correctly a bit like sessions is not an option although I have looked at it as I have houndreds of files to alter in this case. I have just tried this instead of the top script but I does not show the secret code on error Code: [Select] <? echo("top"); @include("dummy.php") or die("secreterrorcode123"); echo("bottom"); ?> |