Problem with PHP Session Variables

Hello all,
I am in the process of converting an internal company site
from ASP/Access to PHP/MySQL. All was going well until I started
working with User Authentication involving access level. No matter
what I do I can't seem to shake the MM_UserGroup variable.
I have a link on the main page that is variable dependent on
the access level of the user. If the user is logged in as a
Supervisor they should see a link to the supervisor control panel.
If logged in as a user or not logged in at all, they should see a
link to the supervisor login page.
I have put a Restrict Access function on the supervisor
control panel and it functions as usual. When logged in as a
supervisor I have access. When logged in as a user or not logged in
at all, I don't.
It seems that my homepage always sees the MM_UserGroup
variable set as "Supervisor". I can log in as a user, close the
browser, restart the server, everything and it always sees the
variable set as "Supervisor". Just to make sure I wasn't crazy I
put in an echo function so that it would display "MM_UserGroup". It
always says "Supervisor" no matter what I do. Using echo to show
the MM_Username variable, it functions as expected. When I close
the browser and reopen it, I get a nice error as expected because
there is no one logged in at that time. I still see "Supervisor"
staring me in the face though.
I'm sure it's something simple that I'm missing, not being an
experienced PHP user.
Any thoughts from the experts out there?
Thanks in advance,
David

aidan81 wrote:
> immediately upon login for a user, I see "User" printed
as expected. Once I
> use this page to edit their status, I am redirected back
to the main page as
> expected and immediately see "Supervisor" staring at me.
If I then revisit the
> user's edit page, it now says "Supervisor". Seems that
something screwy is
> going on and I'm at a loss....
It sounds as though you are reassigning the value of the
variable. If my
memory serves me right, ASP uses a single equal sign to
perform a
comparison. PHP uses two.
Check that you don't have something like this in your code:
if ($_SESSION['Authority'] = 'Supervisor') {
// do something
That will assign Supervisor to $_SESSION['Authority'].
It should be this:
if ($_SESSION['Authority'] == 'Supervisor') {
// do something
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Similar Messages

  • Help with php session variables

    I am using Dreamweaver 8 to set up a dynamic app with PHP and
    MySQL. I want the code that the user logs in with ('UPN') to be
    stored as a session variable so that recordsets on subsequent pages
    can be set to display personalised data.
    I have set the session variable like this: $_SESSION['UPN'] =
    'UPN' (UPN is the name of the form textfield, also set as the
    username for logging in)
    On the data page, I have called the variable like this:
    $query_Recordset1 = ("SELECT pupils.pupilID, pupils.UPN,
    pupils.forename, pupils.surname FROM pupils WHERE UPN = '" .
    $_SESSION['UPN'] . "'");
    The recordset returns nothing- the dynamic table returns ony
    the column headings (both as headings and immediately under where
    you would expect the data to be).
    Can anyone help?
    Thanks

    On Wed, 17 Oct 2007 11:43:04 +0000 (UTC), "denman"
    <[email protected]> wrote:
    > I have set the session variable like this:
    $_SESSION['UPN'] = 'UPN' (UPN is
    >the name of the form textfield, also set as the username
    for logging in)
    Your code assigns the literal string UPN to the session
    variable. If
    it's coming from POSTed form data, you'd need to do it like:
    $_SESSION['UPN'] = $_POST['UPN'];
    Gary

  • PHP Session Variable

    When using the PHP variable $_SESSION['idk'], what is the significance to the string 'idk'?
    I have been playing around with a login script, and I have seen some people throw 'user_login' or 'login' or 'user' and I figured it was just a way of labeling it essentially. But then I happened across a post where someone was generating and using a random string with the Session variable.
    Does this string have to be different for every user logging into a website? If not, what is the purpose of generating a random string to use in conjunction with the Session variable?
    Maybe any insight into different uses of the Session variable would be helpful as well.
    Thanks!

    With this post we're launching a new feature in the community: a look at a few of the day's top stories or issues. Let us know what you think – and where in the community you'd like to find these topics on a daily basis.Browser woes – Chrome 44 was released yesterday, but a "feature" of the latest softwarebroke some WordPress pluginsand many plugin developers have released updates to fix the problem. Meanwhile, HP's Zero Day Initiative disclosedfour zero-day vulnerabilitiesin Internet Explorer."Pocket dialing" privacy – A federal appeals court in Ohio hasruledthat anyone who accidentally "pocketdials" someone loses their right to privacy because they "lack a reasonable expectation that their conversations would not be intercepted, which is a prerequisite for protection under Title III."Bloomberg explains the background of the caseand...

  • A simple problem with sateful Session beans

    Hi,
    I have a really novice problem with stateful session bean in Java EE 5.
    I have written a simple session bean which has a counter inside it and every time a client call this bean it must increment the count value and return it back.
    I have also created a simple servlet to call this session bean.
    Everything seemed fine I opened a firefox window and tried to load the page, the counter incremented from 1 to 3 for the 3 times that I reloaded the page then I opened an IE window (which I think is actually a new client) but the page counter started from 4 not 1 for the new client and it means that the new client has access to the old client session bean.
    Am I missing anything here???
    Isn�t it the way that a stateful session bean must react?
    This is my stateful session bean source.
    package test;
    import javax.ejb.Stateful;
    @Stateful
    public class SecondSessionBean implements SecondSessionRemote
    private int cnt;
    /** Creates a new instance of SecondSessionBean */
    public SecondSessionBean ()
    cnt=1;
    public int getCnt()
    return cnt++;
    And this is my simple client site servlet
    package rezaServlets;
    import java.io.*;
    import java.net.*;
    import javax.ejb.EJB;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import test.SecondSessionRemote;
    public class main extends HttpServlet
    @EJB
    private SecondSessionRemote secondSessionBean;
    protected void processRequest (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    response.setContentType ("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter ();
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Servlet main</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h1>Our count is " + Integer.toString (secondSessionBean.getCnt ()) + "</h1>");
    out.println("</body>");
    out.println("</html>");
    out.close ();
    protected void doGet (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    processRequest (request, response);
    protected void doPost (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    processRequest (request, response);
    }

    You are injecting a reference to a stateful session bean to an instance variable in the servlet. This bean instance is shared by all servlet request, and that's why you are seeing this odd behavior.
    You can use type-leve injection for the stateful bean, and then lookup the bean inside your request-processing method. You may also save this bean ref in HttpSession.
    @EJB(name="ejb/foo", beanName="SecondBean", beanInterface="com.foo.foo.SecondBeanRemote")
    public MyServlet extends HttpServlet {
    ic.lookup("java:comp/env/ejb/foo");
    }

  • A problem with a session Access

     

    Hi Olivier,
    To connect with Forte while running distributed you must use System DNS
    instead of User DNS on the server. The ftexec.exe on your server partition
    will be launched by the NodeMgr running as UID SYSTEM. User DNS are not
    available to processes running as UID SYSTEM.
    Zenon Adamek
    Purolator
    -----Original Message-----
    From: Olivier Andrieux [SMTP:oandrieuxaxialog.fr]
    Sent: Tuesday, July 04, 2000 4:59 AM
    To: forte-userslists.xpedior.com
    Subject: (forte-users) A problem with a session Access
    Hi,
    We have defined a service object which calls a database Access, when we
    use the driver odbc of another station the service object is created and
    the application runs. But when we use the driver of the server we have an
    exception and this message :
    SYSTEM ERROR: Unable to start the partition AxiGecom_CL0_Part1 on any of
    the
    nodes to which it has been assigned. See the remainder of the error
    stack for
    more information.
    Class: qqsp_ResourceException
    Error #: [1602, 593]
    Detected at: qqcf_StandardConfig::LoadRemotePartition at 5
    Last TOOL statement: method InterfaceManager.PrepareLOM
    Error Time: Tue Jul 04 10:50:19
    Exception occurred (locally) on partition "Forte_cl0_Client",
    (partitionId
    = EB3ED870-274C-11D4-8051-304F7116AA77:0x3f9:0x2, taskId =
    [EB3ED870-274C-11D4-8051-304F7116AA77:0x3f9:0x2.15]) in application
    "FTLaunch_cl0", pid 149 on node STAT10 in environment axialog.
    SYSTEM ERROR: Unable to start partition AxiGecom_CL0_Part1 on node
    SERVEUR59B.
    Class: qqsp_ErrorDescriptor
    Error #: [1602, 592]
    Detected at: qqcf_StandardConfig::LoadRemotePartition at 3
    Error Time: Tue Jul 04 10:50:19
    Exception occurred (locally) on partition "Forte_cl0_Client",
    (partitionId
    = EB3ED870-274C-11D4-8051-304F7116AA77:0x3f9:0x2, taskId =
    [EB3ED870-274C-11D4-8051-304F7116AA77:0x3f9:0x2.15]) in application
    "FTLaunch_cl0", pid 149 on node STAT10 in environment axialog.
    SYSTEM ERROR: Attempt to load partition named AxiGecom_CL0_Part1 failed.
    Class: qqsp_ResourceException
    Error #: [1001, 4]
    Detected at: qqrt_ForteExecAgent::LoadPartition at 1
    Error Time: Tue Jul 04 10:49:15
    Distributed method called: qqrt_ForteExecAgentProxy.LoadPartition!6
    (object name Unnamed) from partition "Forte_cl0_Client",
    (partitionId =
    EB3ED870-274C-11D4-8051-304F7116AA77:0x3f9:0x2, taskId =
    [EB3ED870-274C-11D4-8051-304F7116AA77:0x3f9.4]) in application
    "FTLaunch_cl0", pid 149 on node STAT10 in environment axialog
    Exception occurred (remotely) on partition "Forte_Executor",
    (partitionId
    = EB3ED870-274C-11D4-8051-304F7116AA77:0x3de, taskId =
    [EB3ED870-274C-11D4-8051-304F7116AA77:0x3de.61]) in application
    "AxiGecom_cl0", pid 386 on node SERVEUR59B in environment axialog.
    SYSTEM ERROR: Failed to create service object
    Axigecom_Serveur.Connection_BD.
    Class: qqsp_ResourceException
    Last TOOL statement: method qqsp_NameList.
    Error Time: Tue Jul 04 10:49:15
    Exception occurred (remotely) on partition "Forte_Executor",
    (partitionId
    = EB3ED870-274C-11D4-8051-304F7116AA77:0x3de, taskId =
    [EB3ED870-274C-11D4-8051-304F7116AA77:0x3de.61]) in application
    "AxiGecom_cl0", pid 386 on node SERVEUR59B in environment axialog.
    USER ERROR: (This error was converted)
    Failed to connect to database: Axigecom, username: Administrateur.
    [Microsoft][Gestionnaire de pilotes ODBC] Source de donn&eacute;es non
    trouv&eacute;e et
    nom
    de pilote non sp&eacute;cifi&eacute;
    Class: qqdb_RemoteAccessException with ReasonCode:
    DB_ER_DBMSCONNECTION
    DBMS SQLSTATE: IM002
    Class: qqsp_ErrorDescriptor
    Detected at: qqdb_OdbcVendorInfo::DoSQLConnect at 10
    Last TOOL statement: method qqsp_NameList.
    Error Time: Tue Jul 04 10:49:15
    Exception occurred (remotely) on partition "Forte_Executor",
    (partitionId
    = EB3ED870-274C-11D4-8051-304F7116AA77:0x3de, taskId =
    [EB3ED870-274C-11D4-8051-304F7116AA77:0x3de.61]) in application
    "AxiGecom_cl0", pid 386 on node SERVEUR59B in environment axialog.
    for information, we use a server NT and the stations use Nt, the drivers
    DNS users are declared.
    We use Access2000, and the version M for Fort&eacute;
    Thanks in advance,
    Olivier Andrieux
    AXIALOG
    France

  • Servlet/PHP Session Variables

    Hello Everyone,
    I am running an servlet that requires authentication. The authentication is done by a PHP program, while the heavy lifting is done by a servlet. How do I pass a session variable from my php to my servlet so that my servlet knows the user is allowed. I have tried
    Object done = session.getAttribute("loggedIn");
    with "loggedIn" being set by my php file, but done is always null. Any help is greatly appreciated especially if it is cookie free.
    Sincerely,
    Chem E

    You could consider the following solution: on click of the link, fire a specific Ajaxical request from the server where PHP runs to the server where Java runs to obtain an lengthy and unique key which expires within a few seconds, use JS+DOM to add that key as a query parameter to the link value and after opening the link let the Java side determine the key and handle accordingly.
    You only need to write code so that it is hack safe.

  • Hello, I have a big problem with Firefox: Session Manager & Undo Closed Tab addons are not working, Sync Is not working. History is working. How to fix this?

    Firefox remembers history but doesn't remember closed tabs, sessions.
    It happened after updating Fox to v. 19.0.2 on one computer.
    In Firefox Options is set Use Custom Settings For History, everything is checked except Always Use Private Browsing Mode. So I am not in private browsing.
    When I press on Undo Closed Button nothing happens & in session manager Save Session Button is greyed out. I've tried installing other add-ons that can remember tabs. tried to disable/reinstall these 2 add-ons. Did't help. On my 2nd computer I have same add-ons, same settings and they are working normally. on 3rd computer undo closed tabs works also. How to fix this? I decided to ask before doing Firefox Reset...
    Sync is a separate problem. It works, but quite often it logs me out of Sync account. Then I can log in only using long recovery key and password (choosing option I don't have device with me because it does not accept keys for pairing device.)
    Thanks for reading.

    I have exactly the same settings in Options (in both computers)
    for history, these 2 add-ons and all other stuff in Options. The only difference is that on 1 pc sessions can be saved and closed tabs can be reopened, on other main pc they stopped to work. + no any other add-on that does similar things works on this pc.
    It is also interesting that I can reopen closed visited sites from History Panel, but not by pressing the Button. For now I only manually bookmark links to a temporary folder.
    Recently (some 2 month ago) I pressed x and Firefox closed all tabs without saving them without displaying save & quit pop up.
    so I changed 4 settings in about.config
    browser.tabs.warn on close true
    browser.warn on quit true
    browser.warn on restart true
    browser.show.quit warning true
    but the problem with sessions appeared only 1 week ago.
    So I guess the problem is not with the History settings or other settings. Seems that something responsible for button or for storing info about tabs/sessions got corrupted. :(

  • Problem with php code. Please help!

    Hello!
    I'm using the following syntax to bring content into my
    websites' layout template:
    Code:
    <?php //check in the root folder first
    if(file_exists('./' . $pagename . '.php'))
    include './' . $pagename . '.php';
    //if it wasn't found in the root folder then check in the
    news folder
    elseif(file_exisits('./news/' . $filename . '.php'))
    include './news/' . $pagename . '.php';
    // if it couldn't be found display message
    else
    echo $pagename . '.php could not be found in either the root
    folder or the news folder!';
    } ?>
    What it's essentially saying is, if you can't find the .php
    file in the _root folder, look for it in the /news/ folder.
    It works perfectly if loading something from the _root folder
    but I get an error if I need to bring something from the /news/
    folder.
    Can anyone see any potential problems with my code?
    Thank you very much and I hope to hear from you.
    Take care,
    Mark

    I've never seen the code written like that before, but I'm
    assuming it's
    legal?
    Perhaps try:
    <?php
    $newsroot = $_SERVER['DOCUMENT_ROOT']."/news";
    if (!file_exists("$pagename.php")) {
    elseif (!file_exists("$newsroot/$pagename.php")) {
    else
    Or the other thing you can try is replacing the elseif
    statement with:
    elseif (!file_exists("news/$pagename.php"))
    If not - I'm sure Gary will be on here soon...
    Shane H
    [email protected]
    http://www.avenuedesigners.com
    =============================================
    Proud GAWDS Member
    http://www.gawds.org/showmember.php?memberid=1495
    Delivering accessible websites to all ...
    =============================================
    "Spindrift" <[email protected]> wrote in
    message
    news:e5mled$272$[email protected]..
    > Hello!
    >
    > I'm using the following syntax to bring content into my
    websites' layout
    > template:
    >
    > Code:
    >
    > <?php //check in the root folder first
    > if(file_exists('./' . $pagename . '.php'))
    > {
    > include './' . $pagename . '.php';
    > }
    > //if it wasn't found in the root folder then check in
    the news folder
    > elseif(file_exisits('./news/' . $filename . '.php'))
    > {
    > include './news/' . $pagename . '.php';
    > }
    > // if it couldn't be found display message
    > else
    > {
    > echo $pagename . '.php could not be found in either the
    root folder or
    > the
    > news folder!';
    > } ?>
    >
    > What it's essentially saying is, if you can't find the
    .php file in the
    > _root
    > folder, look for it in the /news/ folder.
    >
    > It works perfectly if loading something from the _root
    folder but I get an
    > error if I need to bring something from the /news/
    folder.
    >
    > Can anyone see any potential problems with my code?
    >
    > Thank you very much and I hope to hear from you.
    >
    > Take care,
    >
    > Mark
    >

  • Problems with a session of batch input - In processing

    Hello!
    I have a problem with a depreciation posting Session (AFAB). User has stoped the process of session and now the status is 'In Processing' and we can't run it anymore...
    ¿How I can process this Session?
    I've tried to delete the session and re-run the depreciation posting, but it's not working.
    I've tried to delete in TABA table the line of this period, but it's not working.
    I've tried to suicide me, but... it's not working.
    I'll try to kill the user, I hope that It will work.
    Can you help me? Please.
    Thanks a lot!!!

    Dear Jorge,
    In SM35 analyze your session.
    If it was processed in background go to transaction SM37. Else, you can proceed in SM35 itself.
    Regards,
    Naveen.

  • Problem with PHP, CSS & Code Navigator in CS4

    Hi,
    I've got al little problem with code navigator. To show the problem, I created this 3 files:
    test1.html
    The CSS-Definition is defined static, with simple HTML.
    <html>
    <head>
         <style type="text/css">
              @import "test.css";
         </style>
    </head>
    <body>
          <p>Hello World</p>
    </body>
    </html>
    test2.php
    The CSS-Definition is defined dynamic, with PHP-Code.
    <html>
    <head>
         <style type="text/css">
              <? echo "@import \"test.css\";\n"; ?>
         </style>
    </head>
    <body>
          <p>Hello World</p>
    </body>
    </html>   
    test.css
    The CSS-File which is imported in test1.html and test2.php
    p {
         font-size:20px;
    The Problem in Dreamweaver CS4
    When opening the test.html - File in Dreamweaver CS4, I can easily see the CSS-Definition of the <p>-Tag in Code Navigator. To edit these definition I can simple open the test.css by clicking on the definition in Code navigator. For a complex webpage this is a greate feature. Sadly, this does not work, when I open the test2.php. Although when going to Live View and selecting the <p>-Tag I can see the CSS-Definition and the file in which it is defined in Code Navigator. But by clicking on the definition the test.css DOES NOT OPEN!
    Has anybody a solution? Because many of our projects have dynamic CSS-Definitions, it would be a shame, if this would not work.
    Tanks for help! :-)

    I've done some testing, which might point you in the direction of an interim solution.
    This is the code for related_files.php:
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Related files test</title>
    <?php include('include.css'); ?>
    </head>
    <body>
    <p>This is a paragraph.</p>
    </body>
    </html>
    This is the code for include.css:
    <style type="text/css">
    p {
         font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
         color:#F00;
    </style>
    Note that the include file contains the opening and closing style tags.
    By including your styles like this in a PHP include file, Dreamweaver applies the CSS in Design view (you don't need to turn on Live View). Holding down the Alt key while clicking in Design view brings up the Code Navigator with all the details of the CSS. The one missing link in the chain is that clicking the style selector in the Code Navigator does not open the CSS file. However...
    The file that contains the CSS is listed in the Related Files toolbar, so you can edit it in Split view, and see the results in Design view in exactly the same way as with an HTML page and ordinary style sheet.
    As I say, not the full solution that you wanted, but it might be something worth experimenting with.

  • Problems with maintaining session state using mod_ose

    I am using 9i AS(version 1.0.2.0) and oracle 8i(version 815).
    Because i need to maintain client sessions for my application, I
    have activated mod_ose(for stateful session). As suggested in
    the oracle documentation, i created a package containing
    variables for which state needs to be maintain per client. The
    state is maintained by the app server but it is not maintained
    properly. All the new clients that connect to the app server
    share the same session variable values. If I change a package
    variable value from one client, other clients take the same
    value.
    Any solution?
    Suggestions are most welcome.
    Thanks in advance.

    We installed oracle9i AS on solaris, configured OSE and the
    problem is not occuring now. Not sure whether its solaris that
    worked or 9i AS had some problem on NT machine earlier.
    Regards,
    Sharad

  • Problem with BW exit variable on range of dates

    Hi everyone:
    I have a problem with exit variables in BW, the scenary is following:
    I need to generate a ratio MTD (month to date, i mean, first day of the month to actual date), for this, I enter a date by keyboard, for example 31.12.2010 and BW must return the range 01.12.2010 - 31.12.2010. The problem is what BW returns: 31.12.2010 - 31.12.2010, i mean, repeats the same date entry by keyboard.
    For this porpuse I have a variable of interval type called "ZCALDAY" on infoobjeto 0CALDAY, and  exit variable of interval type called "ZRANGE", the code in CMOD is the following:
    DATA: L_RANGE         TYPE RRS0_S_VAR_RANGE,
                L_P_RANGE   TYPE RRS0_S_VAR_RANGE,
                L_S_RANGE   TYPE RSR_S_RANGESID.
    when 'ZRANGE'.
         BREAK-POINT.
         IF I_STEP = 2.
           CLEAR l_s_range.
           READ TABLE i_t_var_range INTO loc_var_range WITH KEY vnam = 'ZCALDAY'.
           CONCATENATE loc_var_range-low(6) '01' INTO l_s_range-low.
           l_s_range-high = loc_var_range-low.
           l_s_range-sign    = 'I'.
           l_s_range-opt     = 'BT'.
           APPEND l_s_range TO e_t_range.
        ENDIF.
    I doing Something wrong with the variables definition or on the  code??
    I hope you can help me....
    Best regards!!!!
    Cesar.

    Thanks!!
    I think the problem is other, I check the RSRT transaction and the range is calculated ok, i mean, the range generated is 01.12.2010..31.12.2010.
    But the query does not show the data corresponding. the query shows the values of the day 31.12.2010.
    The interval are not restricting the key figure...
    I used the variable exit "ZRANGE" on the key figure restriction and the variable ZCALDAY in the filters section.
    Maybe, the variable definition is wrong (variable ZCALDAY and exit variable ZRANGE)
    Thanks!!!

  • Comma problem with global string variable

    Hi,
    I'm fiighting with comma problem for global string variable. I've on page string for example "7nndqrr52vzyb,0" and by dynamic column link I'm assigning this string to global variable. Then I'm trying to display value of that global variable on another page but I see only string till comma, nothings more. I'm not sure what I'm doing wrong because when I'm trying to assign that value normally by computation process as a constant value is fine and see on another page correct string. I'll be really glad for help.
    Thanks
    Cheers,
    Mariusz

    When it tries to display the string, it sees the comma and wants to believe the string is terminated. You could escape the , in the string or replace it with a different character..
    See this link: http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/concept.htm#BEIGDEHF
    Thank you,
    Tony Miller
    Webster, TX
    If vegetable oil is made of vegetables, what is baby oil made of?
    If this question is answered, please mark the thread as closed and assign points where earned..

  • Problems with php script in the contact form

    Hello, I am from the Czech Republic and I am not a coder. I have 2 problems with my php sript. I am using a simple php script from Paul Trani, see below.
    Firstly the email adress - when someone inserts an email adress in this form [email protected] it is OK, but when someone writes an address for example [email protected] (this type of adress is very common in our country) the answer is "That is not a valid email address.  Please return to the previous page and try again." I think the problem is the dot before the @.
    Secondly diacritical marks - Since I am from the Czech Republic we use diacritical marks (for example š,č,ř,ž,á,í,é,ě) so instead of this letters a get ? or Å&#153; or Å¡ to my email.
    I really do not know how to fix these problems.
    Thank you for any help. Sorry for my English. Peter
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <META HTTP-EQUIV="refresh" content="0;URL=thankyou.html">
    <title>Email Form</title>
    </head>
    <body>
    <?php
      $name=addslashes($_POST['name']);
      $email=addslashes($_POST['email']);
      $comments=addslashes($_POST['message']);
    // you can specify which email you want your contact form to be emailed to here
      $toemail = "[email protected]";
      $subject = "From EcoStyleStudio.com";
      $headers = "MIME-Version: 1.0\n"
                ."From: \"".$name."\" <".$email.">\n"
                ."Content-type: text/html; charset=iso-8859-1\n";
      $body = "Name: ".$name."<br>\n"
                ."Email: ".$email."<br>\n"
                ."Comments:<br>\n"
                .$comments;
      if (!ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email))
        echo "That is not a valid email address.  Please return to the"
               ." previous page and try again.";
        exit;
        mail($toemail, $subject, $body, $headers);
        echo "Thanks for submitting your comments";
    ?>
    </body>
    </html>

    ereg() has been deprecated, it is recommended that you dont use it.
    You want to look at this
    http://www.php.net/manual/en/function.preg-match.php
    Within this page I found this:
    If you need to check for .com.br and .com.au and .uk and all the other crazy domain endings i found the following expression works well if you want to validate an email address. Its quite generous in what it will allow
    <?php
            $email_address = "phil.taylor@a_domain.tv";
         if (preg_match("/^[^@]*@[^@]*\.[^@]*$/", $email_address)) {
             return "E-mail address";        
    ?>

  • Insert problems with Php Data Services

    Hi All,
    I am using Flex Data wizards to create a simple CRUD application and i am having problems adding data. It works the first time i start my application but subsequent calls to the insert fail.
    I am using FB2 Beta with MAMP. The php classes are being generated using the data wizard. i have tried commenting out mysqli_close but still it doesn't work.
    public function createDive_events($item) {
    $stmt = mysqli_prepare($this->connection, "INSERT INTO $this->tablename ( divedate, divesite, divecost, description, totalDays) VALUES ( ?, ?, ?, ?, ?)");
    $this->throwExceptionOnError();
    mysqli_bind_param($stmt, 'ssdsi', $item->divedate, $item->divesite, $item->divecost, $item->description, $item->totalDays);
    $this->throwExceptionOnError();
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    $autoid = mysqli_stmt_insert_id($stmt);
    mysqli_stmt_free_result($stmt);
    //mysqli_close($this->connection);
    return $autoid;
    Any ideas, what i am doing wrong. I have tried using the update and it works only once as well, it seems that the connection to the function is lost after the first call.
    thank you,
    Nayan

    Ok, this is what I got.
    create a mysql table (`people`) with columns id (auto increment), first_name, last_name, age
    in the data/service panel connect to a php service, generate a php service from the database and the people table
    generate a form from the createPeople service call
    observe that in source view we have something like this: <fx:Script>
      <![CDATA[
           protected function button_clickHandler(event:MouseEvent):void {
              createPeopleResult.token = peopleService.createPeople(people);
      ]]>
    </fx:Script>
    <fx:Declarations>
      <valueObjects:People id="people"
                           people_id="{parseInt(people_idTextInput.text)}"
                           age="{parseInt(ageTextInput.text)}"/>
      <peopleservice:PeopleService id="peopleService"/>
      <s:CallResponder id="createPeopleResult"/>
    </fx:Declarations>
    If you now try to execute the code, you will find that you can only insert one person, where each successive addition silently fails.
    There is nothing really wrong with the php code (well actually since it's auto incrementing on id you should pull all id reference out of the insert statements...) rather there is a problem with the flex people object.
    If you make the following changes the code will work
    protected function button_clickHandler(event:MouseEvent):void {
      var myPerson:People = new People();
      myPerson.first_name = people.first_name;
      myPerson.last_name = people.last_name;
      myPerson.age = people.age;
      createPeopleResult.token = peopleService.createPeople(myPerson);
    - e

Maybe you are looking for

  • Problem with switch

    Hi, I have a problem using switch statement. I have a class named Resources in which I declare all the final variables. I have created an instance of Resources named res in the main class. But I cannot use the final variables in the main class in the

  • Hard drive will not mount. At first would not back up.

    I use an external hard drive to do Time Machine backups. After a while Time Machine was no longer able to back up. I thought I would do an experiment and switch out it's Firewire 800 cable with a USB cable. Since then it has not been able to mount at

  • Question regarding having two keyfigures in one line

    Hello I  have a requirement. I need values of two keyfigures from one cube in one row in the BEX Report. Basically depending on the month i want 6 months of history keyfigure value and 12 months of forecast keyfigure value in BEX reporting in one row

  • 1/3 of the screen shows nothing but black

    I searched all over the internet, and I am afraid I am the only person who has encountered this problem. I was watching a movie through air video, and the video freezes. When I hit the home button, 1/3 of the screen is still showing the frozen frame

  • Will wifi in europe push pictures to my iPad?

    will taking pictures on my verizon iphone push to my ipad using wifi? in europe