PHP - Simple Php Works In Ff But Not Ie
Hi all - I have a simple PHP app, which I've run thru my Dreamweaver validation and a few PHP syntax validators and it comes out clean. Works perfectly in Firefox but shows a blank page in I.E. and I'm not sure why. The functionality is simple - the page shows a disclaimer, and when the user hits 'OK" it should hide the disclaimer and then display other content. Here's the URL:
https://www.dca.ca.gov/webapps/bppe/annual_report.php Any ideas as to what is wrong? Thanks! Here's the code: <?php if(isset($_POST['OK'])){ ?> <h3 class="center"><a href="#a">A</a> <a href="#b">B</a> <a href="#c">C</a> <a href="#d">D</a> <a href="#e">E</a> <a href="#f">F</a> <a href="#g">G</a> <a href="#h">H</a> <a href="#i">I</a> <a href="#j">J</a> <a href="#k">K</a> <a href="#l">L</a> <a href="#m">M</a> <a href="#n">N</a> <a href="#O">O</a> <a href="#p">P</a> <a href="#q">Q</a> <a href="#r">R</a> <a href="#s">S</a> <a href="#t">T</a> <a href="#u">U</a> <a href="#v">V</a> <a href="#w">W</a> <a href="#x">X</a> <a href="#y">Y</a> <a href="#z">Z</a></h3> <h3><a name="a">A</a>:</h3> <h3><a name="b">B</a>:</h3> <h3><a name="c">C</a>:</h3> <h3><a name="d">D</a>:</h3> <h3><a name="e">E</a>:</h3> <h3><a name="f">F</a>:</h3> <h3><a name="g">G</a>:</h3> <h3><a name="h">H</a>:</h3> <h3><a name="i">I</a>:</h3> <h3><a name="j">J</a>:</h3> <h3><a name="k">K</a>:</h3> <h3><a name="l">L</a>:</h3> <h3><a name="m">M</a>:</h3> <h3><a name="n">N</a>:</h3> <h3><a name="o">O</a>:</h3> <h3><a name="p">P</a>:</h3> <h3><a name="q">Q</a>:</h3> <h3><a name="r">R</a>:</h3> <h3><a name="s">S</a>:</h3> <h3><a name="t">T</a>:</h3> <h3><a name="u">U</a>:</h3> <h3><a name="v">V</a>:</h3> <h3><a name="w">W</a>:</h3> <h3><a name="x">X</a>:</h3> <h3><a name="y">Y</a>:</h3> <h3><a name="z">Z</a>:</h3> <?php }else{ ?> <form method="post" action="annual_report.php"> <fieldset> <strong><p><strong>An Annual Report must be filed with the Bureau for Private Postsecondary Education (Bureau) by each approved institution pursuant to California Education Code (CEC) section 94934. The Institution reports the required aggregate information for all locations (main and all branches). In addition to the Annual Report, each Institution is required to submit a Performance Fact Sheet and the school catalog.</strong></p> <p><strong>The Bureau <span style="text-decoration:underline">publishes the</span> information provided in the links below <span style="text-decoration:underline">as it was submitted</span> by the institution, and does not endorse, recommend, or favor any institution whose information is published or provided</strong>.</p> <p><strong>Disclaimer of Liability</strong> <br /> The California Department of Consumer Affairs, Bureau for Private Postsecondary Education shall not be held liable for any inaccurate, altered, delayed, omitted, or misleading information, or any improper or incorrect use of the information published or provided herein, and assumes no responsibility for anyone's use of the information on any theory of liability. </p> <p><strong>Disclaimer: Links</strong> <br /> The Department of Consumer Affairs, Bureau for Private Postsecondary Education is not responsible for the contents of any off-site pages that reference, or that are referenced by, this website. The user specifically acknowledges that the Department of Consumer Affairs, Bureau for Private Postsecondary Education is not liable for any defamatory, offensive, misleading or illegal conduct of other users, links, or third parties and that the risk of injury from the foregoing rests entirely with the user. <br /> Links from this site to other sites, do not constitute an endorsement by the Department of Consumer Affairs, and are for convenience only. It is the responsibility of the user to evaluate the content and usefulness of information obtained from other sites. <br /> When you use a link to connect to another site, you are no longer on the Department of Consumer Affairs', and/or its constituent Boards’ or Bureaus’ web sites and are subject to the privacy policies and other practices of the new site. The Department of Consumer Affairs and/or its Board or Bureaus has no control over and is not responsible for the information, practices or content of these or any other sites and your participation in promotions or services of any kind with any third party found on or though this site, or your correspondence or business dealings of any kind with any third party found on or through this site are solely between you and that third party.<br /> The Department of Consumer Affairs and/or its Boards or Bureaus does not, by way of its links to other sites, endorse, adopt, recommend, promote or support products, positions, statements made or taken by parties controlling the other sites.</p> <p><strong>Choice of Law </strong><br /> Construction of the disclaimers above and resolution of disputes thereof are governed by the laws of the State of California.</p></strong> <div class="content_onecolumn"> <input type="submit" name="OK" value="OK" class="inputSubmit" /> </div> </fieldset> </form> <?php } ?> Similar TutorialsHi everyone, I'm trying to select either a class or an id using PHP Simple HTML DOM Parser with absolutely no luck. My example is very simple and seems to comply to the examples given in the manual(http://simplehtmldom.sourceforge.net/manual.htm) but it just wont work, it's driving me up the wall. Here is my example: http://schulnetz.nibis.de/db/schulen/schule.php?schulnr=94468&lschb= I think the HTML is invalid: i cannot parse it. Well i need more examples - probly i have overseen something! If anybody has a working example of Simple-html-dom-parser...i would be happy. The examples on the developersite are not very helpful. your dilbertone Hello, im very green to php and I am having trouble creating a simple log in script. Not sure why this is not working, maybe a mysql_query mistake? I am not receiving any errors but nothing gets updated in the members table and my error message to the user displays. any help is appreciated! here is my php: <?php session_start(); $errorMsg = ''; $email = ''; $pass = ''; if (isset($_POST['email'])) { $email = ($_POST['email']); $pass = ($_POST['password']); $email = stripslashes($email); $pass = stripslashes($pass); $email = strip_tags($email); $pass = strip_tags($pass); if ((!$email) || (!$pass)) { $errorMsg = '<font color="#FF0000">Please fill in both fields</font>'; }else { include 'scripts/connect_db.php'; $email = mysql_real_escape_string ($email); $pass = md5($pass); $sql = mysql_query("SELECT * FROM members WHERE email='$email' AND password='$pass'"); $log_check = mysql_num_rows($sql); if ($log_check > 0) { while($row = mysql_fetch_array($sql)) { $id = $row["id"]; $_SESSION['id']; $email = $row["email"]; $_SESSION['email']; $username = $row["username"]; $_session['username']; mysql_query("UPDATE members SET last_logged=now() WHERE id='$id' LIMIT 1"); }//Close while loop echo "You are logged in"; exit(); } else { $errorMsg = '<font color="#FF0000">Incorrect login data, please try again</font>'; } } } ?> and the form: <?php echo $errorMsg; ?> <form action="log_in.php" method="post"> Email:<br /> <input name="email" type="text" /><br /><br /> Password:<br /> <input name="password" type="password" /><br /><br /> <input name="myBtn" type="submit" value="Log In" /> </form> Hi can someone pls help, im tryin a tutorial but keep getting errors, this is the first one i get after registering. You Are Registered And Can Now Login Warning: Cannot modify header information - headers already sent by (output started at /home/aretheyh/public_html/nealeweb.com/regcheck.php:43) in /home/aretheyh/public_html/nealeweb.com/regcheck.php on line 46 With a TON of help from you guys already it's working but I do have one thing that I just need to figure out to clean it all up...
echo $games['htn']," ",$games['hs']," VS ",$games['vtn']," ",$games['vs']," on ",$games['d']," at ",$games['t'];This is returning what I need perfectly except if an object is empty it's also showing that.. for example... Pittsburgh Steelers 0 VS Baltimore Ravens 0 on Sat at 8:15 --- is what I want to show... shows up great then the next line will show an empty set because the games are not known until other games are played so I also get this: 0 VS 0 on Jan 18 at 3:05 and Seattle Seahawks 0 VS 0 on Jan 10 at 8:15 What can I do to make this not show up? $xml = simplexml_load_string($data); // print_r($xml); foreach($xml->gms->g as $games) { echo "<div class='button blue'>"; echo $games['htn']," ",$games['hs']," VS ",$games['vtn']," ",$games['vs']," on ",$games['d']," at ",$games['t']; echo "</div>"; }This is what I have and it's working with a lot of help from you guys... I just need to clean it up so I can show only games that have two teams listed.. Thanks again everyone!! Edited by cowboysdude, 02 January 2015 - 11:03 PM. Weird question, but is there a way using PHP to "check" to see if a certain URL brings up an actual real page, or if it brings up a 404 error or something? Any functions do anything like that? maybe some wiz kid out their can help me figure out whats going on here. What suppose to happen is a random site suppose to load into a iframe When the frameset code below is inside the <body> tags only the menubar shows up and not the iframe with a random site. Now when i take the code and put it oustide the <body> tag the menubar goes away and only the iframe with a random site is shown . The goal of course is to get the menubar to be visible and to have a iframe with a random site loaded into it. For some reason i can only get one of the two the happen. I do hope i explained this well enough Code: [Select] <frameset rows="80,*" BORDERCOLOR="#222222" BORDER="3"> <frame src="explore.php" name="surfbar" marginwidth="O" marginheight="0" NORESIZE SCROLLING="no" /> <frame src="<?php while ($row = mysql_fetch_array($result)){ print $row["url"];}?> " name="random" marginwidth="O" marginheight="0" noresize scrolling="auto" /> </frameset>-------------------------------------------------------------------------------------------------- Code: [Select] <?php /** * @author Brent Moeller * @copyright 2011 */ include ('functions.php'); db_connect(); $result = mysql_query("SELECT * FROM slinks where approval='1' ORDER BY RAND() LIMIT 1") or die(mysql_error()); ?> <html> <head> <title>DizzyUrl Discovery Engine</title> <link rel="stylesheet" type="text/css" href="mouseovertabs.css" /> <script src="mouseovertabs.js" type="text/javascript"> /*********************************************** * Mouseover Tabs Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more ***********************************************/ </script> </head> <body> <frameset rows="80,*" BORDERCOLOR="#222222" BORDER="3"> <frame src="explore.php" name="surfbar" marginwidth="O" marginheight="0" NORESIZE SCROLLING="no" /> <frame src="<?php while ($row = mysql_fetch_array($result)){ print $row["url"];}?> " name="random" marginwidth="O" marginheight="0" noresize scrolling="auto" /> </frameset> <div id="mytabsmenu" class="tabsmenuclass"> <ul> <li><a href="http://www.javascriptkit.com" rel="gotsubmenu[selected]">JavaScript Kit</a></li> <li><a href="http://www.cssdrive.com" rel="gotsubmenu">CSS Drive</a></li> <li><a href="http://www.codingforums.com">No Sub Menu</a></li> </ul> </div> <div id="mysubmenuarea" class="tabsmenucontentclass"> <!--1st link within submenu container should point to the external submenu contents file--> <a href="submenucontents.htm" style="visibility:hidden">Sub Menu contents</a> </div> <script type="text/javascript"> //mouseovertabsmenu.init("tabs_container_id", "submenu_container_id", "bool_hidecontentsmouseout") mouseovertabsmenu.init("mytabsmenu", "mysubmenuarea", true) </script> <noframes> <p>This Browser does not support Frames.</p> </noframes> </body> </html> I have a script to check for duplicate username's on signup. Even when there is no entry found and the script preforms the update statement, the error will come back indicating the requested name already exists. #Check to see if requested name already exists $name = $_POST['name']; $siteid = $_POST['siteid']; $checkname = mysql_query("SELECT * FROM projects WHERE url = '$name'"); $founduser = mysql_num_rows($checkname); if ($founduser != 0) { echo"$name already exists in the database. Please select another name";} if ($founduser == 0) { mysql_query("UPDATE projects SET url = '$name' WHERE siteid = $siteid"); die; echo"URL updated successfully";} If I remove the UPDATE statement and simply return an echo statement for each IF statement, everything works fine: if ($founduser != 0) { echo"$name already exists in the database. Please select another name";} if ($founduser == 0) { echo"$name is available";} So what's happening is, when $founduser == 0, the update script preforms just fine and the database is populated correctly, but then the entire script will then re-run itself and find the name that was just entered, resulting in $founduser != 0. How do I stop the script when it preforms the UPDATE statement? I tried putting die; in after the UPDATE statement, but the entire script still re-runs itself. I am pulling my hair out here... Alright this script is being stupid! Heres the Script... $gid = array($P1 = $_POST[P0] ,$P2 = $_POST[P1] ,$P3 = $_POST[P2] ,$P4 = $_POST[P3] ,$P5 = $_POST[P4] ,$P6 = $_POST[P5] ,$P7 = $_POST[P6] ,$P8 = $_POST[P7] ,$P9 = $_POST[P8] ,$P10 = $_POST[P9] ,$P11 = $_POST[P10] ,$P12 = $_POST[P11] ); $pick= array($G1 = $_POST[game1] ,$G2 = $_POST[game2] ,$G3 = $_POST[game3] ,$G4 = $_POST[game4] ,$G5 = $_POST[game5] ,$G6 = $_POST[game6] ,$G7 = $_POST[game7] ,$G8 = $_POST[game8] ,$G9 = $_POST[game9] ,$G10 = $_POST[game10] ,$G11 = $_POST[game11] ,$G12 = $_POST[game12] ); function iORu($gameF, $pickF){ $Current_user_id = $_SESSION[user_id]; $con = mysql_connect("localhost","user","pass"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("sports", $con); $query = "SELECT User_ID FROM CollegeFootballPicks WHERE User_ID='$Current_user_id' && Game_ID='$gameF'"; $result = mysql_query($query); if(mysql_num_rows($result) == 0){ $query = "INSERT INTO CollegeFootballPicks (User_ID, Game_ID, Pick) VALUES ('$Current_user_id','$gameF','$pickF')"; $result = mysql_query($query); echo'Inserted'; }else{ $query = "UPDATE CollegeFootballPicks SET User_ID = '$Current_user_id', Game_ID = '$gameF', Pick = '$pickF'"; $result = mysql_query($query); echo'Updated'; } mysql_close(); echo "<i>"; echo ' '.$Current_user_id. ' '; echo $gameF. ' '; echo $pickF. ' '; echo "</i>"; echo '<br />'; } //End of Function for($i=0; $i< 12; $i++) { iORu($gid[$i],$pick[$i]); } For testing purposes i have inserted all the echos along the way to visually see how far its getting. When i run the script it recognizes all the information when and where it's supposed to (With the echos) but its not inserting/ updating to mysql except for game 1 (i.e. the first time the function runs) Does anyone see any errors? It doesn't make sense on why all the info echos exactly right, and game one inserts and updates right. But games 2-12 don't insert or update! Before anyone says something. Yes this is the same shit i've been working on for about two weeks and have gotten help with before. I have two jobs and web design aint one of them. So if your gonna help, help! But if your gonna say something that aint in any way "help" keep it to yourself! Hai i am very much new to PHP...can any one suggest me.....which framework to follow.....
Thanks & Regards
Shankaar
Greetings to all!
Newbie here, I just signed up this morning. I have an issue with a code I have been using for several years with multiple files/directories. Until recently all of the files have worked flawlessly. Now I have one file in a directory that does not display the text I which I am attempting to call up and it was working until recently.
Every file with the same code as the errant one work flawlessly except for the errant one, and I have 11 files to be displayed on my website at https://TheLoveOfGod.org They are all listed under the Devotionals menu button except for one which is displayed on the home page. I have absolutely no training in web design, I am self taught. I began by hand typing html coding over 30 years ago and am now using Word Press with Elementor . I do not understand why this is happening. Can any of you offer assistance to resolve this. I thank you in advance for your assistance.
Edited September 25, 2020 by namednad more explanation Hi, I'm having a first attempt at sanitising code, but I'm not actually sure what I'm doing and how I know if it works. This is the code I have inserted, if I enter "description=re#d%widget" the description query ends so it displays everything 'red'. Not just everything 'red widget'. Code: [Select] $description = mysql_real_escape_string($description); $description = stripslashes($description); $description = htmlentities($description); return $var; $price = mysql_real_escape_string($price); $price = stripslashes($price); $price = htmlentities($price); return $var; Code: [Select] <?php ini_set('display_errors', 1); error_reporting(-1); $query = "SELECT * FROM productfeed"; if(isset($_GET['description']) && !empty($_GET['description'])) { $description = $_GET['description']; $query .= " WHERE description like '%$description%'"; } if(isset($_GET['price']) && !empty($_GET['price'])) { $price = explode('-', $_GET['price']); $lowPrice = (int)$price[0]; $highPrice = (int)$price[1]; $query .= " AND price BETWEEN $lowPrice AND $highPrice"; } $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { $id = $row['id']; $image = $row['awImage']; $link = $row['link']; $description = $row['description']; $fulldescription = $row['fulldescription']; $price = $row['price']; echo "<div class='productdisplayshell'> <div class='productdisplayoutline'> <div class='productborder'><center> <a href='$link' target='_blank'><img src='$image' width=\"95%\" /></a> </center> </div></div> <div class='productdescriptionoutline'> <div class='productdescriptionbox'> <a href='$link' target='_blank' >$description</a> </div> <div class='productfulldescriptionbox'>$fulldescription</div> </div> <div class='productpriceoutline'> <div class='productpricebox'> <center>&#163; $price</center> </div> <div class='productbuybutton'> <center><a href='$link' target='_blank' ><img src=/images/buybutton.png /></a></center> </div> </div> </div>"; } if ($_GET['description'] == $description ) { echo 'Sorry, this product is not available. Please visit our <a href="http://www.domain.co.uk">Homepage</a>.'; } ?> <?php function sanitizeString($description) { $description = mysql_real_escape_string($description); $description = stripslashes($description); $description = htmlentities($description); return $var; $price = mysql_real_escape_string($price); $price = stripslashes($price); $price = htmlentities($price); return $var; } ?> I don't understand why "if(isSet($_GET['sid'])) " works before it is declared in the variable name(" $name = $_GET['sid'];"). 1. How does php store the date in this get statement? 2. Is GET an array? Code: [Select] if(isSet($_GET['sid'])) { echo "<h2>Exercise</h2>"; $name = $_GET['sid']; $timein = time(); $quest=1; $nextquest=2; } else { echo "<h2>Enter Student Number:</h2>"; $quest=0; $nextquest=0; } Hi, I have tried to merge two queries into one however a piece of code keeps coming up with an error: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource. It relates to this. I cant see it doesn't work and I have tried around 10 different options but this is the nearest I can get. Can anyone advise me what the problem is and why this no longer works please? while($row = mysql_fetch_assoc($myQuery)) <?php ini_set('display_errors', 1); error_reporting(-1); if( isSet($_GET['description'])) $description = $_GET['description']; if(isSet($_GET['price'])) $price = explode('-',$_GET['price']); $low = (int)$price[0]; $high = (int)$price[1]; ($myQuery = "SELECT * FROM productfeed WHERE 1 . if(isset($description)) ' AND if description = '. $description; if(isset($price)) ' AND if price = '. $price; . "); while($row = mysql_fetch_assoc($myQuery)) { $id = $row['id']; $image = $row['awImage']; $link = $row['link']; $description = $row['description']; $fulldescription = $row['fulldescription']; $price = $row['price']; $fulldescription = substr("$fulldescription", 0, 400); echo "<div class='productdisplayshell'> <div class='productdisplayoutline'> <div class='productborder'><center> <a href='$link' target='_blank'><img src='$image' width=\"95%\" /></a> </center> </div></div> <div class='productdescriptionoutline'> <div class='productdescriptionbox'> <a href='$link' target='_blank' >$description</a> </div> <div class='productfulldescriptionbox'>$fulldescription</div> </div> <div class='productpriceoutline'> <div class='productpricebox'> <center>&#163; $price</center> </div> <div class='productbuybutton'> <center><a href='$link' target='_blank' ><img src=/images/buybutton.png /></a></center> </div> </div> </div>"; } Hi, I don't know if this is the right place, but I used a code for a dropdown menu witch works fine on the website (geloven.eu/ABK2021) who uses PHP 7.2.24, but the dropdown does NOT work on another site bijbelkamp.eu/ABK2021 who uses PHP 7.3.28. The index page just includes the menu.php (here menu.txt) and the css file bootstrap21.css (here bootstrap21.txt). Can this be some coding issue or does this have nothing to do with the code? bootstrap21.txt menu.txt I have some code that works fine on my dev server but does not work on my production server. Dev server has PHP version 5.2.5 and production server has PHP version 5.1.6. This is the part of the code that isn't working on the prod. server: $xmlDoc=new DOMDocument(); $xmlDoc->loadXML($tmpDoc); $x=$xmlDoc->getElementsByTagName('link'); //get the q parameter from URL $q=$_GET["q"]; //lookup all links from the xml file if length of q>0 if (strlen($q)>0) { $hint=""; for($i=0; $i<($x->length); $i++) { $y=$x->item($i)->getElementsByTagName('title'); $z=$x->item($i)->getElementsByTagName('url'); if ($y->item(0)->nodeType==1) { //find a link matching the search text if (stristr($y->item(0)->childNodes->item(0)->nodeValue,$q)) { if ($hint=="") { $hint="<tr><td><a href='" . $z->item(0)->childNodes->item(0)->nodeValue . "' target='_blank'>" . $y->item(0)->childNodes->item(0)->nodeValue . "</td></tr>"; } else { $hint=$hint . "<tr><td><a href='" . $z->item(0)->childNodes->item(0)->nodeValue . "' target='_blank'>" . $y->item(0)->childNodes->item(0)->nodeValue . "</a></td></tr>"; } } } } } $tmpDoc is a variable that holds database information in xml form. It basically looks like this: $tmpDoc = $tmpDoc . "<link><title>" . $row['CustomerName'] . "****" . $row['Rep'] . "****" . $row['InstallDate'] . "****" . $row['PaidDate'] . "</title><url>accountPage.php?AccNum=" . $row['AccountNum'] . "</url></link>"; ...that is inside a while loop that loops through the rows returned by a query. Basically, as I said, the whole thing works fine on my dev server but on the production server it never makes it into the for loop so I guess the condition $i<($x->length) isn't being met. I'm at a bit of a loss here. Is there anything like the PHP version or Apache version that may cause the "->" operator to not work? The prod PHP version isn't that much older than my dev PHP version so I doubt that's the issue but it's about all I can think of. Thanks! Greetings, all - Curious to know if someone wouldn't mind taking a look at this code and letting me know if there are any apparent errors that may cause this problem: I attempted sending the message to one of my two 1and1 email accounts and after some delay, it sent it to 1and1 account B but not 1and1 account A. My gmail account, however, gets them every time. I'd like to just say it's some issue with 1and1 but since it successfully got through to the one 1and1 account I'm not comfortable stopping at that. I should also mention that for some reason, as I'm trying it today, the successful 1and1 account will no longer receive the messages... I've tried it with directly copying the php mail code from 1and1's FAQ, though, and it seemed to work for the 1and1 account that was previously succcessful (acct B) but not acct A. Very stuck... Thanks $from = $_REQUEST['email']; $subject = $_REQUEST['subject']; $message = $_REQUEST['question']; mail("username@domain.com", "Subject: $subject", $message, "From: $from"); echo "Mail sent"; 1and1 FAQ with mail code: http://faq.1and1.com/scripting_languages_supported/php_mail_explained/2.html Hi all,
My company has a php site on wordpress that i’m trying to add google AD tracking to. Now, on the live site, when i’m logged into word-press and run the page, I can see the triggers firing fine on Tag assistant, if i un-comment the alerts, they also fire. When i log out of word-press and hit the page, nothing happens at all. No alerts, no google triggers, nothing in the php is running? Any ideas whats going on ?
<script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'AW-1234567897'); <?php $url = $_SERVER['REQUEST_URI']; if ($url =="/thankyou/") { print " gtag('event', 'conversion', {'send_to': 'AW-1234567897/1234567897', 'value': 1.0, 'currency': 'GBP' }); "; print " gtag('event', 'conversion', {'send_to': 'AW-1234567897/1234567897'}); "; //Print "alert('OK');"; //Print "alert('" . $url . "');"; } ?> </script> tia Dave So on my website I have a basic if statement that checks some arguments to see if a user can add another user as a friend. Well I had gotten that part down and for the longest time other people on my website have been able to use the feature. Now all of a sudden the if statement doesn't work? Why? Here is the statement: if ($privacy['privacy']['who_can_add'] == '1' AND $zext->user['id'] != '0' AND $zext->user['id'] != $u['id']) { $add_friend = $u['add_friend']; } of course if I put $add_friend outside the if statement, the button appears. How can a statment work one day but not the other? Is it an issue with my server? dump of $privacy: Code: [Select] $ => Array (4) ( | ['hide_o_status'] = Integer(1) 0 | ['who_can_view'] = Integer(1) 1 | ['who_can_add'] = Integer(1) 1 | ['who_can_contact'] = Integer(1) 1 ) dump of $zext->user['id']: Code: [Select] $ = String(2) "10" dump of $u['id']: Code: [Select] $ = String(2) "4" it all has correct information and the if statement has not been changed from before when it had worked and outputted $add_friend all day long. it worked until last night, i don't know what happened or why, php version has not been changed or anything. if anybody has any ideas on what's going on help would be much appreciated. Thanks, Matt. I have the following 2 scripts. One adds to the database and the other deletes a record from the database. Code: [Select] <form action="deletebidder.php" method="post"> <table> <tr> <td><font face ="calibri" size="4"> Add Bidder:</td> </tr> <tr> <td><input type="text" name="biddersId" /></td> </tr> <tr> <td><input type="hidden" name="addedbidder" /></td> </tr> <tr> <td><input type="Submit" value="Add"></td> </tr> </table> Second from: Code: [Select] <form name="deletebidder" action="process_bidders2.php" method="post"> <table> <tr> <td><font face= "calibri" size= "3"> Delete Bidder</font></td> </tr> <tr> <td><input type= "text" name="deletebidder" /></td> </tr> <tr> <td><input type= "hidden" name="deletebidder1" /></td> </tr> <tr> <td><input type= "submit" value= "submit" /></td> </tr> </table> </form> Both forms are on the same page. Now I have tried separate processing pages with the same results (If i get one to work the other doesn't, it's either one or the other, but they won't work together. If i have the add bidder working, the delete bidder doesn't work and visa versa?? Also, ONE IMPORTANT note is, if i try to process each form on separate pages, no matter what action "name" i give the form, it will only go to the action page that is working. Example is, I tried to process one form on deletebidder.php and the other on process_bidders2.php but it didn't matter. Both forms were processed by the deletebidder.php page. How is this even possible if I gave them both seperate action "paths"?? Code: [Select] <?php ob_start(); error_reporting(E_ALL); ini_set("display_errors", 1); $biddersId= $_POST['biddersId']; if (isset($addedbidder)) \\hidden form field { mysql_connect("$host", "$db_user", "$db_password")or die("cannot connect to server"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM bidders WHERE biddersId='$biddersId'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); if($count==0){ // Add $biddersId to DB and redirect to anypage mysql_Query("INSERT INTO bidders (biddersId) VALUES ('$biddersId')"); header("Location: attendance.php"); exit(); } } if (isset($deletebidder1)) \\hidden form field { $biddersId= $deletebidder; mysql_connect("$host", "$db_user", "$db_password")or die("cannot connect to server"); mysql_select_db("$db_name")or die("cannot select DB"); mysql_query("DELETE FROM bidders WHERE biddersId='$biddersId'"); header("Location: attendance.php"); exit(); } ob_flush(); echo "<font color= \"red\" face=\"calibri\" size=\"4\">That bidder is already logged, Please press your browsers back button and try again.</font>"; ?> |