Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





"Remember Me(session)" Several Ways! Which One?


I use to use a login script which would do:

session_set_cookie_params($thirdyDays);
session_start();

I would do this when the login was successful and then, it would remember the session info for 30 days and all i had to do was session_start it.

However, it doesn't always work, almost never works in my localhost, it sometimes works in my web server, I tried commenting the session.life_time or whatever, but that didn't help. And you can't always expect the enviornment you're working in to have it commented etc. Code:




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Ways To Assign A Value To A Session Variable.
I am wandering which way to assign a value to a session variable
exist. Which of the following examples will work.

Example #1:
session_start();
session_register("ex");
$ex = 2.0;
Example #2:
In first.php:
session_start();
session_register("ex");
In second.php:
$ex = 2.0;
Example #3:
In first.php:
session_start();...

View Replies !   View Related
Session Remember Things It Should NOT....
I use sessions to store information in $_SESSION. However, variables that are not in $_SESSION that I define myself is also remember between pages in the same session.

What gives?

Is $error_msg a some kind of global variable?

So, I might have two pages, let say page1.php and page2.php. They both use the variable $error_msg and session_start();

View Replies !   View Related
Creating A "Remember Me" With Session() Based Authentication
I am trying to figure out how to create a "remember me" option so repeat users won't have to repeatedly login to me site. I am using PHP Sessions to handle authentication. I am guessing cookies are the way to go on this, but I could use some tips on how to implement it.

View Replies !   View Related
2 Ways
Having a session variable test. Is there a difference between:

$test = "string";
or
$_session['test'] = "string";

View Replies !   View Related
Best Ways For Mass Mailing
I would like to understand which are the best ways to send bulk
mailings like for newsletters and so on ( not spamming, always to
receivers who opt-in ).

I am not looking for code for now , I have found some very interesting
classes and I also have my own scripts, I just want to know all the
options available and why one is better of another .

So, if have to send just a few copies to, say, less than one hundred
people I can use the mail function, If I have to send , say, 20
thousand emails I will have to hire dedicated mail servers, but what if
I have to deliver a few hundreds emails ?
What is usually the max limit using my shared hosting before moving to
a dedicated mail server ?

What is the best way ? maybe splitting the delivery in batches using
the default mail ( sendmail ) or by SMTP ?

View Replies !   View Related
Gettext Vs Custom Ways
Does anyone here have experience with PHP gettext functions? I'd
like to know how they work better. Also, is gettext more efficient
than serializing the language strings into language files and
unserializing them at each request?

I found this on Google saying that some guy sped up gettext, but I
have no idea how fast it was in the first place:

I was planning to just unserialize the appropriate language file at
each page request and then use the strings kind of like phpBB does
(language strings are assigned to constants and the needed strings are
assigned to the template engine per-page). It seems to me that this
would be easier to deal with than using _() and an English string to
encode every string before sending it to the template engine.

View Replies !   View Related
3 Ways: Reading Files
readfile(), fpassthru(), and file() are the 3 ways to read the WHOLE file. Why so many methods, redundant? I trying to find the advantage.

View Replies !   View Related
More Ways To Define An Variable
I asked this question before but I forgot/ran into some problems. There are more ways to defina an variable:

1. $var = 'value' Notice the '
2. $var = "value"; Notice the "

and what is the third? Something like /"value/" I think.

View Replies !   View Related
Connection Security Both Ways
Supposed a visitor enters a secure (https) area of a site. They submit sensitive data which upon reaching the server is determined to have some problems. If some of that sensitive data is included in the output as values in a form when the page reloads to specify the problem, would the data be transmitted as securely to the visitor as it was to the server from the visitor's browser?

View Replies !   View Related
Ways Of Displaying Text!!
I have a recordset i am displaying on my page such as

this is movie one
this is movie two
this is movie three

but these are to long to display on the page so how do i make it so it displays like this

this is mo...
this is mo...
this is mo...

View Replies !   View Related
Different Ways Of Using The Function Mail()
But I've always seen two different ways of using the function. One of them looks like this: mail()

whereas the other one looks like this: @mail()

Back to my original question; what is the @ sign for, and is it significant?

View Replies !   View Related
Ways To Optimize Html Pages
I know there are ways to optimize html pages with all of the software out there. But does anyone know if they make one that will crunch PHP without changing the code? Everytime I edit php code in my WYSIWYG editor it leaves spaces that aren't needed in the coding.

View Replies !   View Related
XSS: Ways To Disguise JavaScript Tags?
I'm trying to figure out how my users may use (or better misuse) the
input fields of my site to to insert JavaScript. I'm already replacing
all occurencies of "script" in every input field but I wanted to know
if anybody here ever stumbled upon a trick to disguise the <script>
tag?

View Replies !   View Related
Know Any Slick Ways To Build A String From Array?
I have this arr

$months = array("January", "February", "March", "April", "May",
"June", "July", "August", "September", "October", "November",
"December");

and I would like to take this array and build a string of the form

"<option value="1">January</option>
<option
value="2">February</option>
<option value="3">March</option> ...
December</option>"

Does anyone know a slick way to get to the above string from the given
array? I'm using PHP 4.

View Replies !   View Related
Better Ways Compare Strings: Exact Matches
I'm creating a lot of arrays. Some of the arrays carry words
that get duplicated...

For example:
$aCities = {"Durham", "Raleigh", "Raleigh-Durham", "Salem", "Winston", "Winston-Salem" }

I've been using stristr alot but that ends up meaning that I
must take the arrays out of alphabetical order and in the
end it complicates things on my part. I'll comparing it to the
strcmp() function right at the moment but I ran into some
difficulties with strcmp() a couple nights ago, along the lines
of having to convert the strings in the array lower-case (all
my arrays are currently stored in a ucwords() format). The
dashes in the names also present a bit of a problem.

The way I'm currently doing the comparisons...

function GetCity($sSearchThis) {
$aAllCities = GetAllCitiesArray();
// make sure parameter is lowercase
$sSearchMe = strtolower($sSearchThis);
foreach ($aAllCities as $sThisCity) {
if (stristr($sSearchMe, $sThisCity) !== FALSE) {
return($sThisCity);
}
// default to raleigh
return("raleigh");
}

What's the best way to accomplish this or is there a better
way under the following conditions:

(1) The item passed in IS a string (not an array).
(2) A default string is always returned when no match is found.
(3) The alphabetical order of the array must remain alphabetized.
(4) The dashes are not required.

View Replies !   View Related
Alternate Ways To Pass Information To Scripts
This is one for the PHP-ilk that can sneeze better code than most write. Under Apache, and only under Apache, you can use the following snippet of code to get information passed to the script in a way other than get/post/sessions, which is passed directly after the script name but before the querystring, eg:

http://blah.net/index.php/type/value/type/value/?type=value
PHP Code:

View Replies !   View Related
Recommended Ways Of Passing Parameters To A Function
I have a function like this: Code:

function show_categories ($cat_to_show, $number_to_show) {
... function code .....}

I call it in this manner: show_categories (1, 20);

However, sometimes I may want to show all articles from every category, not just one. What would be a good way to handle this?

show_categories (0, 20); // use cat number 0 since we don't have anything with cat 0
show_categories (9999, 20); // use a category number that will definitely not exist
show_categories ('ALL', 20); // use a distinct value

Or is there a better way?

View Replies !   View Related
What Are The Possible Ways To Get Hogh Ranking In Seach Engine ?
In What are the possible ways to get hogh ranking in seach engine ?

I know sone way as follows:

1. Executing .html extension as php file through .htaccess file
2. XML object of javascript etc

View Replies !   View Related
Ways To Tell If Existing Setup Is SAPI Or Shared Object?
What ways are there to tell if PHP is actually built into an Apache 2 installation or if it's installed as a shared object?

I've dropped a file containing phpinfo() on the server I'm looking at, hoping the Server API value would give me a clue, but it just says "Apache 2.0 Filter," and I don't know if Apache filters are required to be one or the other....

View Replies !   View Related
How To Do Remember Me?
How to do "remember me" when user enter username and password.


View Replies !   View Related
What Are Normal Ways To Scale Up PHP's Default Settings For Growing Traffic?
PHP comes with certain defaults, set in php.ini. Among these, scripts
time out after 60 seconds, I think. The default memory limit for a
script is, I believe, 8 megs.

I assume that when people do large-scale sites with PHP they scale
these numbers up. If you have a content management system running every
aspect of a large corporate web site, including a database back end
that employees use for important, secret, protected information, then I
imagine there is quite a lot of processing that might be needed for
every request.

A limit that I run into all the time is the memory limit. If I get a
large amount of info back from the database, and then try to store the
return in an array, it is easy to go over the default 8 meg limit.

View Replies !   View Related
Remember Input Value
I have a form, after users submit it, if they leave the required fields blank, I need to let them go back to the page and fill those fields. How can I remember the values the users already filled so they don't need to fill the same fields again? Is there any other ways to do this except using cookie? Is there any 'forward' or 'redirect' function can do this?

View Replies !   View Related
Remember Me Option
Any ideas on how to create a remember me option in a login box..?

View Replies !   View Related
Trying To Remember A Function's Name
I am drawing a total blank on this... I'm sure that I've seen it in
javascript or PHP... I'm looking for a function that takes a variable
(such as an array) and reduces it to a string which can be
reconstituted. I remember that it does slightly more work than needed
because all the types were specifically indicated even when they were
self evident, but I can't remember the function's name. There is some
unencoding function to go in reverse.

View Replies !   View Related
Option Value Remember
When a user clicks on a car the option box selects what car has been choosed, after filling the form in and if he has forgotten to type some info, the script echos what did he forget, and the prob is, that the option value disappears.
How can i save the value or post it over? Code:

View Replies !   View Related
Remember Selected
How does a script remember selected qty when the user needs to edit an order form.

echo"<select name ='blar'>";
for($num;$num<$num2;$num++)
{
echo"<option value = '$num'";

........................... // here needs to be selected = 'selected' at the correct place??

echo">$num</option>";....

View Replies !   View Related
Remember From One Page To Another
I want to set up form element on one page, like a product, then send the selected info to a second page. How do I set up the php script to remember through that process. Code:

View Replies !   View Related
Remember On Login
my script www.myprofilepic.com runnin dolhpin 5.4 was wondering how i cud add the remember me feature on the login box,so when people close page and open it,they still remain logged in ':thumbsup:'

View Replies !   View Related
Remember A Member
I made a member system it works great but i want to make a posting area for my members. At the mo i just have a simple forum script so am adding it to my member system i have the auth working so it only lets members post.

I just don't know how to allow my members to edit or delete a post. i know how to delete posts and edit them if you know what i mean it's just allowing the person who submits the post to edit or delete it? it would be really great if someone could show me as well as tell me how this could be done.

View Replies !   View Related
Remember Location
What would be the best way to remember a location on a map or something? Think of an RPG. When you come back, your location should be the same as when you logged off.

View Replies !   View Related
Remember User
I have a script where people can vote for a website, but I ony want people to vote once. I was using ip addresses to track that, but I found that ip addresses can change on a computer. Is there a better way to identify a person's computer without using cookies.

View Replies !   View Related
Remember Form Values
I have a form, and I'm using PHP to make sure the users filled in certain fields. If they haven't filled in a field, they are brought back to the form after submitting (using header location) and asked to fill it in. However, when they go back, the form values are all gone.

How can I keep the form values there? I know i've seen it done, but I can't remember where.

View Replies !   View Related
Remember Selected Value DropDown
I am attempting to have a drop down menu that displays url from 1 table called links the same table also contains a name for the url. i.e. google.com = name and http://www.google.com = url The value of just the url from links is stored in a separate table called users in a field named search after form is submitted by user. Everything Posts correctly except when go back to edit the record and submit the form the drop down box does not retain the value of what had been previously selected although it is the correct record until form is updated when whatever value is currently in the drop down list will update the record.

I know the code is doing exactly what it is told to do, because I have no functionality in it to recall the value from the field search in the users table. I don't know if it is something I would have to add to the array or option value. I can get it to work if it is all hard coded, but I am attempting not to do this. I am pretty new to php mysql and any help is greatly appreciated.

This is the code I am working with that came mostly from a tutorial. PHP Code:

View Replies !   View Related
Login Page: Remember ME
This is my 1st posting to this group. Can any1 help me with the
"Remember Me" which is there in a login form. Im pasting the code
below. Im not able to set a cookie..

<?php
// saving script
session_start();
displayLogin();
// connect to the server
$conn= mysql_connect( 'localhost', 'csci242', 'spring2006' )
or die( "Error! Could not connect to database: " . mysql_error()
);

// select the database
mysql_select_db( 'blogtagz' )
or die( "Error! Could not select the database: " . mysql_error()
);
// get the variables from the URL request string

$uname = $_POST['uname'];
$password = base64_encode($_POST['password']);
$reme=$_POST['rememberme'];

/**
* checkLogin - Checks if the user has already previously
* logged in, and a session with the user has already been
* established. Also checks to see if user has been remembered.
* If so, the database is queried to make sure of the user's
* authenticity. Returns true if the user has logged in.
*/

function checkLogin(){
/* Check if user has been remembered */
if(isset($_COOKIE['cookname']) && isset($_COOKIE['cookpass'])){
$_SESSION['uname'] = $_COOKIE['cookname'];
$_SESSION['password'] = $_COOKIE['cookpass'];
}

/* Username and password have been set */
if(isset($_SESSION['uname']) && isset($_SESSION['password'])){
//if(confirmUser($_SESSION['uname'], $_SESSION['password']) == 0){
/* Confirm that username and password are valid */
if(confirmUser($_SESSION['uname'], $_SESSION['password']) != 0){
/* Variables are incorrect, user not logged in */
unset($_SESSION['uname']);
unset($_SESSION['password']);
return false;
}
return true;
}
/* User not logged in */
else{
return false;

}
}

View Replies !   View Related
Remember Drop Down Box Selection
Is there a better way to do it than i currently am using? Simply echos the value in the selected option that will otherwise be blank, so this makes it impossible for the user to select no input. Code:

View Replies !   View Related
Best Way To Remember A Logged In User
What is the best way to use a cookie to remember a logged in user? Would you store the username and password in two separate cookies? Should the password be plain text? Hashed? Not there at all?

View Replies !   View Related
Adding A "Remember
I have a simple login script. I have the pages

login.php
login_response.php
login_success.php
login_failure.php

What I want to do is have a checkbox on the login.php page where if the user checks it and logs in successfully, upon closing the browser and returning to the login.php page, they are automatically redirected to the login_success.php page. What must I do to accomplish this?

View Replies !   View Related
Remember Array Contents
i have the following code, that inserts the ID value of a link into an array, upon the link being clicked. See example link below:

www.somthing.co.uk/functions.php?id=23 (www.somthing.co.uk/functions.php?id=23)

How do I get the array to remember its contents, so if the browsers back button is used, and another link is clicked, this link should append/add it's id to whats already inside the array? Code:

View Replies !   View Related
How Do Shopping Baskets Remember What They Contain?
How do shopping baskets remember what they contain? Do they use arrays?

View Replies !   View Related
Secure Way To 'remember' Users?
So far, for my site, there's an option for users to be 'remembered' when they login, so they don't have to login again on a second visit to the page, etc. You've seen those before, they're on all the big websites..

The first version included storing the user's name and id in a cookie, which was checked for at the top of every page. If the cookie was found, its data was exploded and put into $_SESSION.

This was a really, really bad way to do it (since a user could just edit the cookie on their browser, imagine what'd happen if I'd stored 'access level' with the data), but I was young and stupid at the time. Code:

View Replies !   View Related
Uses Cookies To Remember Who Referrered Them To The Site.
My site uses cookies to remember who referrered them to the site.
The cookie looks like this PHP Code:

View Replies !   View Related
Sessions - Remember A User Is On The Site
I am building a members section for my site and I was curious what the best way to go about remember users would be. The site I'm working on is mainly an information site which will have the ability for people to login and view reviews on products and also allow manufacturers to login and upload information about their products.

I was curious how I should remember a user is on my site. Currently, I have a $_SESSION[''] variable that remembers them but when they open a new browser it forgets them. Also this posses problems if they are still viewing my site but want to have 2 browsers open while on my site.

Is this the best method? Also considering they login - they will have to relogin everytime they come back to my site. This makes me wonder if I should use cookies. I have never used them before. Would they be the best solution? Are they secure?

Any information would be great.

View Replies !   View Related
PEAR::Auth 'REMEMBER ME' Feature
I use PEAR::Auth module to login my users.

I noticed the lack of the 'remember me' feature (and the method
'setExpire' isn't enough).

So I wonder HOW can I extend this package and provide the 'remember me'
feature.

View Replies !   View Related
How To Get Form To Remember Selected Option?
I am now trying to make a form remember which color (a select list) they selected before pressing any of the submit buttons. I entered this code into the form:

<select name="color">
<option value="red">red</option>
<option value="blue">blue</option>
</select>

The submit is a GET type. For example, if the user selects blue and then clicks on either one of the "submit" buttons, I want the form to remember/show the blue option. Right now the select list always goes back to red, the first choice. I tried doing a <?php echo $red; ?> and <?php echo $blue; ?> for the option value, but this does not work since the select list needs a value.

View Replies !   View Related
Remember File Upload Field
Is there any way to ensure that if there is an error in my form, that the file fields will be remembered if they were filled in on submission?

View Replies !   View Related
Remember Visited Links With Cookie
I've got a very simple, flat-file, private forum written in PHP for a dozen or so users. I want to be able to keep track of which messages have been read by each user using a cookie, so that visited links will persist regardless of browser settings. Of course I understand that if the cookie is deleted, that info will be lost. It's a low-usage forum so the total number of messages is low.

View Replies !   View Related
Remember Form Settings W/cookies
I have a sort script that i use to sort the results on a page. And the form sets a cookie and goes from there. It work all great. But the problem that i need to fix is remember the settings in the form.

<form action ="list.php" method = "post">
View by: <select name="view">
<option value="title">Name</option>
<option value="views">Popular</option>
<option value="date">Newest</option>
</select>
&nbsp;Order by:
<select name="order">
<option value="DESC">Descending</option>
<option value="ASC">Ascending</option>
</select><br /><br />
Per page:
<select name="per">
<option value="1">1</option>
<option value="2">2</option>
<option value="5">5</option>
</select>

<input type="submit" name="sort" value="&nbsp;&nbsp;&nbsp;Sort&nbsp;&nbsp;&nbsp;" />
</form>

Now when you submit this form it will set a cookie with your "view", "order", and "per" selection. What i want it to do is after you set that cookie and come back to this form to have them settings remembered in the form. Basicly i guess add the selected="selected" to the option script in the form.

View Replies !   View Related
Remember The Value Of Entry And Store It Into A Varriable
I want to take every entry in a column and see if there is any entry with the same value in that column.If yes I want to  remember the value of that entry and store it into a varriable. Does anyone know how to do that ?

View Replies !   View Related
PHP Login Remember Username And Pass
I currently have a login to my website that works great BUT I would really like to have a cookie remember the username and password so next time the user wants to login they can simply just click login. I do not wish to have the system auto-log them in. If you want to take a look at my current login pages code let me know.

View Replies !   View Related
Option To Remember Username And Password
when a user visits my site i was going to have a check box to save username and password, not sure how to go about this, i can make the check box fine but not sure what i would need exactly on the Code:

View Replies !   View Related
How Does VBulletin Remember The Page For Redirects?
I noticed that if you're not logged in and you try to reply to a thread, you can log in and it takes you right to the reply. It looks like the login form save the referring page, but how does it doe this? Does it rely fully on HTTP_REFERER or is there a backup plan if this doesn't work?

View Replies !   View Related
Looped Rows In Table Add & Remember Values
I'm trying to get this app to work. It's supossed to:

1. create rows dynamically through a loop (done)
2. remember the user-entered-values while the form posts to itself
3. provide a total (addition) of all 4 rows. (kinda tricky since the rows are looped).
PHP Code:

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved