|
Hi,
I have two different headers. I want header2 to replace header1 when the users scrolls the page.
this is header1:
<header>
<a href="home"><img id="logo" src="<?php echo $_SESSION["blended_learning_domain_name"]; ?>images/logo.png" /></a>
<nav id="navMenu" role="navigation">
<ul>
<li><a href="home" <?php if (basename($_SERVER['PHP_SELF']) == 'home.php') { ?>class="current_page_item"<?php } ?> accesskey="1" title="">Home Page</a></li>
<?php if ($_SESSION["blended_learning_user_id"]) { ?><li><a href="mypage" <?php if (basename($_SERVER['PHP_SELF']) == 'mypage.php') { ?>class="current_page_item"<?php } ?> accesskey="2" title="">My Page</a></li><?php } ?>
<li><a <?php if (basename($_SERVER['PHP_SELF']) == 'browse.php') { ?>class="current_page_item"<?php } ?> href="browse" accesskey="3" title="">Browse</a></li>
<?php if (!$_SESSION["blended_learning_user_id"]) { ?><li><a href="signin" <?php if (basename($_SERVER['PHP_SELF']) == 'signin.php') { ?>class="current_page_item"<?php } ?> accesskey="4" title="">Students</a></li><?php } ?>
<?php if (!$_SESSION["blended_learning_user_id"]) { ?><li><a href="adminsignin" <?php if (basename($_SERVER['PHP_SELF']) == 'admin_signin.php') { ?>class="current_page_item"<?php } ?> accesskey="5" title="">Admin</a></li><?php } ?>
<li><a href="contact" <?php if (basename($_SERVER['PHP_SELF']) == 'contact.php') { ?>class="current_page_item"<?php } ?> accesskey="6" title="">Contact Us</a></li>
<?php if ($_SESSION["blended_learning_user_id"]) { ?><li><a href="out" accesskey="7" title="" style="color: white; background-color: red;">Sign Out</a></li><?php } ?>
</ul>
</nav>
</header>
and this is header2:
<header>
<a href="home"><img id="logo" src="<?php echo $_SESSION["blended_learning_domain_name"]; ?>images/smalllogo.png" /></a>
<nav id="navMenu" role="navigation">
<ul>
<li><a href="home" <?php if (basename($_SERVER['PHP_SELF']) == 'home.php') { ?>class="current_page_item"<?php } ?> accesskey="1" title="">Home Page</a></li>
<?php if ($_SESSION["blended_learning_user_id"]) { ?><li><a href="out" accesskey="7" title="" style="color: white; background-color: red;">Sign Out</a></li><?php } ?>
</ul>
</nav>
</header>
how can I do this please?
Technology News @ www.JassimRahma.com
|
|
|
|
|
|
Hi Jassim,
Could you try using jquery or javascript.
function checkUrl()
{
var text = $("textarea").val();
bool isUrlPresent = isUrlPresent(text);
if(isUrlPresent)
{
// Do something
}
}
function isUrlPresent(url)
{
if(new RegExp("[a-zA-Z\d]+://(\w+:\w+@)?([a-zA-Z\d.-]+\.[A-Za-z]{2,4})(:\d+)?(/.*)?").test(url)) {
return false;
}
else
{
return true;
}
}
Also please check this link :
https://github.com/stephan-fischer/jQuery-LiveUrl/[^]
|
|
|
|
|
Hi,
I have articles web project. I want to calculate the views of every article, just like the views of post in forums.
I created a table article_views with article_id, view_date, view_ip so everytime the page will load it will add a record
but that is a problem because anyone can refresh the page to increase the views!
what's the proper way to do it please?
Thanks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
Hi
Try to validate using viewstate.
When the page loads, increase the view count by comparing the viewstate object to null. Then take an object in viewstate. Second time when the user refreshes the page, viewstate object exists and skip the count increment.
Please give a try and let me know how this worked.
Thanks
Naina
Naina
|
|
|
|
|
Which programming language, you are using?
In PHP use sessions to prevent data refresh after page load.
|
|
|
|
|
Hi,
Anyone worked on the above?
I would like to ask, while every airline and hotelis using a different system? how they are ll connected so that I can find them all on expedia or booking.com for example?
what method they use?
Thanks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
|
|
It's not quite that simple. The href="" link is usually only followed when the user clicks on it, and always uses the GET method, not POST.
You might also need to include any cookies that were received with the page when you make your request.
|
|
|
|
|
In effect the cookie problem is something I had completely neglected : to include this I guess I should load the "Referer"page first, extract the cookies associated with it and include them in the following GET that simulates the "href" anchor... am I right ?
|
|
|
|
|
Whether you should include a cookie or not depends on the domain and path specified in the cookie, the domain and path of the new page you are loading, the cookie lifetime, etc. Here's a link to RFC 6265[^] where you can read all about them.
I don't know how you are dealing with the contents of the href="" attribute, but you will have to cope with absolute links, relative links, <base href="..."> affecting the link location, and also deal with possible non-http links ("javascript:" and "mailto:" are two examples off the top of my head).
|
|
|
|
|
well I am quite confident that the href attribute of the anchor is always an absolute link.
Anyway I included the cookies and this time it seems I made a small step forward , at least now I'm not getting the http 500 error anymore, and I can get a response too (well it's a null string , but this is a detail .. ))....).
What puzzles me is that if I use the raw href url in a web browser call, for instance using IE, I get the requested page without any error... it doesn't seem to expect any cookies form a previous response .... But I am deeply ignorant as far as the web is concerned , I'm sure there's an answer to this.
What's important for now is that at least I can get past the WebResponse ....
Thanks for the support.
|
|
|
|
|
So, I have forms authentication setup with Web.config, an asp.net logincontrol, custom membershipprovider, custom roleprovider. Login custom, I used the templates of the logincontrol, but doubt that is the issue.
So here is what happens:
1. I surf to page where I need authorized access. I get redirected to login page, including the redirecturl in the querystring of the login address. So far so good.
2. I log in, my custom membership provider does the ValidateUser perfectly. So far so good.
3. Nothing happens after that. No exception, just nothing. Not so good.
Please help.
Below is relevant part in my Web.config:
<authentication mode="Forms">
<forms loginUrl="https://localhost:44301/login/Login.aspx" protection="All" timeout="30" name=".ASPXAUTH" path="/" requireSSL="true"
slidingExpiration="true" defaultUrl="Default.aspx" cookieless="UseDeviceProfile" enableCrossAppRedirects="false"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
<roleManager enabled="true" defaultProvider="KeetingRoleProvider">
<providers>
<clear/>
<add name="KeetingRoleProvider" type="Web.KeetingRoleProvider"/>
</providers>
</roleManager>
<membership defaultProvider="KeetingMembershipProvider">
<providers>
<clear/>
<add name="KeetingMemberShipProvider" type="Web.KeetingMembershipProvider"/>
</providers>
</membership>
|
|
|
|
|
You have to use FormsAuthentication.RedirectFromLoginPage method upon successful authentication for that...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
and where do I do this?
Thanks for taking your time to answer my silly(but necesarry) question.
|
|
|
|
|
On the login button click handler...
protected void LoginButton_Click ( object sender, EventArgs e ) {
bool bValid = AuthenticateLoginIdentity( );
if( bValid ) {
FormsAuthentication.RedirectFromLoginPage( );
}
}
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Hi, I have a small table generated by a detailsview I would like to format:
there has to be a small white area between the cells in the table. I've tried a dozen things but no matter what I do,
I can't change the size or the color of the borders. They always stay at default border size and in black color.
I have pasted my code below. Please help.
<style>
#content_DetailsView{
position:absolute;
left:360px;
top:155px;
border-collapse:collapse;
margin-top:20px;
border-spacing:100px;
border-color:white;
border-style:solid;
border-width:50px;
}
content_GridView
{
margin-top:20px;
}
.gridviewheader th{background-color:blue;}
.gridviewheader th a{color:white;}
.gridviewrow{background-color:lightgray;}
.gridviewaltrow{background-color:darkgray;}
.gridviewselrow{background-color:blue;}
.detailsviewrow{background-color:grey;border-collapse:separate}
.detailsviewrow td{padding:0px;}
.gridviewpagerrow{background-color:blue;}
.gridviewpagerrow a{color:white;}
</style>
<table border="1" cellspacing="20" style="border-color:White;height:50px;width:125px;" id="content_DetailsView" rules="all">
<tbody><tr class="detailsviewrow">
<td>name</td><td>Alexandro Alexis</td>
</tr><tr class="detailsviewrow">
<td>address</td><td>3711 W Franklin</td>
</tr><tr class="detailsviewrow">
<td>email</td><td>alal@mma.yaleindustries.com</td>
</tr><tr class="detailsviewrow">
<td>phone</td><td>(559) 555-2993</td>
</tr><tr class="detailsviewrow">
<td>zipcode</td><td>93706</td>
</tr><tr class="detailsviewrow">
<td>city</td><td>Fresno</td>
</tr><tr class="detailsviewrow">
<td>customerid</td><td>1019</td>
</tr><tr class="detailsviewrow">
<td>statecode</td><td>
<span id="content_DetailsView_Label1">CA</span>
</td>
</tr><tr class="detailsviewrow">
<td colspan="2"><input type="button" onclick="javascript:__doPostBack('ctl00$content$DetailsView','Edit$0')" value="Bewerken"> <input type="button" onclick="javascript:__doPostBack('ctl00$content$DetailsView','Delete$0')" value="Verwijderen"> <input type="button" onclick="javascript:__doPostBack('ctl00$content$DetailsView','New$0')" value="Nieuw"></td>
</tr>
</tbody></table>
|
|
|
|
|
Nico Haegens wrote: #content_DetailsView{
border-collapse:collapse;
}
That's the line that's causing the problem. Change it to border-collapse:separate; , and your borders should appear.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
That fixed halve the problem: there is indeed white space between the cells now, but the borders are still black, can you help me make them white? Already set border-color to white but that didn't help at all.
|
|
|
|
|
Try:
.detailsviewrow td{ padding:0px; border-color:white; }
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks so much, that did the trick! Much appreciated for quick responses.
|
|
|
|
|
Hi,
can you please check this webpage:
http://www.drmariagloria.com/[^]
if you resize the browser to smaller size then the hear will look like a half screen with the lighcyan color where it should be full width?
where is my mistake?
Thanks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
You have to show us the css code for anyone to troubleshoot for you. I looked at source and there is 3 css files that may be affecting the way the elements are acting. If you use your browser's console you may be able to highlight an element that is acting up and see how it changes when resized. Try that.
vbmike
|
|
|
|
|
I am down to the last major task of my project and it is giving me griefs.
This block of code below allows me to load jquery datatable with data from a php file called getUsers.php filtered by userID.
$(document).ready(function() {
$("#example").dataTable( {
"sProcessing" : true,
"sDom":'T<"clear">',
"sJQueryUI": true,
"sPaginationType": "full_numbers",
"sDom": 'T<"clear"><"fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lfr>t<"fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ip>',
"sAjaxSource" : "getUsers.php?loginName=<?php echo $user; ?>",
"sAjaxDataProp" : "",
"sDestroy" : false,
"sScrollXInner": "110%",
"fnServerData" : function(sSource, aoData, fnCallback) {
request = $.ajax({
"dataType" : "json",
"type" : "GET",
"url" : sSource,
"data" : aoData,
"success" : fnCallback
});
},
"aoColumns" : [
{ "mDataProp": "RequestID", "sWidth": "50px", sSortable: true,
"bSearchable": false,
"bSortable": false,
"fnRender": function (oObj)
{
return "<a target='tab' data-tab-name='#RequestDetails' data-tab-index='2' href='phpservices/details.php?requestID="
+ oObj.aData["RequestID"] + "'> " + oObj.aData["RequestID"] + " </a>";
}
},
],
})
Further down the code above is this line which adds hyperlink to the fieldname called RequestID:
questID"] + " ";
return "<a target='tab' data-tab-name='#RequestDetails' data-tab-index='2' href='phpservices/details.php?requestID="
+ oObj.aData["RequestID"] + "'> " + oObj.aData["RequestID"] + " </a>";
Finally, the code below allows us to display the details of user's selection in another tab:
$("#example").on("click", "a[target='tab']", function(){
var me = $(this);
var url = me.attr("href");
var tabName = me.data("tabName");
var tabIndex = parseInt(me.data("tabIndex"), 10);
$.get(url, function(data) {
var table = $( '<table cellpadding="4" cellspacing="0" border="1"/>' ),
tr = $( '<tr/>' ),
td = $( '<td/>' ),
th = $( '<th/>' );
tr.clone().html( th.text( 'ID' ) )
.append(th.clone().text( 'Date' ) )
.append(th.clone().text( 'Status' ) )
.append(th.clone().text( 'Assigned To' ) )
.appendTo(table );
$.each(data.aaData, function(i,v) {
tr.clone().html( td.clone().html(v[0]))
.append(td.clone().html(v[1]))
.append(td.clone().html(v[2]))
.append(td.clone().html(v[3]))
.appendTo(table);
});
$(tabName).html(table);
$("#tabs").tabs("option", "active", tabIndex);
}, 'json');
return false;
});
All of these work fine except one major problem.
When you click the requestID link, the hope is that the contents of details.php is displayed in requestdetails tab but it doesn't. It displays blank screen.
Does anyone know how to extract the contents of details.php file into a variable called aaData?
I will to be able to reference it and use it to load data into that other tab using:
$.each(data.aaData, function(i,v) {
...
...
Sorry if this is confusing, I can provide some clarity.
I am really desparate.
Thanks a lot in advance
|
|
|
|