PHP - Php Notice
Hey I updated my WAMP server the other day and I am getting al of these Errors now.
Notice: Undefined variable: ac in C:\wamp\www\xxxxx\newupdates.php on line 15 And there is about 25 of them on one page, and they are all over the place. Undoubtly it is my poor coding, but how come it never showed up before, and the site itself still works. Any help would be great, I basically wont to get rid of these Similar Tutorialshi, I need help really badly for my PHP-Postcard Script. Basically it sends the card out but the URL does not work, I get the following error message: The URL is not valid and cannot be loaded It also states that Notice: Undefined index: www.voluntary.awardspace.co.uk in /home/www/voluntary.awardspace.co.uk/Postcard.php on line 25 Notice: Undefined index: Postcard.php in /home/www/voluntary.awardspace.co.uk/Postcard.php on line 25 See Code below: <?php session_start(); //check error log ini_set('display_errors', 1); ini_set('log_errors', 1); ini_set('error_log', dirname(__FILE__) . '/error_log.txt'); error_reporting(E_ALL); // CHANGE PARAMETERS HERE BEGIN $senderName = " Holidays From Home "; // Eg.: John's Postcards $senderEmail = "chris01@voluntary.awardspace.co.uk"; // Eg.: john@postcard.com // Change only if you have problems with urls $postcardURL = "http://".$_SERVER["www.voluntary.awardspace.co.uk"].$_SERVER["Postcard.php"]; // CHANGE PARAMETERS HERE END $result = 0; $msg = ""; $msg1 = ""; $pic = ""; function displayPhotos() { global $pic; $columns = 5; $act = 0; $act1 = 0; // Open the actual directory if($handle = opendir("thumbs")) { // Read all file from the actual directory while($file = readdir($handle)) { if(!is_dir($file)) { if(isset($pic[1])) { if($pic[1] == $act1){$sel = "checked";} else{$sel = "unchecked";} } if($act == 0){echo "<tr>";} echo "<td align='center'><img src='thumbs/$file' alt='postcard'/><br/><input type='radio' name='selimg' value='$file,$act1' $sel/></td>"; $act++; $act1++; if($act == $columns){$act = 0;echo "</tr>";} } } echo "</tr>"; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> <head> <title>Micro Postcard</title> <link href= "style/style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="main"> <div class="style1" id="caption"> <div align="left" class="style1"></div> </div> <?php //makes sure form is correctly filled in if(!empty($_POST["submit"])) { if(empty($_POST["selimg"])){$msg = "Please select an image from above!";$result = 3;} else{$pic = explode(",",$_POST["selimg"]);} if(empty($_POST["email"]) && empty($result)){$msg1 = "You must enter an email address!";$result = 3;} $secCode = empty($_POST["secCode"]) ? "" : strtolower($_POST["secCode"]); if($secCode == $_SESSION["securityCode"] && $result != 3) { $filename = date("YmdGis"); $f = fopen("messages/".$filename.".txt","w+"); fwrite($f,$pic[0]."\n"); fwrite($f,$_POST['email']."\n"); fwrite($f,stripslashes($_POST["message"])."\n"); fclose($f); // Compose the mail $from = "From: $senderName <$senderEmail>\r\n"; $replay = "Reply-To: $senderEmail\r\n"; $params = "MIME-Version: 1.0\r\n"; $params .= "Content-type: text/plain; charset=iso-8859-1\r\n"; $mailtext = "You have just received a Virtual Postcard!\r\n\r\n You can pick up your postcard at the following web address:\r\n $postcardURL?show=$filename\r\n\r\n We hope you enjoy your postcard, and if you do, please take a moment to send a few yourself!\r\n\r\n Regards,\r\n Holidays From Home\r\n $postcardURL"; // Send email @mail($_POST["email"],"You've received a postcard",$mailtext,$from.$replay.$params); echo "<center> Your postcard was sent successfully!<br /><br /> <img src='images/$pic[0]' alt='postcard' /><br /><br /><br />".stripslashes($_POST["message"]). "</center>"; $result = 1; } else{if($result != 3){$result = 2;}} } if(!empty($_GET["show"])) { $file = $_GET["show"]; $content = file("messages/$file.txt"); $pic = $content[0]; unset($content[0]); unset($content[1]); foreach($content as $value){$main .= $value;} echo "<center> Your postcard!<br /><br /> <img src='images/$pic' alt='postcard' /><br /><br /><br />$main </center>"; } if((empty($result) || $result == 2 || $result == 3) && empty($_GET["show"])) { echo "<form action='#' method='post'> <table align='center'>"; displayPhotos(); echo "</table> <div style='color:#f00;font-size:16px;'>$msg</div> <h2>Fill in the Form and then click on Send Card!!</h2> <table width='100%'> <tr><td>Send to (email address):</td><td><div style='color:#f00;font-size:16px;'>$msg1</div><input type='text' name='email' size='30' value='".$_POST["email"]."' /></td></tr> <tr><td>Message:</td><td><textarea name='message' rows='10' cols='40'>".stripslashes($_POST["message"])."</textarea></td></tr> <tr><td colspan='2'>".($result == 2 ? "<p style='color:#f00;font-size:16px;'>Sorry the security code is invalid! Please try it again!</span></p>" : " ")."</tr> <tr> <td>Security code: <input class='text' name='secCode' type='text' size='10' /> </td><td><img src='securityCode.php' alt='security code' border='1' /></td> </tr> <tr><td colspan='2'> </tr> <tr><td colspan='2' align='left'><input type='submit' value='Send card!' name='submit'/></td></tr> </table> </form>"; } ?> Absolutely any help would be much appreciated. I want ot know is there a way round this problem? Here is the http://voluntary.awardspace.co.uk/Postcard.php I am absolutely desperate to solve this burning issue Well hello studies?, Well I'm new to PHP was putting into practice what you learned during the school days and I'm having errors like these This code seems to work fine in older versions of PHP, but in newer.. I get an error message... Code: [Select] $tagArray = $temp = array(); $temp = explode(',', $words); foreach($temp as $tag){ $tagArray[trim($tag)]++; } The error message is: "Notice: Undefined index: 1..." I assume I can just turn off the error reporting, but I'd really rather fix the problem. Does anyone know what's going on? Thank you. hi, can anyone tell me anything wrong with my coding as it keeps mentioned undefined index,id
Attached Files
tambahitem.php 5.08KB
1 downloads I am trying to run a count query and faced with the error: Notice: Trying to get property of non-object in Not sure how to resolve this error in these lines:
if($result->num_rows > 0){ while($row = $result->fetch_rows()){ Code: <?php $sql = "SELECT Form_Group COUNT(Presence LIKE '/') AS Present, COUNT(Presence LIKE 'N') AS Absent, FROM 'attendance'"; $result = $conn->query($sql); ?> <?php //Fetch Data form database if($result->num_rows > 0){ while($row = $result->fetch_rows()){ ?> <tr> <td><?php echo $row['Form_Group']; ?></td> <td><?php echo $row['Present']; ?></td> <td><?php echo $row['Absent']; ?></td> </tr> <?php } } else { ?> <tr> <th colspan="6">There's No data found!!!</th> </tr> <?php } ?>
Can you set php to header("Location: http://www.yoursiteshomepage.com"); if you encounter a php error or notice? I encountered one just now. i have no idea what i did and didn't fix or alter anything but i can't seem to recreate it to figure out what happenned. Just thinking about when i make my site live. I realize others have had problems with the undefined index issue, but I can't find any answer to my particular problem in any forum, anywhere. I have a form/script which uploads images with description for an artist site. There are 25 images available to upload (an artist profile image and 24 art images), and the images 1-19 upload just fine. All the images share exactly the same code. But when the processing script comes to image 20, it fails and I get the "undefined index" notice. Here is the processing code for image 19-20. Code: [Select] //There are a total of 20 other blocks of code above this one, //and they are all the same except for the image number. //Artimage19 Process Begin $artimage19 = $_FILES['artimage19']['name']; $file_size = $_FILES['artimage19']['size']; $file_temp = $_FILES['artimage19']['tmp_name']; $title19 = $_POST['title19']; $disptitle19 = stripslashes($title19); $medium19 = $_POST['medium19']; $dim19 = $_POST['dim19']; $price19 = $_POST['price19']; $file_basename = substr($artimage19, 0, strripos($artimage19, '.')); // strip extention $file_ext = substr($artimage19, strripos($artimage19, '.')); $allowed_extensions['ext']= array('jpeg','jpg','gif','png'); if(!$allowed_extensions){ echo "Artimage19 file extension not allowed."; }else{ $file_ext = strtolower($file_ext); $random = rand(0000, 9999); $new_file_name19 = $surname.$random. '.' .$file_ext; } if($file_size > MAX_SIZE*1024) { echo 'ARTIMAGE19 FILE SIZE TO LARGE<BR />'; } if(move_uploaded_file($file_temp, "$filepath/$new_file_name19")) { //echo '<h3>Upload Successful!</h3>'; } else { echo '<h3>ERROR IN UPLOADING ARTIMAGE19</h3>'; } //Artimage19 Process Ends //Artimage20 Process Begin $artimage20 = $_FILES['artimage20']['name']; $file_size = $_FILES['artimage20']['size']; $file_temp = $_FILES['artimage20']['tmp_name']; $title20 = $_POST['title20']; $disptitle20 = stripslashes($title20); $medium20 = $_POST['medium20']; $dim20 = $_POST['dim20']; $price20 = $_POST['price20']; $file_basename = substr($artimage20, 0, strripos($artimage20, '.')); // strip extention $file_ext = substr($artimage20, strripos($artimage20, '.')); $allowed_extensions['ext']= array('jpeg','jpg','gif','png'); if(!$allowed_extensions){ echo "Artimage20 file extension not allowed."; }else{ $file_ext = strtolower($file_ext); $random = rand(0000, 9999); $new_file_name20 = $surname.$random. '.' .$file_ext; } if($file_size > MAX_SIZE*1024) { echo 'ARTIMAGE20 FILE SIZE TO LARGE<BR />'; } if(move_uploaded_file($file_temp, "$filepath/$new_file_name20")) { //echo '<h3>Upload Successful!</h3>'; } else { echo '<h3>ERROR IN UPLOADING ARTIMAGE20</h3>'; } //Artimage20 Process Ends Artimage19 uploads just fine, but Artimage20 fails. The $filepath is set correctly, as it uploads all previous image files. The code for the submitting code is fine also. Here is the code that submits the data. Code: [Select] //The form header is below <form action="pdregisterres.php" method="POST" enctype="multipart/form-data" onSubmit="return checkrequired(this)"> //there are 18 others above this plus one for an artist profile image <tr><td colspan = "2"><hr></td></tr> <tr><td align = "left">Art Image 19:</td><td align = "left"><input type = "file" name = "artimage19"></td></tr> <tr><td align = "left">Title:</td><td align = "left"><input type = "text" name = "title19"></td></tr> <tr><td align = "left">Medium:</td><td align = "left"><input type = "text" name = "medium19"></td></tr> <tr><td align = "left">Dimensions:</td><td align = "left"><input type = "text" name = "dim19"></td></tr> <tr><td align = "left">Price:</td><td align = "left"><input type = "text" name = "price19"></td></tr> <tr><td colspan = "2"><hr></td></tr> <tr><td align = "left">Art Image 20:</td><td align = "left"><input type = "file" name = "artimage20"></td></tr> <tr><td align = "left">Title:</td><td align = "left"><input type = "text" name = "title20"></td></tr> <tr><td align = "left">Medium:</td><td align = "left"><input type = "text" name = "medium20"></td></tr> <tr><td align = "left">Dimensions:</td><td align = "left"><input type = "text" name = "dim20"></td></tr> <tr><td align = "left">Price:</td><td align = "left"><input type = "text" name = "price20"></td></tr> For some reason that I can't get, the form stops processing after Artimage19 and gives me this: Notice: Undefined index: artimage20 in /home/www/artistsofeureka.info/members/pdregisterres.php on line 1046 I also get the error message: ERROR IN UPLOADING ARTIMAGE20 I get this for images 20-24. Since the code for all image processing is exactly the same (except for image #), I can't see why it stops at #19. These images are being uploaded to a folder on my server and a mysql db. Images up to #19 upload just fine. Any comments, questions or helpful advice? I am trying to use absolute path across my project excluding the domain as of now and I am trying to do it as follows: Code: [Select] define('root', '/php_projects/myproject/'); // The Standard Data $path = "path.php"; $connectvars = "connectvars.php"; // The CSS Styles $reset_css = root . "view/reset.css"; $style_css = root . "view/style.css"; This works so far, the only problem I am having is that it is producing a notice. And my question is, how can I get rid of the notice? The notice is this one: Code: [Select] Notice: Constant root already defined in C:\xampp\htdocs\php_projects\myproject\path.php on line 3 Why does the notice get produced in first place? I never defined it twice, as it states. while i am coding to find text between some html tags ,, am getting an error... Notice: Undefined offset: 1 in D:\xamp\xampp\htdocs\file\dash.php on line 48 my code is at line 47 and 48 is Code: [Select] preg_match('/<td class="trow1" rowspan="3" valign="top">(.*)<\/td> /',$dat,$regs); echo $etc=$regs[1]; i am thinking copy data from Code: [Select] </td> <td class="trow1" rowspan="3" valign="top"> Posts per day: <strong>6.03</strong><br /> Threads per day: <strong>3.78</strong><br /> Members per day: <strong>4.76</strong><br /> Posts per member: <strong>1.27</strong><br /> Replies per thread: <strong>0.6</strong> </td> </tr> this much Code: [Select] Posts per day: <strong>6.03</strong><br /> Threads per day: <strong>3.78</strong><br /> Members per day: <strong>4.76</strong><br /> Posts per member: <strong>1.27</strong><br /> Replies per thread: <strong>0.6</strong> Google has failed me once again . I'm getting this error, which I can't find out how to fix: Here's the code: $Database_Factions = "factions"; $Database_Factions_1 = "Name"; $Database_FName_Num = 1; $searchmemberdata = mysql_query("SELECT " . $Database_Factions_1 . " FROM " . $Database_Factions . " WHERE " . $Database_Factions_1 . " LIKE '" . mysql_real_escape_string($_GET['name']) . "%' LIMIT 1"); $searchdata = mysql_fetch_row($searchmemberdata); echo($searchdata[$Database_FName_Num]); echo("<meta http-equiv='refresh' content='55;url=member.php?action=ViewFaction&name=" . $searchdata[$Database_FName_Num] . "' />"); I know my code is not optimized, I'm fixing it after i'm done with what i'm doing. Everytime $searchdata[$Database_FName_Num] is called, the error: Notice: Undefined offset: 1 comes out. Any help? Hi, I was wondering if someone can help me, I keep getting these errors. Notice: Undefined property: stdClass::$vOptionType in /default/commonFunctions.php on line 267 That is the line from the file. if($rsOptions[$j]->vOptionType=='colour_fromcsv' || $rsOptions[$j]->vOptionType=='size_fromcsv') I was wondering if someone could tell me what it means and possible point me in the right direction on how to fix the issue. Thanks, Jordan I have a form and a validation both on the same page, however I'm getting notices since I have undefined variables. How do I get around this? Notice: Undefined index: submit in C:\xampp\htdocs\5dollar\register.php on line 10 Notice: Undefined index: password in C:\xampp\htdocs\5dollar\register.php on line 12 Notice: Undefined index: repeatpassword in C:\xampp\htdocs\5dollar\register.php on line 13 Notice: Undefined index: paypalemail in C:\xampp\htdocs\5dollar\register.php on line 14 $submit = $_POST['submit']; $password = strip_tags($_POST['password']); $repeatpassword = strip_tags($_POST['repeatpassword']); $paypalemail = strip_tags($_POST['paypalemail']); Notice: Undefined index: category in C:\xampp\htdocs\content\cron\check_deposits.php on line 18
Notice: Undefined index: confirmations in C:\xampp\htdocs\content\cron\check_deposits.php on line 19
Notice: Undefined index: address in C:\xampp\htdocs\content\cron\check_deposits.php on line 20
Notice: Undefined index: amount in C:\xampp\htdocs\content\cron\check_deposits.php on line 21
Notice: Undefined index: txid in C:\xampp\htdocs\content\cron\check_deposits.php on line 22
<?php // CRON must be running every minute! $included=true; include '../../inc/db-conf.php'; include '../../inc/wallet_driver.php'; $wallet=new jsonRPCClient($driver_login); include '../../inc/functions.php'; $deposits=mysql_query("SELECT * FROM `deposits`"); while ($dp=mysql_fetch_array($deposits)) { $received=0; $txid=''; $txs=$wallet->listtransactions('',2000); $txs=array_reverse($txs); foreach ($txs as $tx) { if ($tx['category']!='receive') continue; if ($tx['confirmations']<1) continue; if ($tx['address']!=$dp['address']) continue; $received=$tx['amount']; $txid=$tx['txid']; break; } if ($received<0.00000001) continue; $txid=($txid=='')?'[unknown]':$txid; if ($dp['received']==1) { mysql_query("UPDATE `deposits` SET `confirmations`=`confirmations`+1 WHERE `id`=$dp[id] LIMIT 1"); if (++$dp['confirmations']>=6) { $delExed=false; do { $delExed=mysql_query("DELETE FROM `deposits` WHERE `id`=$dp[id] LIMIT 1"); } while ($delExed==false); mysql_query("UPDATE `players` SET `balance`=TRUNCATE(ROUND((`balance`+$received),9),8) WHERE `id`=$dp[player_id] LIMIT 1"); mysql_query("INSERT INTO `transactions` (`player_id`,`amount`,`txid`) VALUES ($dp[player_id],$dp[amount],'$dp[txid]')"); } continue; } mysql_query("UPDATE `deposits` SET `received`=1,`amount`=$received,`txid`='$txid' WHERE `id`=$dp[id] LIMIT 1"); } mysql_query("DELETE FROM `deposits` WHERE `time_generated`<NOW()-INTERVAL 7 DAY"); ?>For some reason I am getting all these errors, and I cannot figure out why? Is there anyone out there that thinks they know what is wrong with it? Hello all - am looking for help with dynamic links in PHP not returning data and coughing out "Notice: Undefined variable: row in /home/jj3wg2td/public_html/Uni More Info.php on line 200" The initial search is being fed from a mysql into table of results in another page ('ViewMore' being a column in my database and 'UniversityCourses' being the trigger to search that column): echo "<td class='result'><a href='Uni More Info.php?ID={$row['UniversityCourses']}'>{$row['ViewMore']}</a></td>"; This is working fine as I can see the various links changing when you hover over them in the table. clicking the links goes to "Uni More Info.php" where my PHP code is: <?php session_start(); ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); //Connect to the database $mysqli = new mysqli("localhost", "jj3wg2td_wix", "MYPASSWORD", "MYDATABASE"); if(isset($_GET['post'])){ $ID=mysqli_real_escape_string($mysqli, $_GET['ID']); $sql="SELECT * FROM uni2020 WHERE UniversityCourses='$ID'"; $result=mysqli_query($mysqli,$sql) or die ("Bad Query: $sql"); $row=mysqli_fetch_array($result); if(isset($_GET['post'])){ $Website=mysqli_real_escape_string($mysqli,$_GET['Website']); $UcasPointsRequired=mysqli_real_escape_string($mysqli,$_GET['UcasPointsRequired']); $OverallScore=mysqli_real_escape_string($mysqli,$_GET['OverallScore']); $sql= "INSERT INTO UniversityCourses (Website, UcasPointsRequired) VALUES ('$Website', $UcasPointsRequired');"; $result=mysqli_query($mysqli,$sql) or die ("Bad Query: $sql"); } } ?> <content> <?php echo $row['Website']?> <?php echo $row['UcasPointsRequired']?> <?php echo $row['OverallScore']?> </content> The error codes are showing:
Notice: Undefined variable: row in /home/jj3wg2td/public_html/Uni More Info.php on line 200 Which is the section in-between the <content></content> tags. Reading up into "Undefined Variable", it suggest that I havent "Declared the variables", but isn't that this section?: if(isset($_GET['post'])){ $Website=mysqli_real_escape_string($mysqli,$_GET['Website']); $UcasPointsRequired=mysqli_real_escape_string($mysqli,$_GET['UcasPointsRequired']); $OverallScore=mysqli_real_escape_string($mysqli,$_GET['OverallScore']); I am new to PHP and am learning as I go along....but yet again...I'm stumped! Any help is very much appreciated (again)!!!!
Steven this is my code im getting an error message Notice: Undefined offset: 20 in C:\wamp\www\examples\ideas\new2.php on line 33 Code: [Select] <?php echo "<table>\n"; //Move through a CSV file, and output an associative array for each line ini_set("auto_detect_line_endings", 1); $current_row = 1; $d=0; $handle = fopen("widget.csv", "r"); while ( ($data = fgetcsv($handle, 10000, ",") ) !== FALSE ) { $number_of_fields = count($data); echo "<thead>\n<tr>"; if ($current_row == 1) { //Header line /* for ($c=0; $c < $number_of_fields; $c++) */ { $header_array[$d] = $data[$d]; echo "<th>" . $data[$d] . "</th>"; } echo "</tr>\n</thead>\n\n<tbody>"; } else { //Data line for ($c=1; $c < $number_of_fields; $c++) echo "<tr>"; { $data_array[$c] = $data[$c]; /* echo "<td>" . $data[$c] . "</td>"; */ } echo "</tr>\n"; } $current_row++; } fclose($handle); echo "</tbody>\n</table>"; echo $number_of_fields; echo "<br />"; echo $current_row; ?> this is my csv file Quote A,Airlie Beach,Andergrove,Alexandra,Armstrong Beach,Alligator Creek,,,,,,,,,,,,,, B,Bucasia,Blacks Beach,Beaconsfield,Bakers Creek,Balberra,Bloomsbury,Breadalbane,Ball Bay,Belmunda,,,,,,,,,, C,Cannonvale,Calen,Crystal Brook,Cremorne,Chelona,Campwin Beach,Cape Hillsborough,Conway,,,,,,,,,,, D,Dows Creek,Dumbleton,Dolphin Heads,,,,,,,,,,,,,,,, E,Eimeo,Eton,Erakala,,,,,,,,,,,,,,,, F,Foulden,Foxdale,Flametree,Farleigh,Freshwater Point,,,,,,,,,,,,,, G,Glen Isla,Glenella,,,,,,,,,,,,,,, ,, H,Homebush,Hampden,,,,,,,,,,,,, ,,,, I,,,,,,,,,,,,,,, ,,,, J,Jubilee Pocket,,,,,,,,,,,,,, ,,,, K,Kinchant Dam,Kolijo,Koumala,Kuttabul,,,,,,,,,,, ,,,, L,Laguna Quays,,,,,,,,,,,,,, ,,,, M,McEwens Beach,Mackay,Mackay Harbour,Mandalay,Marian,Mia Mia,Middlemount,Midge Point,Mirani,Moranbah,Mount Charlton,Mount Jukes,Mount Julian,Mount Marlow,Mount Martin,Mount Ossa,Mount Pelion,Mount Pleasant,Mount Rooper N,Narpi,Nebo,Nindaroo,North Eton,,,,,,,,,,,,,,, O,Oakenden,Ooralea,,,,,,,,,,,,,,,,, P,Palmyra,Paget,Pindi Pindi,Pinevale,Pioneer Valley,Pleystowe,Preston,Proserpine,,,,,,,,,,, Q,,,,,,,,,,,,,,,,,,, R,Racecourse,Richmond,Riordanvale,Rosella,Rural View,,,,,,,,,,,,,, S,St Helens Beach,Sandiford,Sarina,Seaforth,Slade Point,Shoal Point,Shute Harbour,Shutehaven,Strathdickie,Sugarloaf,Sunnyside,,,,,,,, T,Te Kowai,The Leap,,,,,,,,,,,,,,,,, U,,,,,,,,,,,,,,,,,,, V,Victoria Plains,,,,,,,,,,,,,,,,,, W,Wagoora,Walkerston,Woodwark,,,,,,,,,,,,,,,, X,,,,,,,,,,,,,,,,,,, Y,Yalboroo,,,,,,,,,,,,,,,,,, Z,,,,,,,,,,,,,,,,,,, Could anyone please help little stuck on why its causing this error. Hi, I'm testing my PHP in the console and was wondering what this means? PHP Notice: Undefined offset: 1 Is it a warning or an error? My code... Code: [Select] $form_submission = "brother"; $lines = file('eo_dic.txt'); if ($form_submission == null){ // Sanitization. echo 'Text field is empty!'; exit; } foreach ($lines as $line) { list($field1, $field2) = preg_split('/=/', $line); // back slash might not be needed if (stristr($field1, $form_submission) || stristr($field2, $form_submission)){ echo $field1 . ' = ' . $field2; } } The results and error... Code: [Select] Brother = frato Brotherhood = frateco Brotherly = frata PHP Notice: Undefined offset: 1 in /home/asdf/Dev/Projects/eo_translate/script_part2.php on line 50 PHP Notice: Undefined offset: 1 in /home/asdf/Dev/Projects/eo_translate/script_part2.php on line 50 PHP Notice: Undefined offset: 1 in /home/asdf/Dev/Projects/eo_translate/script_part2.php on line 50 PHP Notice: Undefined offset: 1 in /home/asdf/Dev/Projects/eo_translate/script_part2.php on line 50 Line 50 = list($field1, $field2) = preg_split('/=/', $line); I got this error when i click update button Notice: Undefined index: name in C:\wamp\www\mariyano\New Folder - Copy\New\update.php on line 14 Notice: Undefined index: mobile in C:\wamp\www\mariyano\New Folder - Copy\New\update.php on line 14 Notice: Undefined index: email in C:\wamp\www\mariyano\New Folder - Copy\New\update.php on line 14 Unknown column 'diwakar' in 'where clause' Code: [Select] <?php $cn=mysql_connect("localhost","root",""); mysql_select_db("super",$cn); if(isset($_POST['submit'])) { //checks cookies to make sure they are logged in if(isset($_COOKIE['ID_my_site'])) { $username = $_COOKIE['ID_my_site']; $qy="UPDATE users SET name='$_POST[name]', email='$_POST[mobile]', city='$_POST[email]' WHERE username=$username "; mysql_query($qy,$cn) or die(mysql_error()); } } ?> Code: [Select] <?php $cn=mysql_connect("localhost","root",""); mysql_select_db("super",$cn); //checks cookies to make sure they are logged in if(!isset($_COOKIE['ID_my_site'])) { header("Location: login.php"); } echo "<h3>Profiles</h3><br/><br/>"; echo "Name: <input type=\"text\" name=\"name\" > "; echo "<br/>"; echo "Email: <input type=\"text\" name=\"email\"> "; echo "<br/>"; echo "City: <input type=\"text\" name=\"city\"> "; //echo "<br/><br/><input type=\"submit\" value=\"Update\" >"; //echo "<br/><br/><a href=logout.php>Logout</a>"; ?> <html> <form action='update.php' method='post'> <br/> <input type='submit' name='submit' value='Update' > <br/><br/><a href=logout.php>Logout</a> </form> </html> I don't know why I am getting an undefined variable when the url is define. look at the deleteid=6 it means it is defined and in the code it is written as below URL Quote http://www.ppp.com/storeprueba/storeadmin/inventory_list.php?deleteid=6 Code: [Select] <?php if(isset($_GET['deleteid'])){ //which is clearly active in the url then get it, /* line 27 ===> */ echo'Do you really want to delete pdoruct with ID of '. $GET ['deleteid'] . '? <a href="inventory_list.php?yesdelete=' . $GET ['deleteid'] . '">Yes</a> |<a href="inventory_list.php"> No</a>'; exit(); } if (isset($_GET['yesdelete'])) { // remove item from system and delete its picture // delete from database $id_to_delete = $_GET['yesdelete']; $sql = mysql_query("DELETE FROM products WHERE id='$id_to_delete' LIMIT 1") or die (mysql_error()); // unlink the image from server // Remove The Pic ------------------------------------------- $pictodelete = ("../inventory_images/$id_to_delete.jpg"); if (file_exists($pictodelete)) { unlink($pictodelete); } header("location:inventory_list.php"); exit(); } ?> the echo Code: [Select] <?php echo 'Do you really want to delete pdoruct with ID of '. $GET ['deleteid'] . '? <a href="inventory_list.php?yesdelete=' . $GET ['deleteid'] . '">Yes</a> |<a href="inventory_list.php"> No</a>'; ?> won't display the . $GET ['deleteid'] . after "Do you really want to delete product with ID of which is 6 but it won't display the number six with the actual configuration, instead it display it like Quote Notice: Undefined variable: GET in /home3/nyhungry/public_html/storeprueba/storeadmin/inventory_list.php on line 27 Notice: Undefined variable: GET in /home3/nyhungry/public_html/storeprueba/storeadmin/inventory_list.php on line 27 Do you really want to delete pdoruct with ID of ? Yes | No Notice not number in between 'ID of' and '?' Hello! Help me please!
My site nice work on php version 5.2.12, but now php version is changed to 5.2.17 and some code is not working.
It showing error:
"Notice: Undefined variable: newCode in ....../humancheck.php on line 29"
In file humancheck.php on line 29:
for($i=0; $i<$config_max_digits;$i++) $newCode = $newCode.rand(0,9);This variable, it seems, taken from another file - humancheck_showcode.php: session_start(); $newCode = $HTTP_SESSION_VARS["newCode"];And, in index.php file at the beginning of the file written: require ('human_check/humancheck.php');And, in index.php file below is written: <IMG src="humancheck_showcode.php">When I call the index.php file it shows error. So, I think, that variable "newCode" should be taken from file humancheck_showcode.php, but it don't do that. |