(broken record here) php problem

Okay, this will probably sound really foolish, but here is what happened. I downloaded a script from php resource index (here is the site for the script:
http://www.giuseppecalbi.com/scripts/gc_formmail/?lan=en ). Apparently, it's extremely simple, lol. Anyway, I could swear I followed the instructions to the tee (there were very few of them), but when I submit a form on the page, instead of sending me an email, it does nothing. Also, instead of going to a confirmation page, it goes to the page of the script and shows the entire thing written out rather than actually running it. Any ideas what could be causing this? Thanks in advance for any help. I think I need to go to a special camp for people with brain blocks against php.

Thanks for all of your suggestions, guys. Actually, I wasn't browsing to it, php is enabled and it's on the same server that is running other php scripts. I checked everything here, and it still wasn't working. I ended up using a different script for the same thing and it works just fine. I don't know if it was just a problem with the script or if I did something wrong, but either way, it wasn't a great enough script for me to drive myself insane over it. On the plus side, at least this guy has me on his mailing list now.

Similar Messages

  • J2ME - RMS - Record Enumeration - compilation problem

    Hi,
    Im trying to create RMS with Record Enumeration. Able to open a recordstore & write a record in it; while reading the record with record enumeration, im assigning the recordstore object to enumeration. Here compilation problem occurs. Im attaching the code which im working. Please help me to solve this issue.
    import javax.microedition.midlet.*;
    import javax.microedition.rms.*;
    import javax.microedition.lcdui.*;
    import java.io.*;
    public class RecordEnumeration extends MIDlet implements CommandListener
         private Display display;
         private Alert alert;
         private Form form;
         private Command cmdOpen, cmdWrite, cmdRead, cmdClose, cmdDelete, cmdExit;
         private RecordStore rs = null;
         private RecordEnumeration re = null;
         public RecordEnumeration()
              display = Display.getDisplay(this);
              cmdOpen = new Command("Open", Command.SCREEN, 1);
              cmdWrite = new Command("Write", Command.SCREEN, 1);
              cmdRead = new Command("Read", Command.SCREEN, 1);
              cmdClose = new Command("Close", Command.SCREEN, 1);
              cmdDelete = new Command("Delete", Command.SCREEN, 1);
              cmdExit = new Command("Exit", Command.SCREEN, 1);
              form = new Form("RecordEnumeration");
              form.addCommand(cmdOpen);
              form.addCommand(cmdWrite);
              form.addCommand(cmdRead);
              form.addCommand(cmdClose);
              form.addCommand(cmdDelete);
              form.addCommand(cmdExit);
              form.setCommandListener(this);
         public void startApp()
              display.setCurrent(form);
         public void pauseApp()
         public void destroyApp(boolean unconditional)
         public void commandAction(Command cmd, Displayable displayable)
              if(cmd == cmdExit)
                   destroyApp(true);
                   notifyDestroyed();
              else if(cmd == cmdOpen)
                   try
                        rs = RecordStore.openRecordStore("RecordEnumeration", true);
                        System.out.println("Opening Record");
                   catch(Exception err)
                        alert = new Alert("Err Opening", err.toString(), null, AlertType.WARNING);
                        alert.setTimeout(Alert.FOREVER);
                        display.setCurrent(alert);
              else if(cmd == cmdWrite)
                   try
                        String StringOutput[] = {"First Record", "Second Record", "Third Record"};
                        for (int x = 0; x < 3; x++)
                             byte[] byteOutputData = StringOutput[x].getBytes();
                             rs.addRecord(byteOutputData, 0, byteOutputData.length);
                             System.out.println("Record "+ x +" Added");
                   catch (Exception err)
                        alert = new Alert("Err Writing", err.toString(), null, AlertType.WARNING);
                        alert.setTimeout(Alert.FOREVER);
                        display.setCurrent(alert);
              else if(cmd == cmdRead)
                   try
                        StringBuffer buffer = new StringBuffer();
                        re = rs.enumerateRecords (null, null, false);
                        while (re.hasNextElement())
                             buffer.append(new String(re.nextRecord()));
                             buffer.append("\n");
                        alert = new Alert("Enumeration", buffer.toString(), null, AlertType.WARNING);
                        alert.setTimeout(Alert.FOREVER);
                        display.setCurrent(alert);
                        System.out.println("Reading");
                   catch(Exception err)
                        alert = new Alert("Err Reading", err.toString(), null, AlertType.WARNING);
                        alert.setTimeout(Alert.FOREVER);
                        display.setCurrent(alert);
              else if(cmd == cmdClose)
                   try
                        rs.closeRecordStore();
                        System.out.println("Closed");
                   catch(Exception err)
                        alert = new Alert("Err Closing", err.toString(), null, AlertType.WARNING);
                        alert.setTimeout(Alert.FOREVER);
                        display.setCurrent(alert);
              else if(cmd == cmdDelete)
                   try
                        RecordStore.deleteRecordStore("RecordEnumeration");
                        re.destroy();
                        System.out.println("Deleted");
                   catch(Exception err)
                        alert = new Alert("Err Deleting", err.toString(), null, AlertType.WARNING);
                        alert.setTimeout(Alert.FOREVER);
                        display.setCurrent(alert);
    These are the error which im getting while compiling in WTK.
    C:\WTK2.5.1\apps\WritingMixedData\src\RecordEnumeration.java:60: incompatible types
    found : javax.microedition.rms.RecordEnumeration
    required: RecordEnumeration
                        RecordEnumeration re = rs.enumerateRecords(null,null,false);
                        ^
    C:\WTK2.5.1\apps\WritingMixedData\src\RecordEnumeration.java:99: cannot find symbol
    symbol : method hasNextElement()
    location: class RecordEnumeration
                        while (re.hasNextElement())
                        ^
    C:\WTK2.5.1\apps\WritingMixedData\src\RecordEnumeration.java:101: cannot find symbol
    symbol : method nextRecord()
    location: class RecordEnumeration
                             buffer.append(new String(re.nextRecord()));
                             ^
    C:\WTK2.5.1\apps\WritingMixedData\src\RecordEnumeration.java:136: cannot find symbol
    symbol : method destroy()
    location: class RecordEnumeration
                        re.destroy();
                        ^
    4 errors
    Advices are welcome. Thanks in advance.
    -Singu

    Hi Guys,
    J2ME TECHNOLOGIES
    I created a record store and inserted record date "random" into it using the following code.
    RecordStore rs = null;
    try {
    rs = RecordStore.openRecordStore( "myrs",true);
    //rs = RecordStore.openRecordStore( "myrs",false );
    rs.setMode(1,true);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataOutputStream dos = new DataOutputStream(baos);
    try{dos.writeUTF("random");}catch(Exception e){}
    byte[] b = baos.toByteArray();
    rs.addRecord(b, 0, b.length);
    }catch(Exception e){}
    I executed this MIDLET TO INSERT.
    I closed the application and tried to look for the physical db file inside my application folder where i couldnt find it.
    Then i tried to read the data from RECORD STORE myrs using the the same MIDlet by editing the aboe code as follows
    RecordStore rs = null;
    try {
    rs = RecordStore.openRecordStore( "myrs",false);
    byte[] recData = new byte[10];
    ByteArrayInputStream bais = new ByteArrayInputStream(recData);
    DataInputStream dis = new
    DataInputStream(bais);
    rs.getRecord(1, recData, 0);
    try{System.out.println("UTF: " + dis.readUTF());}catch(Exception e){}
    System.out.println("--------------------");
    } catch( RecordStoreException e ){// couldn't open it or create it
    System.out.println("data base creation error"+e);
    But when i executed it the error occured
    microedition.rms.RecordStoreNotFoundException: cannot find record store file
    My question in my first code ive created the data store and inserted the values into my recordstore myrs
    Then when i edit the code for creation into reading from the record store why the error occurs.Does the Midlet store the record store Temporarirly ONLY till the MIDLET LIFECYCLE.
    IF SO what is the method and code to store the RECORD STORE PERMANENTLLY EVEN AFTER THE MIDLET EXECUTION QUITS.
    ///////////////////////kARTHEE

  • Froyo sounds like a broken record

    After today's automatic Froyo upgrade, all music players skip like a broken record or a bad stream.  I tried multiple audio players and audio files, all with the same result.

    I have the same problem. I can fix it by rebooting the phone....but i don't like having to do that every time i want to listen to music. I guess Linux has finally come close to being Windows. v2.2 must have big changes in the audio subsystem....reminds me of the early PulseAudio issues on Ubuntu. Sucks to be a Droid'er these days.

  • 46G310U Audio skipping like broken record

    I have a new 46 inch LCD and in the last couple of weeks by audio and video freezes up at random and the tv will shut down.  The audio sounds like a broken record and then it starts making loud beeping noises for a few moments and then shuts itself down.  Most of the time it will restart and in a few moments the picture and audio will come back to normal but twice now the screen goes black and the tv stays on.  I cannot cut it off with the remote or at the unit itself..........I have to unplug the tv to get it to restart.
    Anybody experienced anything like this?

    I had a similar problem last night.  Was watching a Time Warner DVR when picture began to stutter and freeze. Eventually a solid green screen came up.  Was able to channel up on the DVR remote and the TV went back to normal... went back to the prerecorded dvr program again and started watching...  the picture began to intermittently freeze and eventually a freeze frame came up... tv remote did not seem to respond. could not change inputs... when I turned off the dvr/cable box the frozen picture would get dimmer but not go away... Eventually I was able to shut down the tv with the remote.  when I turned it back on everything was OK... Originally thought it might be a dvr problem... never had this problem with my old sony...  had the 46g310u about two weeks... are these sets prone to lock ups when receiving bad video? problem was on HDMI input 2...

  • Ok, so heres my problem. My ipod touch 4g is stuck on a white screen I tried plugging it in the computer and pressing the home and power button but still nothing What do I do please help

    ok, so heres my problem . I have this ipod touch 4g and i was updating it to the newst version and the screen turned white i tried connecting it to the computer and nothing i pressed the home and main button but still nothing i dont want to pull it apart or anything but please help what do i do

    Let the battery fully drain. After charging for an hour try the reset (both buttons) and restore as necessary.

  • My notes from my iphone4 have been deleted. Heres the problem, the reason it is deleted is because i accidentally deleted my gmail messages. i guess my notes were there to. the notes are not in icloud and not in gmai. is there any way i can get them back?

    My notes from my iphone4 have been deleted. Heres the problem, the reason it is deleted is because i accidentally deleted my gmail messages. i guess my notes were there to. the notes are not in icloud and not in gmai. is there any way i can get them back?

    Qualdog-12 wrote:
    My friend deleted some of my apps from settings as a prank, and I can't get them back by using the App Store.
    if they are no longer in the app store, you can not get them back.

  • What is the best way to remotely access my sister in laws Mac who lives in another city to help her with her computer problems?

    as stated above
    What is the best way to remotely access my sister in laws Mac who lives in another city to help her with her computer problems?

    The best way? Get her to bring it to you, especially if she makes good cakes.
    Apples Back to my Mac isn't really suitable for this - it is designed for a single person who wants their Apple ID on the system. It would mean she would have to share hers with you & you would also have to setup her Apple ID on your Mac - it is messy & causes trouble with iCloud, iTunes etc.
    You can try Messages if she is able to begin a session with you, see the 'invite to share screen' in the menus, weirdly you need to use a service that isn't from Apple.
    Messages (Mavericks): Share your screen
    It may be better if you to setup LogMeIn or GoToMyPC. They should 'dial out' & maintain a constant connection so you can login whenever the Mac is powered up. It won't, require a human to initiate the process at the other end, just be aware that the router may cause issues depending on what is configured, you may need settings to enable automatic port forwarding - it really depend on which option you choose.

  • Audiobooks stop playing and start repeating a sound (like a broken record). Music plays as it should. Any suggestions?

    Audiobooks (from Audible) play until the later chapters in the books. Then, it stops playing, and sounds like a broken record stuck on one sound. I've tried re-syncing. I've restored factory settings and I've deleted the book from the library and reloaded it into iTunes. Any suggestions? It's happened with more than one book.

    I have the same issue and went to the genius bar. They tried something in iTunes but it didn't work. So they proposed me to leave them my computer for a few days so that they can figure out what this is. Unfortunately I cannot do that right now.
    I am really interested in a solution
    Xavier

  • FRM-41051:  You cannot create records here

    Hello all,
    I have two blocks 'FIND_EMP' and EMP_HDR.
    In 'FIND_EMP' i have fields below like
    Dept name -------
    Location ------
    EMP no -------------
    find(button) new_emp(button)
    I you need to create a new employee we need to select dept name and location from lov and click new emp button.Then it will navigate to EMP_HDR block
    In EMP_HDR block i have fields below like
    Dept name -------(wiil be defaulted from 'FIND_EMP' block)
    Location ------(wiil be defaulted from 'FIND_EMP' block)
    EMP NAME ---------(USER INPUT)
    DOB-----------(USER INPUT)
    Emp no----------(populates a sequence no when user clicks submit)
    Submit(button)
    for the coresponding dept name and location user enters new employee name and dob and clicks submit button then empno field will be populated and it will close the EMP_HDR block window and will return to 'FIND_EMP' block.
    Again if I try to create new employee by pressing new_emp(button) it is giving an error message below.Even in the block level propery pallete also insert allowed and update allowed is set to YES
    "FRM-41051: You cannot create records here." (ie,Do not attempt to create and insert new records into this block until you have set the Insert Allowed block property to True.)
    To avoid the above error i enabled the block property insert allowed to true under new_emp(button) logic
    SET_BLOCK_PROPERTY('EMP_HDR',INSERT_ALLOWED,PROPERTY_TRUE);
    now it is not giving any error and everything is working fine.
    But my doubt here is before block property insert allowed to true is not enabled, then
    for the first time I try to create new employee it is creating a record and for the same session
    creating again new employee it is giving error message(FRM-41051). I could not understand.Any body please clarify on this.
    Regards,
    Kiran

    i think you had some other code which was blocking the insert allowed in your EMP_HDR block...
    kindly check other places where it was blocking it...
    might be possible on submit button you have such code to block insert.. because you entered first record than submit,, after that block property changed to insert_allowed false...
    -- Aamir

  • Audio sounds like broken record

    When I open the project, some audio clips will be fine for the beginning, but at some point will have one second repeated over and over again for the remainder of the clip. When played back, it sounds like a broken record. The actual files are fine, when I check the clips on my hard drive they're normal. But when I open the project, they are corrupted. And it happens to different clips each time I open the project. Even when I import the same file again, it will be corrupted in the same spot. Any ideas?

    Try updating your audio driver.

  • Flex/PHP problem lastResult does not work correctly

    hi flex community,
    I am trying to develope a small login but I am still new to flex. It's based a little bit on the tutorial "Flex Test Drive: Build an application in an hour". I have a mysql database where the username and the password are stored in.
    My Flex file looks like this:
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                                xmlns:s="library://ns.adobe.com/flex/spark"
                                xmlns:mx="library://ns.adobe.com/flex/mx"
                                xmlns:loginservice="services.loginservice.*"
                                currentState="Login"
                                width.Login="719" height.Login="606"
                                width.Main="975" height.Main="700" xmlns:valueObjects="valueObjects.*">
         <fx:Script>
              <![CDATA[
                   import mx.controls.Alert;
                   import mx.events.FlexEvent;
                   protected function buttonLogin_clickHandler(event:MouseEvent):void
                        loginResult.token = loginService.login(username.text, password.text);
                        trace(vOLogin.username);
                        trace(vOLogin.password);
                        trace(vOLogin.valid)
                        /*if (vOLogin.valid == true) {
                             currentState = "Main";
              ]]>
         </fx:Script>
         <s:states>
              <s:State name="Login"/>
              <s:State name="Main"/>
         </s:states>
         <fx:Declarations>
              <valueObjects:VOLogin id="vOLogin" />
              <s:CallResponder id="loginResult" result="vOLogin = loginResult.lastResult[0] as VOLogin"/>
              <loginservice:LoginService id="loginService"
                                               fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
                                               showBusyCursor="true"/>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <s:TextInput id="username" includeIn="Login" x="118" y="37" width="107"/>
         <s:TextInput id="password" includeIn="Login" x="118" y="88" width="107" displayAsPassword="true"/>
         <s:Label includeIn="Login" x="20" y="38" width="84" height="22" text="Benutzername:"
                    textAlign="right" verticalAlign="middle"/>
         <s:Label includeIn="Login" x="20" y="88" width="84" height="22" text="Passwort:"
                    textAlign="right" verticalAlign="middle"/>
         <s:Button id="buttonLogin" includeIn="Login" x="22" y="143" width="195" label="Login"
                     click="buttonLogin_clickHandler(event)"/>
    </s:WindowedApplication>
    and my 2 php Files look like this:
    VOLogin.php
    <?php
    class VOLogin {
         public $id;
         public $valid;
         public $msg;
          public $username;
          public $password;
         public $versionnumber;
    ?>
    And this is my LoginService.php file:
    <?php
    require_once('VOLogin.php');
    require_once('config.php');
    //$foo = new LoginService();
    //var_dump($foo->login("heinz", "heinz"));
    class LoginService {
    * Retrieve all the records from the table
    * @return an array of VOBenutzer
    * @param string $username
    * @param string $password
    public function login($username, $password) {
        $mysql = mysql_connect(DATABASE_SERVER, DATABASE_USERNAME, DATABASE_PASSWORD);
        mysql_select_db(DATABASE_NAME);
        $SQL = "select * from flex where username='".$username."' and password='".$password."'";
        $r = mysql_query($SQL);
        if(mysql_num_rows($r) == 1) {
            $row = mysql_fetch_object($r);
            $tmp = new StdClass();
            $tmp->id = $row->id;
            $tmp->valid = true;
            $tmp->msg = "Login Ok";
            $tmp->username = $row->username;
            $tmp->password = $row->password;
            $tmp->versionnumber = $row->versionnumber;
            $output[] = $tmp;
        }else {
            $tmp = new StdClass();
            $tmp->id = 0;
            $tmp->valid = false;
            $tmp->msg = "Benutzername oder Passwort falsch";
            $tmp->username = $username;
            $tmp->password= $password;
            $tmp->versionnumber = 0;
            $output[] = $tmp;
        return $output;
    ?>
    My actual problem is that I have to press 2 times on the button to get the correct trace information. With the help of the search function I found this thread:
    http://forums.adobe.com/thread/259280
    I am not sure if I have the same problem. If yes where should I put the eventhandler? I would be very happy for every useful answer.
    Greetings
    flexx0r

    Here is a good article on how the % key works.
    It is working as designed. It just isn't what you are expecting. It just isn't designed for Engineers.
    http://blogs.msdn.com/b/oldnewthing/archive/2008/01/10/7047497.aspx

  • How to insert date into updated record (MySql, PHP)

    I want to be able to update an existing record and automatically include the date the change was made when I submit the data back to the MySql database.
    I saw this thread on how to insert the date on a new record using NOW()
    http://forums.adobe.com/thread/855152?decorator=print&displayFullThread=true#855152
    After reading it I successfully amended my insert.php page.
    Here's the code from my insert.php page which works nicely:
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO standardsclient_tbl (client_name, pantone_ref1, pantone_ref1_image, font_ref1, font_ref1_image, `date`) VALUES (%s, %s, %s, %s, %s, NOW())",
                           GetSQLValueString($_POST['client_name'], "text"),
                           GetSQLValueString($_POST['pantone_ref1'], "text"),
                           GetSQLValueString($_POST['pantone_ref1_image'], "text"),
                           GetSQLValueString($_POST['font_ref1'], "text"),
                           GetSQLValueString($_POST['font_ref1_image'], "text"),
                           GetSQLValueString($_POST['date'], "date"));
    This is the update.php page, I changed `date`=%s to `date`=NOW() but all this did was stop me from updating the record at all.
    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
      $updateSQL = sprintf("UPDATE standardsclient_tbl SET client_name=%s, pantone_ref1=%s, pantone_ref1_image=%s, font_ref1=%s, font_ref1_image=%s, `date`=NOW() WHERE client_ID=%s",
                           GetSQLValueString($_POST['client_name'], "text"),
                           GetSQLValueString($_POST['pantone_ref1'], "text"),
                           GetSQLValueString($_POST['pantone_ref1_image'], "text"),
                           GetSQLValueString($_POST['font_ref1'], "text"),
                           GetSQLValueString($_POST['font_ref1_image'], "text"),
                           GetSQLValueString($_POST['date'], "date"),
                           GetSQLValueString($_POST['client_ID'], "int"));
    Can anyone see where I've gone wrong?
    Thanks

    In update query you have 6 %s but 7 GetSQLValueString. That's your problem.

  • Records fetching & writing problem in Oracle DB

    Hi,
    Currently we are fetching 1 million records from Oracle DB , where we are using PreparedStatement and using the fetchSize() we are fetching the records in a "chunk" in an iterative manner and not feching all 1 million records at once. The same amount of records are passed to an utility to write the records in another DB table using addBatch() & batchUpdate() method. If the above operations in place, still the performance is not that great. Hence can we do the below:-
    1) Caching the records and reusing it, the problem here is the data is dynamic and there is no static data involved here, hence whether caching works here? If so we can go with which caching mechanism?
    2) Eventhough PreparedStatement is precompiled statement, is there any where we can have the SQL queries directly located to the database/prepared statement for the faster reading and writing of the data?
    Here the SQL queries are pretty simple "select" and "Insert" query , hence there is no need to fine tune the queries. Please clarify how we can go about this?
    Thanks.
    Edited by: 797836 on May 23, 2013 7:59 PM

    797836 wrote:
    Currently we are fetching 1 million records from Oracle DB , where we are using PreparedStatement and using the fetchSize() we are fetching the records in a "chunk" in an iterative manner and not feching all 1 million records at once. The same amount of records are passed to an utility to write the records in another DB table using addBatch() & batchUpdate() method. If the above operations in place, still the performance is not that great. Hence can we do the below:-
    1) Caching the records and reusing it, the problem here is the data is dynamic and there is no static data involved here, hence whether caching works here? If so we can go with which caching mechanism?So what.. the Oracle's database buffer cache is too small and incapable of caching data? Or is so badly written it is incapable of caching data effectively?
    And big powerful and wonderful application/application tier has a badass buffer cache?
    So why even bother with the database then? Why not fit the entire database in the badass app buffer cache, drop Oracle, and save money?
    If I seem to be foaming at the mouth a bit, it is because Oracle is technically the best RDBMS product on this planet. I process billions of rows (read and write) every single day on my largest database. Without any magic or potions, but by simply sticking to the fundamentals of data processing in Oracle. Then I run across a statement like yours that squarely places the blame for your performance woes on Oracle, and then want to reinvent database functionality, like a db buffer cache, in the app layer. Without a single shred of technical evidence that Oracle is actually the cause of the performance woes.
    And not a word about the latency it takes to get a million rows from spinning rust/disks (where it resides originally)?
    And not a word about the latency of pushing that million rows as IP packets (1500 bytes max size each) from the source database to the app, only to have the app sending that same data as IP packets to the target database? Effectively hitting the network twice with that data volume...
    2) Eventhough PreparedStatement is precompiled statement, is there any where we can have the SQL queries directly located to the database/prepared statement for the faster reading and writing of the data?How is the prepare statement now a problem? Have you actually timed it and have metrics that show it to be the bottleneck?
    Here the SQL queries are pretty simple "select" and "Insert" query , hence there is no need to fine tune the queries. Please clarify how we can go about this?Send data directly from the source database to the target database - single transit of the data volume over network.
    Make sure that network speed and bandwidth suffices - as this, and I/O latency getting data off disks, are the biggest contributors to elapsed processing time.
    If there is spare bandwith and I/O capacity, use parallel processing. Instead of using a single data stream process to get data from source db to target db, use multiple streams.
    Consider compression of data during the network transit phase, especially if the data volume is large and compresses well.
    Of course, the infrastructure can also be tuned/upgraded. Bigger and faster network pipes. Faster disks. Shorter network routes with fewer hops. Use QoS/DSCP on network layer to prioritise the traffic from source to target db. Etc,

  • Deleting records - mySQL / PHP

    I've just worked through this whole database thing from
    scratch again after a little glitch, and it's all working pretty
    well.
    I do still have the issue with deleting records - I have the
    search results page which is fine, and has a delete options at the
    end of the row.
    It was working just fine bringing up the 'confirm deletion'
    page with the selected record - but it goes wrong after I add the
    'delete record' server behaviour.
    Basically after I do, when I click delete in the results
    page, it skips the 'confirm deletion' page, going straight to the
    'deletion confirmed' page.
    It does still delete the record at least, but it would be
    good to have the confirmation page.
    Here's a
    link
    (if you need to log in use 'admin' and 'password'.)
    This is all the script code in the 'confirm delete' page :
    <?php require_once('../Connections/ConnHandprint.php');
    ?>
    <?php
    function GetSQLValueString($theValue, $theType,
    $theDefinedValue = "", $theNotDefinedValue = "")
    $theValue = (!get_magic_quotes_gpc()) ?
    addslashes($theValue) : $theValue;
    switch ($theType) {
    case "text":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" :
    "NULL";
    break;
    case "long":
    case "int":
    $theValue = ($theValue != "") ? intval($theValue) : "NULL";
    break;
    case "double":
    $theValue = ($theValue != "") ? "'" . doubleval($theValue) .
    "'" : "NULL";
    break;
    case "date":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" :
    "NULL";
    break;
    case "defined":
    $theValue = ($theValue != "") ? $theDefinedValue :
    $theNotDefinedValue;
    break;
    return $theValue;
    if ((isset($_GET['recordID'])) && ($_GET['recordID']
    != "")) {
    $deleteSQL = sprintf("DELETE FROM Contacts WHERE
    ContactID=%s",
    GetSQLValueString($_GET['recordID'], "int"));
    mysql_select_db($database_ConnHandprint, $ConnHandprint);
    $Result1 = mysql_query($deleteSQL, $ConnHandprint) or
    die(mysql_error());
    $deleteGoTo = "contactdeleted.php";
    if (isset($_SERVER['QUERY_STRING'])) {
    $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
    $deleteGoTo .= $_SERVER['QUERY_STRING'];
    header(sprintf("Location: %s", $deleteGoTo));
    $colname_Recordset1 = "1";
    if (isset($_GET['recordID'])) {
    $colname_Recordset1 = (get_magic_quotes_gpc()) ?
    $_GET['recordID'] : addslashes($_GET['recordID']);
    mysql_select_db($database_ConnHandprint, $ConnHandprint);
    $query_Recordset1 = sprintf("SELECT * FROM Contacts WHERE
    ContactID = %s", $colname_Recordset1);
    $Recordset1 = mysql_query($query_Recordset1, $ConnHandprint)
    or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    ?>
    Any ideas?
    Cheers,
    Iain

    Hi,
    It is a good idea to do it in database level such that declare foreign key from child to parent table and specify DELETE CASCADE.
    regards,
    '

  • Delete Record server behavior problem

    Hi all!
    I'm such a painful situation, that I can't figure out, why my
    Delete
    Record form don't work as supposed.
    It seems all things work (also gives message "You have
    successfully
    deleted the article."), but the problem is
    that in the MySQL (5) database real deletion doesn't
    occure...
    I was walking along with very nice tutorial
    (www.adobe.com/devnet/dreamweaver/articles/php_blog2_11.html)
    if someone has time to think about...
    I have all the steps (from the tutorial) done multiple times
    and
    result... no real deletion, despite "successfully deleted"
    text :(
    with regards,
    andreta

    Yeah! As always - if one is doing too much over and over,
    then it's too
    much of trouble.
    I used sample delete_art.php(premade by Marius) file instead
    of mine and
    it worked!
    If I was wondering what is different, then there was large
    amount of
    additional code in my file:
    In pre-made sample is 200 lines versus 242 in mine :(
    Differences(looked with Winmerge):
    MINE(not working): Working:
    (why my DW8 inserts session handling in this way?)
    1)
    $_SESSION['MM_Username'] = NULL;
    session_unregister('MM_Username');
    $_SESSION['MM_UserGroup'] = NULL;
    session_unregister('MM_UserGroup');
    $_SESSION['PrevUrl'] = NULL;
    unset($_SESSION['MM_Username']);
    unset($_SESSION['MM_UserGroup']);
    unset($_SESSION['PrevUrl']);
    2)
    if (!isset($_SESSION)) { session_start();
    session_start();
    3)
    in NONworking: (in WORKING - nothing )
    (NB! this was a double-code - i think because of the redoings
    (?recordset deleting & recreating?) )
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType,
    $theDefinedValue = "",
    $theNotDefinedValue = "")
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue)
    : $theValue;
    $theValue = function_exists("mysql_real_escape_string") ?
    mysql_real_escape_string($theValue) :
    mysql_escape_string($theValue);
    switch ($theType) {
    case "text":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" :
    "NULL";
    break;
    case "long":
    case "int":
    $theValue = ($theValue != "") ? intval($theValue) : "NULL";
    break;
    case "double":
    $theValue = ($theValue != "") ? "'" . doubleval($theValue) .
    : "NULL";
    break;
    case "date":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" :
    "NULL";
    break;
    case "defined":
    $theValue = ($theValue != "") ? $theDefinedValue :
    $theNotDefinedValue;
    break;
    return $theValue;
    4)
    NONworking:
    <!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"><!--
    InstanceBegin
    template="/Templates/admintemplate.dwt.php"
    codeOutsideHTMLIsLocked="false" -->
    Working:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN"
    http://www.w3.org/TR/html4/loose.dtd">
    <html>
    5)
    NonW:
    <?php do { ?>
    <tr class="topheader">
    <td><?php echo $row_rsDeletedArticle['title_art'];
    ?></td>
    Working:
    <tr class="topheader">
    <td><?php echo $row_rsDeletedArticle['title_art'];
    ?></td>
    6)
    NONW:
    <td colspan="3"><?php echo
    $row_rsDeletedArticle['text_art']; ?></td>
    </tr>
    <tr>
    <td colspan="3"> </td>
    </tr>
    <?php } while ($row_rsDeletedArticle =
    mysql_fetch_assoc($rsDeletedArticle)); ?>
    </table>
    <table width="30%" border="0" cellspacing="0"
    cellpadding="0">
    <tr>
    <td><form id="delete" name="delete" method="post"
    action="delete_art.php">
    <input name="yes" type="submit" id="yes" value="yes"
    />
    <input name="id_art" type="hidden" id="id_art"
    value="<?php echo $row_rsDeletedArticle['id_art']; ?>"
    />
    </form>
    </td>
    <td><form id="cancel" name="cancel" method="post"
    action="list_art.php">
    <input name="no" type="submit" id="no" value="No" />
    </form>
    </td>
    </tr>
    </table>
    <?php } // Show if recordset not empty ?>
    <?php if ($totalRows_rsDeletedArticle == 0) { // Show if
    recordset empty ?>
    <p>You have successfully deleted the
    article.</p>
    <form id="back" name="back" method="post"
    action="list_art.php">
    <input name="back" type="submit" id="back" value="Back"
    />
    </form>
    <?php } // Show if recordset empty
    ?><p>  </p>
    <!-- InstanceEndEditable --></td>
    Working:
    <td colspan="2"><p><?php echo
    $row_rsDeletedArticle['text_art']; ?></p></td>
    </tr>
    <tr>
    <td colspan="2"><table width="15%" border="0"
    cellspacing="0" cellpadding="0">
    <tr>
    <td><form action="delete_art.php" method="post"
    name="delete" id="delete">
    <input name="yes" type="submit" id="yes" value="Yes">
    <input name="id_art" type="hidden" id="id_art"
    value="<?php echo $row_rsDeletedArticle['id_art'];
    ?>">
    </form></td>
    <td><form action="list_art.php" method="post"
    name="cancel" id="cancel">
    <input name="no" type="submit" id="no" value="No">
    </form></td>
    </tr>
    </table></td>
    </tr>
    </table>
    <?php } // Show if recordset not empty ?>
    <?php if ($totalRows_rsDeletedArticle == 0) { // Show if
    recordset
    empty ?>
    <p>You have successfully deleted the
    article.</p>
    <form action="list_art.php" method="post" name="back"
    id="back">
    <input name="back" type="submit" id="back"
    value="Back">
    </form>
    <?php } // Show if recordset empty ?>
    <p>  </p>
    <p> </p> <p> 
    </p></td>
    </tr>
    Boo-oo-hh!
    It's enough for now
    Please can someone give me advices about what is wrong with
    the nonworking
    (I deleted the section 3 from nonworking but it anyway
    doesn't work)
    AndreTa wrote:
    > Oh, sorry!
    >
    > additional information - working with DW8.0.2, PHP
    5.1.6, and with the
    > "blog" database with MySQL 4.1.14
    > (have also MySQL 5.0 - havn't tried with this... I'll do
    it after sweet
    > dreams and hard workday i.e. tomorrow)
    > In local PC WinXP, Apache 2.2.3
    >
    > andreta
    >
    >

Maybe you are looking for

  • Free upgrade to Mountain Lion didn't download and now my code will not work again!

    Okay so I bought a new MacBook Pro on Sunday and as Mountain Lion has only just come out and I have just bought my notebook I qualify for the free upgrade from Lion to Mountain Lion. After filling in all the required information I recieved my redeem

  • Formula Field Sorting

    Frield 1 is group on Date (Group1) Field 2 is group on workstation (Group 2) Field 3 is a formula field Sum(Amt). The Report will look like below when displaying the Group Footer #2 (workstation) line. Date           Workstation    Amount 11/01/2010 

  • Everything is slow motion in windows 8.1

    Hey I have updated to windows 8.1 recently   and ater u pdating I see that everything became slow motion. like mouse's arrow is slow now and opening or closing browsers or videos and everything is slow suddenly I tried to restart it and scan it sever

  • Attaching a trransaction to a table maintainance generator

    Hi All, I have to attach a transaction to the table maintainance generator for a ztable created by me. Can anybody explain me the process to do the same. Thanks in Advance.

  • My Macbook pro keeps freezing (os Lion & latest update)

    firstly  I will say  the biggest mistake I ever made was to change my OS from snow leopard a year ago to lion . Now using lion slowed my system drastically  and there was the ocassionally freezing that I learnt to live with but now it has Just gotten