PHP code takes the first record in the database regardless of the selected one

I struggled for hours with this trying to see why no matter what file is selected, the record displayed is always the first. It must be a stupid mistake on my part, but I can't see it.

I use DW CC 2015 with WebAssist server for server code additions. I looked at the database itself, and it's OK.

Test data

Capture.JPG

Copy the following code enumerates the various documents in the database. (I removed my HTML that works well for brevity).

<? php require_once('.. /.. /.. / Connections/Terrier.php');? >

<? php require_once('.. /.. /.. / webassist/mysqli/rsobj.php');? >

<? PHP

$rsDocuments = new WA_MySQLi_RS ("rsDocuments", $Terrier, 1);

$rsDocuments-> setQuery ("" SELECT * FROM documents ' ");

$rsDocuments-> execute();

? >

<! doctype html > < html >

"' Snip...

< p align = "left" > < a href = "add_terrier_document.php" > add new record of Documents < /a > < /p >

< table width = "100%" border = "1" cellspacing = "2" cellpadding = "2" >

< tbody >

< b >

< td width = "26%" align = "left" > < strong title > < / strong > < table >

< td width = "52%" align = "left" > < strong text > < / strong > < table >

< td width = "6%" align = "center" > < table >

< td width = "6%" align = "center" > < table >

< td width = "6%" align = "center" > < table >

< /tr >

<? PHP

{While (! $rsDocuments-> {atEnd())}

? >

< b >

< td > <? PHP echo ($rsDocuments-> getColumnVal ("dc_title"));? > < table >

< td > <? PHP echo ($rsDocuments-> getColumnVal ("dc_text"));? > < table >

< td width = "6%" align = "center" > < a href = "view_terrier_document.php? dc_index = <?" PHP echo ($rsDocuments-> getColumnVal ("dc_index"));? > "> view < /a > < table >"

< td width = "6%" align = "center" > < a href = "edit_terrier_document.php? dc_index = <?" PHP echo ($rsDocuments-> getColumnVal ("dc_index"));? > "> edit < /a > < table >"

< td width = "6%" align = "center" > < a href = "confirm_terrier_document_delete.php? dc_index = <?" PHP echo ($rsDocuments-> getColumnVal ("dc_index"));? > "> delete < /a > < table >"

< /tr >

<? PHP

$rsDocuments-> moveNext();

}

$rsDocuments-> moveFirst(); return the RS to the first record

? >

< / tbody >

< /table >

< a href = "<?" PHP echo $rsDocuments-> getFirstPageLink();? > "> first < /a > - < a href =" <? PHP echo $rsDocuments-> getNextPageLink();? > "> Next < /a > - < a href =" <? PHP echo $rsDocuments-> getPrevPageLink();? > "> previous < /a > - < a href =" <? PHP echo $rsDocuments-> getLastPageLink();? > "> last < /a >"

< p >

.... SNIP

The table shows the different records in the database. I can go through the files back and forth and pick any one to edit - say one-third.

The PHP code creates the URL of http:// localhost/priory_database_2/gateway/Terrier/documentation/edit_terrier_document.php?dc_in dex = 3

However, the record that is displayed is always record 1, regardless of the currently selected folder.

The edition code (less HTML) is.

<? php require_once('.. /.. /.. / Connections/Terrier.php');? >

<? php require_once('.. /.. /.. / webassist/mysqli/rsobj.php');? >

<? php require_once('.. /.. /.. / webassist/mysqli/queryobj.php');? >

<? PHP

$rsDocuments = new WA_MySQLi_RS ("rsDocuments", $Terrier, 1);

$rsDocuments-> setQuery ("SELECT * FROM documents ORDER BY dc_index ASC");

$rsDocuments-> execute();

? >

<? PHP

If (isset($_POST["submit"]): isset($_POST["submit_x"])) {}

$UpdateQuery = new WA_MySQLi_Query ($Terrier);

$UpdateQuery-> action = 'put up-to-date. "

$UpdateQuery-> table = 'documents '.

$UpdateQuery-> bindColumn ("dc_index", "s", "".) "((isset($_POST["dc_index"])))? $_POST ["dc_index"]:" ")". "" (', 'WA_DEFAULT');

$UpdateQuery-> bindColumn ("dc_title", "s", "".) "((isset($_POST["dc_title"])))? $_POST ["dc_title"]:" ")". "" (', 'WA_DEFAULT');

$UpdateQuery-> bindColumn ("dc_text", "s", "".) "((isset($_POST["dc_text"])))? $_POST ["dc_text"]:" ")". "" (', 'WA_DEFAULT');

$UpdateQuery-> bindColumn ('date_recorded', "s", "".) "((isset($_POST["date_recorded"])))? $_POST ["date_recorded"]:" ")". "" (', 'WA_DEFAULT');

$UpdateQuery-> bindColumn ("date_update", "s", "".) "((isset($_POST["date_update"])))? $_POST ["date_update"]:" ")". "" (', 'WA_DEFAULT');

$UpdateQuery-> addFilter ('dc_index', '=', 'i', ' ".) () $_GET ['dc_index']). » ») ;

$UpdateQuery-> execute();

$UpdateGoTo = 'index.php ';

"If (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo? rel2abs ($UpdateGoTo, dirname (__FILE__)):" ";" "

$UpdateQuery-> redirect ($UpdateGoTo);

}

? >

..... Snip


< /table >

< h3 align = "center" > change the document details < / h3 >

< form id = "AddDocumentRecord" name = "AddDocumentRecord" method = "post" >

< label for = "dc_title" > title

< name textarea = "dc_title" cols = "150" lines = "3" maxlength = "300" id = "title" > <? PHP echo ($rsDocuments-> getColumnVal ("dc_title"));? > < / textarea >

< / label >

< label for = "dc_text" > Description

< name textarea = "dc_text" cols = "150" lines = "20" maxlength = "60000" id = "text" > <? PHP echo ($rsDocuments-> getColumnVal ("dc_text"));? > < / textarea >

< label for 'date_recorded' = > registration Date:

< name textarea = 'date_recorded' cols = "50" rows = "1" maxlength = "20" id = 'date' > <? PHP echo ($rsDocuments-> getColumnVal ("date_recorded"));? > < / textarea >

< / label >

< label for = "date_update" > Date of last update:

< name textarea = "date_update" cols = "50" rows = "1" maxlength = "20" id = "Refresh" > <? PHP echo ($rsDocuments-> getColumnVal ("date_update"));? > < / textarea >

< / label >

< input type = "submit" name = "submit" id = "submit" value = "Submit" >

< input name = "dc_index" type = "hidden" id = "dc_index" value = "<?" PHP echo ((isset($_POST["dc_index"]))? $_POST ["dc_index"] ":" "")? > ">"

< / make >

... Snip

The query for the edit page should look like

$rsDocuments = new WA_MySQLi_RS ("rsDocuments", $Terrier, 1);

$rsDocuments-> setQuery ("SELECT * FROM documents WHERE dc_index =?");

$rsDocuments-> bindParam ('i', ' ".) "(isset($_GET['dc_index']))? $_GET ['dc_index']:" ")". "" », «-1 ») ;

$rsDocuments-> execute();

What this did that select a recording with a value of dc_index.

Tags: Dreamweaver

Similar Questions

  • PHP code in the template before &amp; lt; HTML &amp; gt;

    I create a model for a series of pages on my site that's actually going to be PHP pages and I wanted to put PHP code at the top of the page, before any HTML tag. This is necessary, for example, to call "session_start' (which creates a cookie) before any other output to the browser.

    I was able to do initially, but found that I can't make any changes to this code and have Dreamweaver to apply to pages based on the template. DW8 gives me an error message to make changes 'outside the html tags"and does not, apply them.

    This is not a show-stopper since it involves only a few pages, but is there a way to get around this restriction, and nobody knows if it also works this way in CS3 (or CS4?).

    > Thank you. This would work OK for me. How can I go about it?

    Add this to the head region of your template-

    Once make you and save the page template, all CHILDREN PAGES WILL BE
    SYNCHRONIZED WITH THE WRITING OF SCRIPTS PRESENT IN THE MODEL. You will no longer
    able to add a single server script for any page of the child. Just so you know...

    > Can you explain what you mean? Part of what I put in this section are PHP
    > 'require' statements, which are a type of server-side include, unless you
    > are
    > talking about something different.

    I'm not. Although you can use an 'include' statement too (there's one in)
    PHP). I just want to say that the script that are usually placed in code snippets
    each page (such as login scripts) are usually managed with inclusion.

    --
    Murray - ICQ 71997575
    Adobe Community Expert
    (If you * MUST * write me, don't don't LAUGH when you do!)
    ==================
    http://www.projectseven.com/go - DW FAQs, tutorials & resources
    http://www.dwfaq.com - DW FAQs, tutorials & resources
    ==================

    "gordonwd" wrote in message
    News:[email protected] Macromedia.com...
    >

    Quote:
    Posted by: newsgroup user
    > If you opt for the latter, then all the child pages will always receive ALL
    > changes to the page model, and you will NOT be able to add single
    > scripts on the pages of the child in these areas, because they will be so
    > be
    > locked. If you want to opt for this choice, after return, and I'll tell
    > you
    > How to do it.
    >

    >
    > Thank you. This would work OK for me. How can I go about it?
    >
    >

    Quote:

    > Normally, things like you describe are handled with server-side
    > includes,.
    > using the default template.
    >

    >
    > Can you explain what you mean? Part of what I put in this section are PHP
    > 'require' statements, which are a type of server-side include, unless you
    > are
    > talking about something different.
    >
    > --
    > Murray - ICQ 71997575
    > Adobe Community Expert
    > (If you * MUST * write me, don't don't LAUGH when you do!)
    > ==================
    > http://www.projectseven.com/go - DW FAQs, tutorials & resources
    > http://www.dwfaq.com - DW FAQs, tutorials & resources
    > ==================
    >
    >
    > "gordonwd" wrote in message
    > news:[email protected]
    > I create a model for a series of pages on my site that are
    > actually
    > going to be PHP pages and I wanted to put PHP code right in the top of
    > the
    > page, before any HTML tag. This is necessary, for example, to
    > call
    > "session_start' (which creates a cookie) before any other output of the
    > browser.
    > >
    > I did initially, but find that I can not make any changes
    > to
    > This code and have Dreamweaver to apply to pages based on the template.
    > DW8
    > gives me an error message to make changes 'outside the html tags.
    > and
    > fact
    > not to apply them.
    > >

    > This is not a show-stopper since it involves only a few pages, but is
    > It
    > any way to bypass this restriction and does anyone know if it also works
    > this way
    > in CS3 (or CS4?).
    > >
    >
    >
    >
    >
    >

  • should, i, install, reader, dc, me, I, player, x1.00, nor I, take, the, old, one, outside

    should, i, install, reader, dc, me, I, player, x1.00, nor I, take, the, old, one, outside

    Hi Bill,

    In a general scenario, CD player, once installed automatically remove and replace drive XI.

    You can try to do this.

    In case you have any difficulties or conflicts when installing CD player without removing the XI player, in this case I would advice you to use

    Adobe (applicable for Windows only) Tool cleaner uninstall the earlier version of the player and then install the latest version of the player.

    Cleaning tool Adobe download link: Download Adobe Reader and Acrobat tool - Adobe Labs

    Let us know how it goes.

    Concerning

    Sukrit diallo

  • sugestion of php code to the xml files?

    Hello..

    I have dreamweaver cs5 and I use .htaccess to be able to use php in .xml to make the RSS and site map...

    Everthing works fine but the php code that I put in any xml doc comes gray sugestion and php does not work...

    any ideas how I can get this working?

    Thank you

    I have dreamweaver cs5 and I use .htaccess to be able to use php in .xml to make the RSS and site map...

    Everthing works fine but the php code that I put in any xml doc comes gray sugestion and php does not work...

    any ideas how I can get this working?

    This technical note explains how to add and modify the exntensions recognized by DW:

    http://kb2.Adobe.com/CPS/164/tn_16410.html

    Tip: remove the documenttype (winfileextension and macfileextension) XML "xml", and then add it to the documenttype PHP_MySQL.

    HTH,

    Randy

  • PCL Code for the selection of the status bar

    We have a Unix-based program that relies on EZ for the selection of the printer spooler. Printing was allowed until we replaced the old printer with a HP 3005dn. We must make letterhead in tray 3. EZ print spooler requires to print PCL codes. I ran the code numbers range to print from the 3rd drawer.

    My problem is when it receives the print job, you have to hit the OK button twice so he can shoot from the 3rd drawer.

    By changing the PCL code, I can get him out tray 2 automatically, or stops for tray 3.

    I have modifed the installation of manual feeding system and or use requested tray do not help both.

    Here's the line of code in order

    PCLx_lowreceipt_ac_begin_ ^ [& l0o66f4H ^ [& s1C ^ [(s4099t0p12H_]]

    4 H is supposed to designate the selection of the status bar. I spent several hours from 1: 00 until 8: 00 successfully and to have the work automatically pull from tray 3.

    any ideas?

    Solution

    You need to access from the UI and not the control panel

    -IP in the laserprinter

    -Tab settings select

    -Set the camera (left side)

    -Develop "Configure Device" in the center of the page

    -Develop "Impression".

    -Develop 'PCL '.

    -at the bottom, "Mapping of media sources"... assign the Standard classic.

    Worked!

  • PLSQL code in the selection list

    My query is:

    I have a room list of table names that contain information about the rooms

    capacity seated

    name of the rooms are fetch in the select list: P1_ROOM_NAME that returns the id of the element room hidden

    : P1_ROOM_ID that is used for the third Select: P1_NO_OF_PARTICIPANTS

    I get the error message by filling: P1_NO_OF_PARTICIPANTS

    NO DATA FOUND AND I LIKE INVALID VARIABLE

    I know some people found data are due to: P1_ROOM_NAME IS NOT SELECTED first

    the loading of the page.

    Any idea for the request to: P1_NO_OF_PARTICIPANTS

    sample data and used queries

    create the table room_list

    (number of room_id,

    room_name varchar2 (100),

    sitting_capacity

    );

    insert into room_list values(1,'a',3);

    insert into room_list values(2,'a',1);

    : P1_ROOM_NAME

    SELECT ROOM_NAME, ROOM_ID AS DID R

    OF ROOM_LIST

    To select the list I used

    : P1_NO_OF_PARTICIPANTS

    Lov used cascading point P301_ROOM_ID

    DECLARE

    l_sitting_capacity varchar2 (50);

    Start

    SELECT SITTING_CAPACITY from l_sitting_capacity

    OF ROOM_LIST

    WHERE ROOM_ID =: P301_ROOM_ID;

    BECAUSE me IN 1.l_sitting_capacity

    loop

    RETURN

    "I select as view, I like back"

    the double ';

    end loop;

    end;

    Hi Reema,

    ReemaPuri wrote:

    I wanted to show the numbers in the list of values up to not passed as a parameter.

    for example

    If the capacity is 3 then lov it should show 1,2,3

    Try this example

    SELECT LEVEL AS D, LEVEL AS R
    FROM DUAL
    CONNECT BY LEVEL <= (select 3 from dual);
    

    Here, instead of Select 3 of double replace your query giving you room capacity

    Hope this helps you,

    Kind regards

    Jitendra

  • all of a sudden all of the emails I received before 14:00 today are all the source code for the new ones nsince PAREN then are all readable ideas?

    all of a sudden all of the emails I received before 14:00 today are all code source hyperlink the nine since then are all readable ideas?

    Right-click on the folder, select Properties, and then choose the button repair.

    Long term solution is to not allow your anti virus scan profile of Thunderbird folders.

  • Need to know how long takes the Select statement of the cursor?

    Hi people
    I want to know the duration of execution of the cursor in a stored procedure.

    Piece of my code is provided below.

    procedure Process_PCN_MAT_Custs)
    p_PCN_OID in varchar2,
    p_days_back number
    ) is
    number of vcount;
    v_newoid varchar2 (16);
    date of pcn_create_date;
    T_DATE: = to_char (sysdate, ' dd/mm/yyyy hh24:mi:ss');
    cursor (SAP_Customers)
    x_PCN_OID varchar2,
    number of x_days_back
    date of x_pcn_create_date
    ) is
    Select
    KUNNR,
    Max (soldflag) soldflag,
    Max (shipflag) shipflag,
    Max (endflag) endflag,
    Max (custName) custname
    de)
    Select / * + DRIVING_SITE (bims_pcn_shipments) * /.
    KUNNR,
    SoldFlag,
    ShipFlag,
    EndFlag,
    custName
    Of
    bims_pcn_shipments_mview

    where
    material_number in (select sap_material_no from the pcn.material where pcn_oid = x_PCN_OID)
    and bdr_date > (x_pcn_create_date - x_days_back)

    UNION
    Select / * + DRIVING_SITE (bims_pcn_shipments) * /.
    KUNNR,
    SoldFlag,
    ShipFlag,
    EndFlag,
    custName
    Of
    bims_pcn_backlog_mview

    where
    material_number in (select sap_material_no from the pcn.material where pcn_oid = x_PCN_OID)
    and bdr_date > (x_pcn_create_date - x_days_back)

    )
    Group
    KUNNR;
    dbms_output.put_line to_char (v_date);

    Begin
    Open SAP_CUSTOMERS
    ---
    ---
    ---
    close SAP_CUSTOMERS
    end

    I get an error of compilation for this line [T_DATE: = to_char (sysdate, ' dd/mm/yyyy hh24:mi:ss');].
    Saying "+ Error (95,12): PLS-00103: encountered the symbol"="when expected as follows: constant exception < an ID > < a double quote delimited identifier > table Fedya double Ref char time timestamp interval date binary character national nchar"< an ID >"symbol has been replaced for"="continue +.»

    I would be grateful if someone can help me solve this weired compilation error.

    Thank you
    Vineet

    Then you need to go to the function [DBMS_UTILITY. GET_TIME. http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14258/d_util.htm#sthref7809].

    Something like that...

    n := dbms_utility.get_time;
    
    dbms_output.put_line( (dbms_utility.get_time-n)/100) || ' seconds....' );
    

    Published by: Karthick_Arp on January 16, 2009 05:07

  • I have a MBP end 2011 running yosemite which is dead.  How can I migrate (from Time Machine) on a similar MBP (mid-2012).  I don't mind if I lose data on the MBP of the latter.  Essentially, I want my old MBP to take the newest one.

    My MBP end 2011 died.  I want to migrate its content on Time Machine to a bit newer MBP.  Basically the old MBP return to the most recent.  It doesn't matter if the data on the new MBP are lost.  Any help would be appreciated.

    Hello

    Yes you can do it. Pondini (here) has a few options to do.

    You can also try Migration Wizard. See this article. But I'd go with Pondini, the guru of the Time Machine.

  • Update of iTunes. IPod sync and lost everything but 10 audio books, passed to Touch, four selected works, only on the Touch and not the selected one. Afraid to synchronize other devices that I'll lose everything. ITUNES update BUG

    I updated iTunes 10 Windows a few days ago. I sat to continue listening to an audiobook on my iPod. 110 audio books in sync with the iPod, there are now 10 and not that I want to listen to. I opted for a touch and tried to load the book on that. There are four books selected for the touch. The book I want to not sync and there is only one book on the Touch.  This book is not all the book selected for synchronization.  I am afraid now to sync one of my other devices to iTunes because I'm afraid I might lose even more data.

    Of course, there is a bug in the new update iTunes 12.3.3.17.  Help, please.

    Are audio books in your library? If it is not in your library can see you in your media folder? Your library authorized the Apple ID is used to buy the books? The upgrade of Windows can break the record of the permission on the computer.

    TT2

  • PHP to submit the form does not load

    I have a page with a form that will insert data into a MySQL database, using PHP. Dreamweaver has established the connection to the db fine. He sees the table and columns very well.

    I create the form with the text field and submit button and it looks great. But as soon as I put the form to insert a record (DW Wizard or manually assign the fields in the table), I get a HTTP 500 error.

    And as soon as I remove the code generated by DW, the page loads again. If she has somewhere in the DW PHP code at the beginning of the page, but I don't know what. Any help is greatly appreciated.

    Here is the code:

    Thanks David! I did and it works great! I had the feeling it was something simple!

  • WC3 validation of html page with php code

    I am trying to validate a web page ( http://www.flamingobeachcrfishing.com ) which includes the php code to extract information from a database using Dreamweaver cc 2015. I'm in code view.  I get error w3c to php code.  The page works fine. Is there a way to w3c check flow online (direct control) on the page?

    Run http://validator.w3.org/nu

  • PHP code

    I wish for the next generations of MUSE to easily paste PHP codes in the page and also be fantastic would manage (forms of conatct) for everyone. Not only for an Adobe Business catalyst members. It is not just as a Member of Adobe CC does not being able to use the forms to any Web site.

    I sent you PM from your site. Stan

  • Get the line number of the selected text

    Hi all

    Please tell me how to get the row number of the selected text in a page.

    for example

    Look, here's the page with text, I want to get the number of the line of the selected one (marked in red) text

    |-------------------------|

    | XXXXXXXXXXXXXX.

    | XXXXXXXXXX |
    | XXXXXXXXXXXXXX.

    | xxxxxxxxxxxxxx |

    | XXXXXXXXXX |

    | XXXXXXXXXXXXXX.

    | XXXXXXXXXXXXXX.

    ---------------------------

    Thanks in advance

    Shiv

    Hi Shiv,

    This thread of extraction. This will give you an idea.

    Always search the forum first before creating a new.

    Shonky

  • update a record is updated the first record in the comic book... Help!

    I'm going again and again to this new and can not find the problem.

    I have a form that sends an email to the emails that are on a database mysql php however when I update some documents it is always update the first record in the comics... I looked on this so many times and can not see what goes wrong

    the user ID is not auto_increment but is based on the username (which are all unique)

    I include the code to see if I'm missing something

    <? php require_once('.. / Connections/hostprop.php');? >

    <? PHP

    If (! function_exists ("GetSQLValueString")) {}

    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

    {

    If (via PHP_VERSION < 6) {}

    $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 "set":

    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;

    break;

    }

    Return $theValue;

    }

    }

    $editFormAction = $_SERVER ['PHP_SELF'];

    If (isset {}

    $editFormAction. = « ? ». htmlentities($_SERVER['QUERY_STRING']);

    }

    If ((isset($_POST["MM_update"])) & & ($_POST ["MM_update"] == "form1")) {}

    $updateSQL = sprintf ("UPDATE plus_signup SET email = %s, emailerSubject = %s emailerContent = %s WHERE userid = %s",

    GetSQLValueString ($_POST ['email'], "text").

    GetSQLValueString ($_POST ['emailerSubject'], "text").

    GetSQLValueString ($_POST ['emailerContent'], "text").

    GetSQLValueString ($_POST ["userid"], "text"));

    @mysql_select_db ($database_hostprop, $hostprop);

    $Result1 = mysql_query ($updateSQL, $hostprop) or die (mysql_error ());

    Guarantor of the e-mail

    $to = $_POST ['email'];

    $subject = "email property student Host."

    $message ="

    < html >

    < head >

    < title > expensive ".» GetSQLValueString ($_POST ["userid"], "text"). "< /title >

    < / head >

    < body >

                                  <img src=\" http://www.hoststudent.co.UK/beta/images/hostlogo.gif ' -' alt =------"-www.HostStudent.co.uk" / >

    < h2 > year students host Email < / h2 >

    < br / > < br / >

    < table >

    < b >

    Subject of the E-mail < td >: < table >

    < /tr >

    < b >

    < td >. GetSQLValueString ($_POST ['emailerSubject'], "text"). "< table >

    < /tr >

    < b >

    Content of the < td > < table > e-mail

    < /tr >

    < b >

    < td >. GetSQLValueString ($_POST ['emailerContent'], "text"). "< table >

    < /tr >

    < /table >

    < / body >

    < / html >

    ";

    Content-type always defined when sending HTML email

    $headers = "MIME-Version: 1.0 '. « \r\n » ;

    $headers. = "content-type: text / html;" charset = iso-8859-1 ". « \r\n » ;

    $headers. = "from: HostStudent.co.uk < " [email protected] > '. "\r\n";

    $send = mail ($to, $subject, $message, $headers);

    $updateGoTo = "TenantEmailSent.php";

    If (isset {}

    $updateGoTo. = (strpos ($updateGoTo, '?'))? « & » : « ? » ;

    $updateGoTo. = $_SERVER ['QUERY_STRING'];

    }

    header (sprintf ("location: %s", $updateGoTo));

    }

    @mysql_select_db ($database_hostprop, $hostprop);

    $query_Recordset1 = "SELECT username, email, emailerSubject, emailerContent FROM plus_signup";

    $Recordset1 = mysql_query ($query_Recordset1, $hostprop) or die (mysql_error ());

    $row_Recordset1 = mysql_fetch_assoc ($Recordset1);

    $totalRows_Recordset1 = mysql_num_rows ($Recordset1);

    ? >

    <?

    session_start();

    if(!$_SESSION['loggedIn']) / / if the user IS NOT connected, before they return to the login page

    {

    Header("Location:login.html");

    }

    ? >

    < script type = "text/javascript" >

    function loadFields (Value) {}

    var guarantor = Value.split("|");

    pseudo1 var = guarantor [0];

    var GuName = guarantor [1];

    var GuPhoneEmail = guarantor [2];

    document.getElementById('userid1').value = pseudo1;

    document.getElementById('GuName').value = GuName;

    document.getElementById('GuPhoneEmail').value = GuPhoneEmail;

    }

    < /script >

    < do action = "<?" PHP echo $editFormAction;? ">" method = "post" name = "form2" id = "form2" >

    < table align = "center" >

    < tr valign = 'of basic">

    < td nowrap = "nowrap" align = "right" > < table >

    < td > < select name = "userid" id = "userid" onchange = "loadFields (this.value)" >

    < option value = "select sponsor" > select guarantor < / option >

    <? PHP

    {}

    ? >

    < option value = "<?" PHP echo $row_Recordset1 ['userid']. '|' . $row_Recordset1 ["GuName"]. '|' . $row_Recordset1 ["GuPhoneEmail"];? > "> <?" PHP echo $row_Recordset1 ['userid']. " , " . $row_Recordset1 ["GuName"]. " , " . $row_Recordset1 ["GuPhoneEmail"];? > < / option >

    <? PHP

    } While ($row_Recordset1 = mysql_fetch_assoc ($Recordset1));

    $rows = mysql_num_rows ($Recordset1);

    If ($rows > 0) {}

    mysql_data_seek ($Recordset1, 0);

    $row_Recordset1 = mysql_fetch_assoc ($Recordset1);

    }

    ? >

    < / select > < table >

    < /tr >

    < tr valign = 'of basic">

    < td nowrap = "nowrap" align = "right" > tenant name < table >

    < td > < input type = "text" name = "pseudo1" id = "pseudo1" readonly = "readonly" = value "<?" PHP echo htmlentities ($row_Recordset1 ['userid'], ENT_COMPAT, ' utf - 8');? ">" size = "32" / > < table >

    < /tr >

    < tr valign = 'of basic">

    < td nowrap = "nowrap" align = "right" > GuName: < table >

    < td > < input type = "text" name = "GuName" id = "GuName" readonly = "readonly" = value "<?" PHP echo htmlentities ($row_Recordset1 ['GuName'], ENT_COMPAT, ' utf - 8');? ">" size = "32" / > < table >

    < /tr >

    < tr valign = 'of basic">

    < td nowrap = "nowrap" align = "right" > GuPhoneEmail: < table >

    < td > < input type = "text" name = "GuPhoneEmail" id = "GuPhoneEmail" readonly = "readonly" = value "<?" PHP echo htmlentities ($row_Recordset1 ['GuPhoneEmail'], ENT_COMPAT, ' utf - 8');? ">" size = "32" / > < table >

    < /tr >

    < tr valign = 'of basic">

    < td nowrap = "nowrap" align = "right" > GuEmailerSubject: < table >

    < td > < input type = "text" name = "GuEmailerSubject" value = "" size = "32" / > < table > "

    < /tr >

    < tr valign = 'of basic">

    < td nowrap = "nowrap" align = "right" > GuEmailerContent: < table >

    < td > < textarea name = "GuEmailerContent" cols = "45" rows = "5" > < / textarea > < table >

    < /tr >

    < tr valign = 'of basic">

    < td nowrap = "nowrap" align = "right" > < table >

    < td > < input type = "submit" value = "Email" / > < table >

    < /tr >

    < tr valign = 'of basic">

    < td nowrap = "nowrap" align = "right" > < table >

    < td > < table >

    < /tr >

    < /table >

    < input type = "hidden" name = "MM_update" value = "form2" / >

    < input type = "hidden" name = "userid" value = "<?" PHP echo $row_Recordset1 ['userid'];? ">" / >

    < / make >

    I found the problem, there are two forms of the same name...

    Thank you

Maybe you are looking for