Jump to content

dsp77

Members
  • Posts

    143
  • Joined

  • Last visited

Everything posted by dsp77

  1. I have a table with the rows: ID, name, valid how can i make the "valid" row to have yes or no, true or false and what syntax would i use to view only the yes. Thank You
  2. all i have left to figure out is the delete part to work im getting this error Notice: Undefined index: id in C:\xampp\xampp\htdocs\jobs\sterge.php on line 3 sterge.php <?php include "config.php"; $id=$_POST['id']; $sql=mysql_query("DELETE FROM intrari WHERE id='$id'"); if (!$sql) { die(mysql_error()); } else { echo "datele au fost sterse"; } mysql_close($conexiune); ?> the previous page is <?php require_once('config.php'); $rezultat = mysql_query("SELECT * FROM intrari") or die(mysql_error()); echo "<table border='1'>"; echo "<tr> <th>ID</th> <th>Start</th> <th>Sfarsit</th> <th>Nume</th> <th>Prioritate</th> <th>Descriere</th> <th>Editeaza</th> <th>Sterge</th> </tr>"; while($rand = mysql_fetch_array( $rezultat )) { echo "<tr><td>"; echo $rand['id']; echo "</td><td>"; echo $rand['start']; echo "</td><td>"; echo $rand['sfarsit']; echo "</td><td>"; echo $rand['nume']; echo "</td><td>"; echo $rand['prioritate']; echo "</td><td>"; echo $rand['descriere']; echo "</td><td>"; echo "<a href=\"editeaza.php?id=$rand[id]\">Editeaza</a>"; echo "</td><td>"; echo "<a href=\"sterge.php?id=$rand[id]\">Sterge</a>"; echo "</td></tr>"; } echo "</table>"; ?>
  3. yay at last i did it yes the problem was with the var undefined but i changed the sql syntax to this and it works <?php require_once('config.php'); $order = "UPDATE intrari SET start='" . $_POST['start'] . "', sfarsit='" . $_POST['sfarsit'] . "', nume='" . $_POST['nume'] . "', prioritate='" . $_POST['prioritate'] . "', descriere='" . $_POST['descriere'] . "' WHERE id='" . $_POST['id'] . "'"; ; mysql_query($order); header ("Location: http://127.0.0.1/jobs/vizualizare.php"); ?>
  4. in the first code i extract the data from db and display as text in the second code i create the form with data based on id from first code (i dont know how to use POST in the input fields there are already used with the code of extract) and last code is all what u see is all code full. i remember that i tried something like that and dint work or maybe you have other idea im out of options:(
  5. i know that headers error may be because of spaces before and after the code i checked and didn't find any the error is more because of session start in config file
  6. this helped i don't get that error anymore but still no update in the database...tested now on other server php 5.30 and i get this 2 Notice: Undefined variable: start in C:\xampp\htdocs\it\edit.php on line 3 Notice: Undefined variable: sfarsit in C:\xampp\htdocs\it\edit.php on line 3 Notice: Undefined variable: nume in C:\xampp\htdocs\it\edit.php on line 3 Notice: Undefined variable: prioritate in C:\xampp\htdocs\it\edit.php on line 3 Notice: Undefined variable: descriere in C:\xampp\htdocs\it\edit.php on line 3 Notice: Undefined variable: id in C:\xampp\htdocs\it\edit.php on line 3 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\it\edit.php:3) in C:\xampp\htdocs\it\edit.php on line 5
  7. the error is generated by firefox not the server, maybe i missed something in php code and cookies are accepted, in ie page is loading and nothing happens. The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. * This problem can sometimes be caused by disabling or refusing to accept cookies.
  8. same thing now i notice that the page is loading untill error with your code and mine and still no change
  9. hello, sorry for posting in mysql forum but i dont know where exactly is the problem but here is the link http://www.phpfreaks.com/forums/index.php/topic,272737.0.html
  10. Hello, My problem is the mysql update command is doin the job but in the database i dont see any changes here are the two scripts <?php require_once('config.php'); $rezultat = mysql_query("SELECT * FROM intrari") or die(mysql_error()); echo "<table border='1'>"; echo "<tr> <th>ID</th> <th>Start</th> <th>Sfarsit</th> <th>Nume</th> <th>Prioritate</th> <th>Descriere</th> <th>Editeaza</th> <th>Sterge</th> </tr>"; while($rand = mysql_fetch_array( $rezultat )) { echo "<tr><td>"; echo $rand['id']; echo "</td><td>"; echo $rand['start']; echo "</td><td>"; echo $rand['sfarsit']; echo "</td><td>"; echo $rand['nume']; echo "</td><td>"; echo $rand['prioritate']; echo "</td><td>"; echo $rand['descriere']; echo "</td><td>"; echo "<a href=\"editeaza.php?id=$rand[id]\">Editeaza</a>"; echo "</td><td>"; echo "<a href=\"sterge.php?id=$rand[id]\">Sterge</a>"; echo "</td></tr>"; } echo "</table>"; ?> editeaza.php is edit sterge.php is delete and the update <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Form Edit Data</title> </head> <body> <table border=1> <tr> <td align=center>Form Edit Data</td> </tr> <tr> <td><table> <?php require_once('config.php'); $id = $_GET['id']; $order = "SELECT * FROM intrari where id='$id'"; $rezultat = mysql_query($order); $rand = mysql_fetch_array($rezultat); ?> <form method="post" action="edit.php"> <input type="hidden" name="id" value="<?php echo "$rand[id]"?>"> <tr> <td>Start:</td> <td><input type="text" name="start" size="10" value="<?php echo "$rand[start]"?>"></td> </tr> <tr> <td>Sfarsit:</td> <td><input type="text" name="sfarsit" size="10" value="<?php echo "$rand[sfarsit]"?>"></td> </tr> <tr> <td>Nume:</td> <td><select name="nume" id="nume"> <option selected="selected">Alege</option> <option>Adrian</option> <option>Dani</option> <option>Dinu</option> <option>Marian</option> <option>Marius</option> </select></td> </tr> <tr> <td>Prioritate:</td> <td><select name="prioritate" id="prioritate"> <option selected="selected">Mica</option> <option>Medie</option> <option>Mare</option> </select></td> </tr> <tr> <td>Descriere:</td> <td><textarea cols="30" rows="5" name="descriere"><?php echo "$rand[descriere]"?></textarea></td> </tr> <tr> <td align="right"><input type="submit" name="submit value" value="Edit"></td> </tr> </form> </table></td> </tr> </table> </body> </html> <?php require_once('config.php'); $order = "UPDATE intrari SET start='$start', sfarsit='$sfarsit', nume='$nume', prioritate='$prioritate', descriere='$descriere WHERE id='$id'"; mysql_query($order); header("location:edit.php"); ?> the help would be very appreciated .
  11. i did the $country= $_POST['country']; but i try 2 integrate the value in email and i dont receive it think i need to integrate it in $message or something dunno.
  12. Hello, i have this mail form with upload but i dont know how to add more fields from the html form, anyonw with a quick help pls..thank you <?php // Read POST request params into global vars $to = $_POST['to']; $from = $_POST['from']; $subject = $_POST['subject']; $message = $_POST['message']; // Obtain file upload vars $fileatt = $_FILES['fileatt']['tmp_name']; $fileatt_type = $_FILES['fileatt']['type']; $fileatt_name = $_FILES['fileatt']['name']; $headers = "From: $from"; if (is_uploaded_file($fileatt)) { // Read the file to be attached ('rb' = read binary) $file = fopen($fileatt,'rb'); $data = fread($file,filesize($fileatt)); fclose($file); // Generate a boundary string $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; // Add the headers for a file attachment $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; // Add a multipart boundary above the plain message $message = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: text/plain; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n"; // Base64 encode the file data $data = chunk_split(base64_encode($data)); // Add file attachment to the message $message .= "--{$mime_boundary}\n" . "Content-Type: {$fileatt_type};\n" . " name=\"{$fileatt_name}\"\n" . //"Content-Disposition: attachment;\n" . //" filename=\"{$fileatt_name}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n" . "--{$mime_boundary}--\n"; } // Send the message $ok = @mail($to, $subject, $message, $headers); if ($ok) { echo "<p>Mail sent! Yay PHP!</p>"; } else { echo "<p>Mail could not be sent. Sorry!</p>"; } ?>
  13. i have the same problem but i didnt manage 2 solve it:(
  14. im working in modifying interspire cart to show the dimensions to but i get this error Warning: Illegal offset type in includes\display\ProductDetails.php on line 39 the code from that line is if($product[$dimensions] > 0) { and the full code: $product = $GLOBALS['ISC_CLASS_PRODUCT']->GetProduct(); $dimensions = array( 'ProductHeight' => 'prodheight', 'ProductWidth' => 'prodwidth', 'ProductDepth' => 'proddepth' ); foreach($dimensions as $global => $field) { if($product[$dimensions] > 0) { $GLOBALS[$global] = FormatWeight($product[$field], false); $hasDimensions = true; } else { $GLOBALS['Hide'.$global] = 'display: none'; } } if(!isset($hasDimensions)) { $GLOBALS['HideDimensions'] = 'display: none'; } im out of options sry 4 the double post from other section but i didnt saw this one first
  15. im working in modifying interspire cart to show the dimensions to but i get this error Warning: Illegal offset type in includes\display\ProductDetails.php on line 39 the code from that line is if($product[$dimensions] > 0) { and the full code: $product = $GLOBALS['ISC_CLASS_PRODUCT']->GetProduct(); $dimensions = array( 'ProductHeight' => 'prodheight', 'ProductWidth' => 'prodwidth', 'ProductDepth' => 'proddepth' ); foreach($dimensions as $global => $field) { if($product[$dimensions] > 0) { $GLOBALS[$global] = FormatWeight($product[$field], false); $hasDimensions = true; } else { $GLOBALS['Hide'.$global] = 'display: none'; } } if(!isset($hasDimensions)) { $GLOBALS['HideDimensions'] = 'display: none'; } im out of options right ty for help
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.