Refresh the whole page in one case in SPRY

I have created login page in php, Using spry i posted the
form in same page,getting response in div section i.e. <div
id="response_form1" align="center"></div>
when i supply wrong password the form submitted and error
message appeared in <div id="response_form1"
align="center"></div>.
Now my question is that how can i achieve the whole page to
be refreshed when i successfully authenticated.
In other words
i want the whole page to be changed in one case (redirect the
whole page).
and in other case response will be getting in DIV (Not whole
page will be updated/posted).
code of Login_ajax.php file is given below .
login_form.php
<?
if(count($_POST)>0){
$usrname=$_REQUEST['usrname'];
$pass=$_REQUEST['pass'];
$cmdlogin=$_REQUEST['cmdlogin'];
//echo $usrname."<br>".$pass;
if (file_exists('adm.os')) {
$lines = file('adm.os');
for($i=0;$i<count($lines);$i++){
$auth=explode('||',$lines[$i]);
$key=array_search($usrname,$auth);
if(!is_int($key)){
$msg = "<b>Error : <font color=Red>Username /
Password not exists or correct ...</font></b>";
}else if($auth[0]==$usrname &&
$auth[1]==md5($pass)){
header("Location: new.php");
}else{
$msg = "<b>Error : <font color=Red>Username /
Password not exists or correct ...</font></b>";
} else {
$msg = "<b>Error : <font color=red>The file
$filename does not exist</font></b>";
echo $msg;
}else{
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Untitled Document</title>
<link href="css/samples.css" rel="stylesheet"
type="text/css" />
<style type="text/css">
.product {
cursor: pointer;
.hover {
background-color: #FFFFCC !important;
.selected {
background-color: #CCCCCC;
.style6 {font-size: 14px}
.style7 {font-size: 12px}
</style>
<script src="js/xpath.js"
type="text/javascript"></script>
<script src="js/SpryData.js"
type="text/javascript"></script>
<script src="js/SpryUtils.js"
type="text/javascript"></script>
<script type="text/javascript">
<!--
// Callback function that will update the response_form1 div
with the response that comes from the server
function updateResponseDiv(req)
Spry.Utils.setInnerHTML('response_form1',
req.xhRequest.responseText);
//-->
</script></head>
<body>
<table width="100%" height="100%" border="0"
align="center" cellpadding="0" cellspacing="0">
<tr><td>
<form name="form1" method="post" action="login_ajax.php"
onSubmit="return Spry.Utils.submitForm(this,
updateResponseDiv)">
<table width="30%" border="0" align="center"
cellpadding="0" cellspacing="0">
<tr>
<td height="25" colspan="2"> </td>
</tr>
<tr>
<td height="25" colspan="2"><span class="style5
style6"><strong>Administrator
Login</strong></span></td>
</tr>
<tr>
<td width="40%" height="25"><div align="right"
class="style5 style7"><strong>Username
:</strong></div></td>
<td width="60%" height="25"><input type="text"
name="usrname" id="usrname"></td>
</tr>
<tr>
<td height="25"><div align="right" class="style5
style7"><strong>Passwd
:</strong></div></td>
<td height="25"><input type="password" name="pass"
id="pass"></td>
</tr>
<tr>
<td height="25" colspan="2"><label
for="cmdlogin"></label>
<div align="center">
<input type="submit" name="cmdlogin" id="cmdlogin"
value="Login">
</div></td>
</tr>
</table>
</form>
<div id="response_form1" align="center"></div>
</td></tr>
</table>
</body>
</html>
<?}?>
end login_ajax.php
--------------------------------------------------------------

quote:
Originally posted by:
NAVISD
One embiguity i have your alteration to code makes sense but
can you please clear me how PHP header("Location : new.php"); &
$msg=true; communicate to javascript response function you have
mentioned?
Good point. It actually doesnt .. thats why it wouldnt work.
I mixed the wrong functions with each other.
Lemme think of someting..
Found something, lemme edit
First, U need to update your setInnerHTML function of
SpryData with this:
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&catid=602&threadid =1306334&enterthread=y
So just copy paste it over the old innerHTML function
This function allows u to fireup javascripts true
setInnerHTML..
Than change this php code to:
}else if($auth[0]==$usrname && $auth[1]==md5($pass)){
header("Location: new.php");
}else{
TO:
}else if($auth[0]==$usrname && $auth[1]==md5($pass)){
$msg = "<script language="javascript"
type="text/javascript">window.location="new.php";</script>";
}else{
What this basicly will do.. Is add the script inside the div.
and executes it.. Seems a wierd work a round but it could work
^_^

Similar Messages

  • Dashboard prompt Refreshes the whole page

    Hello Experts
    When i change a dashboar prompt on the dashboard, it refreshes the whole page instead of that one report where the dashboard prompt applies. How can i limit to just refresh or update only the reports it is suppose to instead of all the reports on the dashboard page. Please advise.
    Thanks
    Ravi

    I agree to what you are saying, in my case if i have 3 reports on the dashboard page only report is is prompted the other two reports are not, still those reports gets refreshed which means i get processing rotating clock on all the 3 reports even though the 2 reports dont change with the prompt selection and then all the report appears. It is just annoying for the users, so i just want that one report to update or refrsh and the other reports should stay still. Hope i am little clear this time.
    Thanks
    R

  • My new ipodtouch 4.3.2 does not show the complete symbol bar at top and bottom,the whole page is shifted to one side -edges of keyboard missing so I cannot type .gadget is 1 mo old, fine till now...

    hi- my new ipodtouch -screen is hiding part of each page-so it is hard to type,as the outermost symbols of the keyboard are missing.RESTORE and RESET have not helped.what trick can I use to bring the WHOLE page into view?Zooming in-out does not help--the edge of each page is out of view...
    Any helpful advice/thanks..

    I sounds like you may have turn on the Zoom setting for accessibility.  Tap the screen with three fingers and it should go to normal.  Then go to Settings>General>Accessibility and turn Zoom off.  You can also turn it of by connecting it to your computer and going to the Summary Pane and go to Universal Access and turn Zoom off.

  • ADF button submits the whole page even on partial submit=true

    my jdev version 11.1.1.5.0
    I hav a jspx page with two input boxes and three select one choice and a clear button
    on clicking the clear button it subimts the whole page and fetches value for select one choice mapped to manage bean everytime even on putting partial subimt=true

    Two years ago I was confused by the same behavior, so I researched the problem to come eventually to the conclusion that everything had been fine and in accordance to the documentation.
    In brief, it is correct behavior a button to submit the whole page even if the button is configured as partialSubmit="true". Please, refer to these articles in the documentation for clarification:
    Using the JSF Lifecycle with ADF Faces - 11g Release 1 (11.1.1.7.0) ("4.3 Using the Opimized Lifecycle")
    Handling Events - 11g Release 1 (11.1.1.7.0) (See topic "5.1.1 Events and PPR" only)
    It is seen from the second article that command components (e.g. a command button, event type "action") are not event roots, which means that the whole enclosing page "boundary" is submitted. If the button is a part of a subform (<af:subform>), a region, a popup or a PanelCollection, then the boundary is the corresponding subform, region, popup or PanelCollection, so only this part of the page is submitted and processed by the optimized lifecycle. However, if the button is not part of such component, then the whole page is submitted and processed by the lifecycle (even if the button is configured as partialSubmit="true"), but only the partial targets of the button will be refreshed on the screen (if the button is configured as partialSubmit="true").
    If you want your button to submit only a part of the page, then the easiest correct way to do that is to surround that part with <af:subform>.
    Dimitar
    P.S. Input and selection components have different PPR behavior from command components. It is seen from the second article above that all the input and selection components are event roots (in contrast to command components!) (see event type "valueChange"), so if some input or selection component is configured as autoSubmit="true", it will not submit the whole page but only itself and the components configured as partial targets of it.

  • How to display the search result without reloading the whole page

    HI,
    I have separate fragments for Search Box to enter keyword and Search Result to display the result. Also I have different sections within the page to put these fragments. So how could I display the results without reloading the whole page.
    Also if I have next button in my search result area, how could I display the search results in next page without reloading all other sections present in our page. Please let me know if any service or idoc function present such that result could be shown in search result section without reloading whole page.
    Please let me know how to restrict page reload for every action within a page.
    Thanks,
    Ramesh
    Edited by: Ramesh_Est on May 27, 2010 3:14 AM
    Edited by: Ramesh_Est on May 27, 2010 8:39 PM

    This is default behaviour of the template of your space. You can create a new page template and than you can create a region for the search results.
    Or you can create a custom taskflow were you use the webcenter taskflows to search for the space.
    Take a look at this white paper:
    Extending webcenter spaces: http://www.oracle.com/technology/products/webcenter/pdf/owcs_r11_extend_spaces_wp.pdf
    and this one:
    Customizing site templates: http://www.oracle.com/technology/products/webcenter/pdf/owcs_ps1_site_template_wp.pdf
    Edited by: Yannick.O on 13-Apr-2010 02:32

  • Rollup object is small square in the page center but react to the whole page colour

    Can you explain this Muse site of the day: rollup object is in the page center but react to the whole page colour?
    http://www.ekswhyzed.com/portal.html
    Thanks!
    Dainis

    I always use root -> panelGroup -> table
    seems to work fine. at least at the point of scrollbars. Aren't browser scrollbars ones you are talking about?

  • How do I load an image w/o loading the whole page?

    On my site I have tons of images (I'm an artist) and in the gallery where my images are viewed, "pastels", I have layed out 9 blocks/squares of images and when one of the blocks is clicked upon, I'd like the image to change in the view, but not reload the whole page. Am wondering how in iWeb it can be done to have just the newly selected image change out instead of the whole page load up. Does this make any sense?
    Help and your comments are encouraged here on how to make it more user friendly.
    http://web.mac.com/makinart

    So, let me understand what you're saying here....
    Textwrangler is a program I can download (free, I see) and it can process a multitude of pages. Once I get the JavaScript (the HTML code that enables the image to change out), (still have to find that one on the net), then I can take the JavaScript, enter it by using Textwrangler into my html coding. How will I know where the JavaScript is to be placed in the html with all that coding, how is a newbie to figure this out? Is the html code for my iweb site located in my "published folder"? Afterwards, I would best save the whole iweb site as a folder, then upload it to .mac as a file? Any changes I make on Iweb and republish will be lost? Yikes! There's something to tell the iweb programmers!
    I can tell you this, that it may be well over my head!

  • Is it possible to copy one whole page from one photo-book to another?

    I often want to re-use the same page that I have made in one photo-book, in a new photobook, but I cannot find out of how to copy the whole page. Is it possible?

    No, you can't.  Send a feature request to Apple via http://www.apple.com/feedback/iphoto.html.
    OT

  • A fu the whole page without the need to drag higeach tune ?

    To drag a full page if itunes to a playlist is it possible to highlight the whole page without the need to highlight and drag each tune by usinf Ctrl?

    CTRL+A, or Edit > Select All. 
    Either one will highlight everything in the current view, after which you can drag them all at once.

  • Printing problem when adding a button to print the whole page

    Hello,
    I added a button with printing option = Apply to self, Print = page.
    The result is that it prints only the i-view in which the button is located. I want the whole page to be printed. The page is composed of several i-views and I also use layers.
    Has someone an idea ?
    Thanks a lot,
    Thomas

    Hi Thomas,
    I received exact the same problem case during our visual composer developments. On SPS 14 the print functionality worked as expected with the print option u201Cprint pageu201D. After the implementation of SPS 16 we had to use u201Cprint screenu201D.
    Hopes this helps.
    Best regards
    RB

  • How to keep the whole page open during browsing

    I am trying to work out how to keep the whole page open in Safari i.e. the top most line with the Apple logo, file, edit, view etc. whilst browsing.  What is the setting to achieve this ?  Since installing Yosemite my MBP 2011 with SSD is behaving oddly at times. Where is the "back" when in Support Communities or is going into the history tab the only way ?
    thanks

    When in the ASC pages, my method involves opening separate windows.
    So I can go back to the reference page from where I first visited a thread.
    Also, pages open faster at times into a new window instead of a tab. As
    my setup has a bit more display than necessary, a few extra windows are
    easier than a bunch of tabs in one frame that have no point of reference.
    Plus, if I wish to copy/paste or drag into another window, or access extra
    content for the sake of reference, I have that; & may use another browser.
    For some content, different browsers may be a preference. I'm used to more
    than two, and one of three becomes more dedicated to things like web mail.
    There may be some options in launchpad items, such as they are.
    Mission Control can access other hidden windows. There's a short
    cut for Full Screen that when used again, reverts to previous size.
    Not sure if this gets near your question, but thought I'd put it out here anyway.
    edited

  • My Firefox page does not look like yours...I do not hava a fox in the corner to click on,,,,the whole page looks different why?

    I am trying to delete history and it says that I should click on the fox in the upper left corner? I have no fox and also, the whole page seems different than the one you show...why?

    WinXP versions of Firefox don't have the Firefox button like with Windows Vista and WIn7, because with XP the default is to show the Menu Bar. The Firefox button appears when the Menu Bar is not being shown.
    Right-click a blank spot on the Menu Bar ''(to the right of Help)'', and de-select Menu Bar by clicking on that contextual menu item.

  • Why is it when i pull up firefox, the whole page shifts to the right. i don't have this problem with internet explorer. please help

    When I pull up firefox, the whole page shifts to the right of the screen and i lose about 40% of the page. This is very difficult when looking on Facebook or Yahoo for my mail. This does not happen when I pull up Internet Explorer. What Gives, please help

    Unfortunately if you have downloaded Babylon toolbar this is probably the culprit. to fix this right click on the menu toolbar the the one with the file menu on it and un-check Babylon toolbar. This should fix the problem.

  • When I AirPrint it only does small portions of the page. How do I get it to print the whole page?

    When I AirPrint The printer only prints a portion of the page.  How do I get it to print the whole page.

    It would help if you stated what printer you are using and what application you are doing the printing from. Also, what are you printing?

  • Not printing the whole page

    the printer is not printing the whole page it is cutting the right side
    hp photosmart 7520

    My HP Photosmart model 5520 is only printing part of a page.

Maybe you are looking for