DWCS6: homepage with Log in box that changes

Hello everyone, sorry if my questions are stupid, but i'm sort of new about PHP/mysql, i've just learnt how to use databases and so.
I've checked on google and i couldn't find an answer. I checked on the forum here and i couldn't find what i needed. I'm talking about this:
I'd like to create a Homepage with the usual "Log in" box. And no problems here. Now, after a user logs in,that login box has to "disappear" and be replaced by another box, with "Welcome, UserName!" without the fields of the log in box. To explain better:
Before --> box with " Username field, Password field, Log in button | Register button | Forgot your password?"
After the log in --> box with "Welcome username! | Your control panel | Log out button"
1) How can i change that box to show something before the login and something else after? I have to redirect the user to an equal page but with a different box (like page1 with login box and page2 with the logged in user box)?
2) How can i keep the name of the user in the other pages too? something like "xxx.php?IDuser=<etc etc>" in the links with the recordset of the pages on the IDUser filter (when IDUser is = to the parameter from the URL)?
3) And about the control panel, i have to use IDUser so that user can see his/her data (to check, modify, change, etc)?
Thanks all for the attention.

This is the code of the page. I remade it and removed all the extra things. There are the DW automatic codes for:
- 1 connection, called "amontech"
- recordset, called rsLogin with IDUser, nome, cognome, email, username and password
- 1 server behavior, for the user log in
- the standard html from a model (2 columns + header and footer)
- 1 external CSS file called styles.css
<?php require_once('Connections/amontech.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  if (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 "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  return $theValue;
$colname_rsLogin = "-1";
if (isset($_SESSION['IDUser'])) {
  $colname_rsLogin = $_SESSION['IDUser'];
mysql_select_db($database_amontech, $amontech);
$query_rsLogin = sprintf("SELECT * FROM utenti WHERE IDUser = %s", GetSQLValueString($colname_rsLogin, "int"));
$rsLogin = mysql_query($query_rsLogin, $amontech) or die(mysql_error());
$row_rsLogin = mysql_fetch_assoc($rsLogin);
$totalRows_rsLogin = mysql_num_rows($rsLogin);
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
  session_start();
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
if (isset($_POST['username'])) {
  $loginUsername=$_POST['username'];
  $password=$_POST['password'];
  $MM_fldUserAuthorization = "";
  $MM_redirectLoginSuccess = "index.php";
  $MM_redirectLoginFailed = "error.php";
  $MM_redirecttoReferrer = false;
  mysql_select_db($database_amontech, $amontech);
  $LoginRS__query=sprintf("SELECT username, password FROM utenti WHERE username=%s AND password=%s",
    GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
  $LoginRS = mysql_query($LoginRS__query, $amontech) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
     $loginStrGroup = "";
  if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;     
    if (isset($_SESSION['PrevUrl']) && false) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
    header("Location: " . $MM_redirectLoginSuccess );
  else {
    header("Location: ". $MM_redirectLoginFailed );
?>
<!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>AmonTech |</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="container">
  <div class="header"><a href="#"><img src="" alt="Inserite qui il logo" name="Insert_logo" width="220" height="90" id="Insert_logo" style="background-color: #C6D580; display:block;" /></a>
    <!-- end .header --></div>
  <div class="sidebar1">
    <ul class="nav">
      <li><a href="#">Link1</a></li>
      <li><a href="#">Link2</a></li>
      <li><a href="#">Link3</a></li>
      <li><a href="#">Link4</a></li>
    </ul>
    <div id="login_box">
      <p> </p>
      <form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
        <p>User Log Ini</p>
        <p>Username:
          <label for="username"></label>
          <input type="text" name="username" id="username" />
        </p>
        <p>Password:
          <label for="password2"></label>
          <input type="text" name="password" id="password2" />
        </p>
        <p>
          <input type="submit" name="pulsantedati" id="pulsantedati" value="Log In" />
        </p>
      </form>
      <p>  </p>
      <p>Welcome,  !     
      </p>
      </div>
    <p> </p>
    <!-- end .sidebar1 --></div>
  <div class="content">
    <h1> </h1>
    <!-- end .content --></div>
  <div class="footer">
    <p>-----</p>
    <!-- end .footer --></div>
<!-- end .container --></div>
</body>
</html>
<?php
mysql_free_result($rsLogin);
?>

Similar Messages

  • HT201272 I just bought a new iPad. When I tap on Purchase in the App store I see all my previously purchased apps each with a little box that says open. There is no download cloud. How do I get these apps onto my home screen?

    I just bought a new iPad and the apps I had previously purchased are in the app store under Purchased. They appear with a little box that says "Open". There is no download cloud so I can't click on them to download the apps to my home screen. Is there a way to move these apps to my home screen?

    If they have 'open' next to them then that implies that they are already on your iPad - if you tap on the 'open' button does that open the app ? If it does then they are on your iPad. You've checked all your homescreens and tried a soft-reset to see if they show after the iPad has restarted : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • How can I install Adobe flash player on my Mac using Safari OR Chrome? I have gone through every step on all of the help pages. The installation process always stops with the black box that briefly says, "Retrieving Install . . . ", then nothing.

    I have followed every step in the various help pages I was directed to when troubleshooting the inability to install Adobe Flash Player on my Mac using either Safari or Chrome. Everything has failed. I always get the black box that says briefly, "Retrieving instal. . . " and then goes blank. When I close that window, I get the message, "Adobe Flash Player could not be installed." Then it gives some links to follow for troubleshooting. I have followed ALL of the links there and on other help pages, to no avail. I've run into problems installing Adobe before, but it's never been this bad. Would someone please develop another format besides Adobe? Trying to get help from Adobe feels a little like trying to find a building in New York City with no map or GPS. The time required is voluminous, the emotional energy a/k/a frustration is overwhelming, and long before I get anything resolved, I wish the earth would open up and swallow all things Adobe@. Absence that miraculous intervention, I have to figure out what to do next. Does anyone know? Anyone?

    Same question, same answer: use the offline installer http://fpdownload.macromedia.com/pub/flashplayer/latest/help/install_flash_player_osx.dmg

  • Make box that changes color depending on button pressed

    I need to be able to press 1 of 6 buttons that change
    graphics to a page on a single-frame site I'm building. This is the
    first time I've built a single frame site (calling swf's) and it
    seems easy but having the green button fade whatever color exists
    down while fading green up and isn't as easy as I thought. In order
    for it to be "smart" and know what color is there so it can fade it
    (probably even easier way than being color specific - but I
    obviously don't know it).
    Just getting into the AS2 part of flash and trying to meet
    deadlines while learning is hard to do, so thanks for the help!

    Hello:
    Say you have a page that has 2 regions R1 and R2. Each region has a button that when clicked submits the page. The buttons are named B1 and B2. Further, F1 and F2 are the first fields in region R1 and R2. There also is a hidden item named H1 on the page (region does not matter). So, you define a pl/sql page process with a process point of 'After Submit...' with the following codeif :request in ('B1') then
       :H1 := 'F1';
    end if;
    if :request in ('B2') then
       :H1 := 'F2';
    end if;The APEX built-in variable named 'REQUEST' is automatically assigned a value of the button that caused the page to submit.
    Varad

  • What is with the dialog box that pops up when I try to back out og a page that has to resend info or some such reason.

    In some sites when I try to back out of a window I get a pop up box with the title "CONFIRM" and it has something to do with resending info or something of that nature.
    It is a pain in the posterior I would like to disable it if possible. I don't remember right off hand which sites it is, but it is in some of my bookmarked woodworking sites and sites dealing with sales of woodworking supplies.

    See '''''cor-el's''''' answer to that question here (only the portion down to the line break): http://support.mozilla.com/en-US/questions/781372?s=resend+&as=s
    <br />
    <br />
    '''Other issues needing your attention'''
    The information submitted with your question indicates that you have out of date plugins with known security and stability issues that should be updated. To see the plugins submitted with your question, click "More system details..." to the right of your original question post. You can also see your plugins from the Firefox menu, Tools > Add-ons > Plugins.<br />
    <br />
    *Next Generation Java Plug-in 1.6.0_17 for Mozilla browsers
    **7 updates behind
    **'''''Security update version 1.6.0_24 released 2011-02-10'''''
    #'''Check your plugin versions''': http://www.mozilla.com/en-US/plugincheck/
    #*'''Note: plugin check page does not have information on all plugin versions'''
    #'''Update the [[Java]] plugin''' to the latest version.
    #*Download site: http://www.oracle.com/technetwork/java/javase/downloads/index.html (Java Platform: Download JRE)
    #**'''''Be sure to <u>un-check the Yahoo Toolbar</u> option during the install if you do not want it installed.
    #*Also see "Manual Update" in this article to update from the Java Control Panel in Windows Control Panel: http://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox#Updates
    #* Removing old versions (if needed): http://www.java.com/en/download/faq/remove_olderversions.xml
    #* Remove multiple Java Console extensions (if needed): http://kb.mozillazine.org
    #*Java Test: http://www.java.com/en/download/help/testvm.xml

  • HT204406 On Phase 3, I keep getting hung up with a Dialog box that says " itunes file cannot be saved.  You do not have enough access privileges.  Does anyone know what this means and how to solve it?

    I amy trying to complete IMatch, but on PHase 3, I get the error message: The itunes file cannot be saved.  You do not have enough access privileges for this operation.  Does anyone have the same issue, or know how to fix it.  Thank you!

    I didn't know that iTunes had a 64bit download. I have Windows 7 Home Premium with 64bit operation system. I downloaded the iTunes for 64bit and it seems to have corrected the problem. I haven't received the message yet since I did this.

  • I am trying to use automator to make a simple app that when I open it, it comes up with a dialog box that asks for a link that you want to download. and it will download it for you using the curl -O shell script in Terminal. How would I do it?

    I want this so I can just download anything I want by just having the link and I have made a few things with shell scripts in automator before, just never anything where i need to input a value into the shell script.

    Easy:

  • Why would I get an important message that says, "I can see you" It was a loud alarm with a message box.

    My Iphone 4s had a loud alarm with a text box that said I can see you!  I was trying to copy and paste in my contacts at the time it occured.  It kinda freaked me out.

    This was an iCloud message.  I received an email that was from find myiphone. It stated your message was sent to the phone. The funny thing is that I don't remember messing around with the find my iPhone feature. I may try to explore the find my iPhone feature some more. Thanks for the responses everyone. The message had a loud continuous alarm even though my phone was set to vibrate.
    Thanks again

  • Help with log function

    Hallow experts,
    I'm doing an  interface from sap into anther  application and in this interface (log interface) I use two  function  below in program and I have to send to customer in text file in which field of infotype change was made
    This to function helping me but I miss the action like insert was made or update or delete
    Did dome one can help me with that?
    HREIC_GET_LOGGED_INFTY_CHANGES
    HR_INFOTYPE_LOG_GET_DETAIL
    Best Regards

    hi Naveen Bathini
    thankes for your answer
    i thihk u dont understand me ,
    HR_INFOTYPE_LOG_GET_DETAIL bring table fields with all the field that change
    but i dont now if user create new infotype for employee or just take one field and change it like from infotype 0006 just change street or postal code
    i wont to now if it is an insert (create new infotype ) or update or delete fields from infotype.
    Best regards

  • HT201628 I can't get the new version of iTunes to download, I keep getting a dialog box that "Apple Mobile Device" failed to start and asks me to verify that I have sufficient priveleges. How do I fix this?

    I tried to install the new version of iTunes days ago. It seems like it's going to install and then it comes up with a dialog box that says "Apple Mobile Device" failed to start and to verify I have sufficient priveleges. I don't know what I need to do to get it to install.

    It seems like it's going to install and then it comes up with a dialog box that says "Apple Mobile Device" failed to start and to verify I have sufficient priveleges.
    Try the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • How do I upgrade Adobe reader - currentlyevery time I try to download a PDf file on my macpro I get a grey screen  and a dialog box that says adobe reader is blocked for this website...

    Help - a couple of weeks ago I tried up upgrade adobe reader but it never completed loading as far as I can find / that night would never finish
    ( how would I know , where would I check?)
    now every time I need to download a PDF file ( dental claim forms tonight) I get a grey screen with a dialog box that says Adobe reader blocked for this site
    and that happens on any site where I am trying to download a PDF…?

    What is your operating system?  Reader version?  Downloading from what browser?

  • When I log onto my macbook, my user account isn't showing up. All that shows up is a gray screen with only two boxes saying "Name" and "Password". How do I fix this?

    There was one time where my wi-fi wasn't connecting so I tried to turn it back on. A window popped up but I had alrdy clicked enter before I read it, but it said something like "...will change settings, is that okay...?" And then wi-fi still would not connect. So I tried restarting my computer, but when it turned on, my user account did not show up and all there was on the screen was two boxes that asked for name and password. I was the only person using my macbook so I never set up a password for it. Has anyone had this problem? How do I fix this?

    Since I'm not in front of your computer I can't tell what you see - I can only guess and give a hint. So once again, if the disk name on your Mac is "Macintosh HD", when you boot in Recovery Mode, and start up the Terminal in "Utilities" menu, and then type in the command:
        df -k
    you should see a list of "volumes" - one of which is named "/Volumes/Macintosh HD" (but yours could be anything) and in that folder there is another folder called "Users" and in that folder is the names of the home directories of the user accounts (and the names that you can enter into the login screen) that you are looking for. So if you are not familiar with using the Terminal you should say so and I can give more details. But assuming you're OK with typing in commands to theTerminal this is what I would try:
        ls -l /Volumes/Macintosh HD/Users
    and you should see something like the following (my disk name is "Yosemite" so I typed "ls -l /Volumes/Yosemite/Users")
    ML9Book:~ xxxx$ ls -l /Volumes/Yosemite/Users
    total 0
    drwxr-xr-x+  11 Guest      _guest   374 Oct 25 19:23 Guest
    drwxr-xr-x+  33 Jack       staff   1122 Oct 24 10:49 Jack
    drwxrwxrwt   13 root       wheel    442 Dec 27  2013 Shared
    drwxr-xr-x+  38 admin      staff   1292 Oct 25 16:59 admin
    drwxr-xr-x+  15 x13        staff    510 Oct 23 22:41 x13
    drwxr-xr-x+  12 514        staff    408 Oct 23 12:24 x14
    So now reboot your mac into normal mode - and you will see the login screen with the two empty boxes.
    So the above output tells me that there are 3 users - Jack, x13 and x14 (there is always a Shared user and there might or might not be a Guest user since it depends on how your setup was setup) - and these 3 are the names that I could try and enter into the login screen (in the top or first box). You can try no password, but I don't think you can create accounts without passwords, so this will likely fail. In that case you need to reboot in recovery mode and run the Terminal command again (from the Utilities menu) and do a resetpassword command. Another window will pop up and from there you select the Volume (in my case I selected the Yosemite volume - in your case you would select the "Macintosh HD" if that is what your volume name is). Then select the user account you want to reset the password from the drop-down list of user accounts (it will show you the long and short names, and the short name is what was in the listing above from the "ls -l" command), then enter the new password in the indicated box, and then enter it again in the next box, to make sure you didn't make a typo, and enter a password hint in the last box (optional). Then click the "Save" button and you will see another dialog box pop up telling you that the password was changed but not the Keychain password (hopefully you remember this one) - click the OK button then reboot back in normal mode (click on the Apple logo in the top left corner of the screen and click on Restart).
    Does this help?

  • I created a new Apple ID for iCloud on my iPhone, but I can't seem to find a way to "sign out" or "log out" of that Apple ID (for iCloud) to sign in with another Apple ID. The only account login I could change was the Store. How do I "log out"

    I created a new Apple ID for iCloud on my iPhone, but I can't seem to find a way to "sign out" or "log out" of that Apple ID (for iCloud) to sign in with another Apple ID. The only account login I could change was the Store.
    How do I "log out" or "sign out" of iCloud on my iPhone? There is an option to delete the account, but I just want to log off. I want to keep the account name for future use.

    @fernandamagalhaes
    It looks like the article below has the information you are looking for.
    iCloud: Change iCloud feature settings
    http://support.apple.com/kb/PH2613
    Turn off iCloud completely
    Depending on whether you want to stop using iCloud on all or only some devices, do one or more of the following:
    On your iOS device’s Home screen, go to Settings > iCloud, then at the bottom of the screen, tap Delete Account.
    Note:   If you delete your iCloud account, iCloud will no longer back up your iOS data. You can still back up your device in iTunes (for more information, open iTunes and choose iTunes > Help). 
    On your Mac, open iCloud preferences, then click Sign Out.
    If your Mac has OS X v10.7.5 and you turn off iCloud, your calendar information and reminders aren’t stored locally in iCal. If you want to retain your calendar and reminder information, you need to back it up before turning off iCloud. For more information, see the Apple Support article iCloud: Calendar & reminder data removed from Calendar and Reminders or iCal when disabling iCloud Calendar.
    On your Windows computer, open the iCloud Control Panel, then click Sign Out.
    Note:   If you turned on automatic download of music, app, or book purchases (in iTunes preferences or in Settings on your iOS device), your iTunes purchases are still downloaded to your devices.
    Set up iCloud on your devices

  • With journaling, I have found that my computer is saving a large amount of data, logs of all the changes I make to files; how can I clean up these logs?

    With journaling, I have found that my computer is saving a large amount of data, logs of all the changes I make to files; how can I clean up these logs?
    For example, in Notes, I have written three notes; however if I click on 'All On My Mac' on the side bar, I see about 10 different versions of each note I make, it saves a version every time I add or delete a sentence.
    I also noticed, that when I write an email, Mail saves about 10 or more draft versions before the final is sent.
    I understand that all this journaling provides a level of security, and prevents data lost; but I was wondering, is there a function to clean up journal logs once in a while?
    Thanks
    Roz

    Are you using Microsoft word?  Microsoft thinks the users are idiots. They put up a lot of pointless messages that annoy & worry users.  I have seen this message from Microsoft word.  It's annoying.
    As BDaqua points out...
    When you copy information via edit > copy,  command + c, edit > cut, or command +x, you place the information on the clipboard. When you paste information, edit > paste or command + v, you copy information from the clipboard to your data file.
    If you edit > cut or command + x and you do not paste the information and you quite Word, you could be loosing information.  Microsoft is very worried about this. When you quite Word, Microsoft checks if there is information on the clipboard & if so, Microsoft puts out this message.
    You should be saving your work more than once a day. I'd save every 5 minutes.  command + s does a save.
    Robert

  • Table - Issue with Logging Data Changes

    Hi Experts,
    My client's requirement is to log data changes happened in a table which is critical. I've selected 'Log data changes' check box in technical settings of the table. Now, I'm able to see log for all the changes i did after that. But, I'm facing following issues. Kindly help me in fixing the same.
    1. The table is having two fields with same data element. In the change log SCU3, under the field name, field label mentioned in the data element is getting displayed. As, the data element is same for two fields, its difficult to find out which particular field is changed. Is there any way to display table field name instead of field label from data element?
    2. Sometime, even there is change in the data record, I'm able to see a log record in the change log with caption 'Data record unchanged'. What might be the problem and how to resolve?
    Thanks in Advance,
    Siva Sankar.

    Hi Moha Nan,
       You just use ABAP to change the table P? In this way I think it is not change to X table.
    You can upload master data to add navigation,it is a good way to bulid the SID of P table and X
    table .
      Hope it is help to you!

Maybe you are looking for

  • No sound and audio on Satellite A10-S177

    My laptop is a Satellite A10-S177 XP, I happened to delete some programmes from my laptop in order to create space but it so happened that it affected my audio and sound and currently they the sound and audio bit in the control panel say no sound/aud

  • Can't setup PofAnnotationSerializer in pof-config.xml

    Hi, i have class annotated with @Portable and @PortableProperty, and pof-config.xml for setup serializer:       <user-type>          <type-id>1001</type-id>          <class-name>entity.dto.base.EmployeeBaseDTO</class-name>          <serializer>      

  • Quesiton on Report painter

    Hi , I have a requirement to copy a generated report painter program and modify it.. can any on show help in this regard.. Thanks, Krishna

  • Any tips for using the battery ? T500

    Are there any tips to use the battery for a long time ? I've seen the posts somewhere that "conditioning" is not needed for this battery, Li-on based ? Is recharging when the battery is half-charged a bad habit ? Thanks

  • Getting wrong payment method when purchasing apps

    All of a sudden, when trying to purchase apps, it tells me "wrong payment method info dosen't match bank records". I tried three credit cards and it is always the same. I haven't changed anything.