priti
-
Posts
461 -
Joined
-
Last visited
Posts posted by priti
-
-
Hi,
Check the associative array.
echo '<pre>';
print_r($_SESSION);
and correct the order either print your session array so one can suggest you the correct way to do the same.
Thanks
-
Hi Steve,
<code>
$total_results = @mysql_result(mysql_query("SELECT COUNT(*) as Num FROM uploads WHERE album_id = '".$_GET['galleryID']."'"),0);
</code>
It will result suppse 50 records
<code>if($total_results > $max_results)</code> will always return 9
hence the if condition will always be true. you need to keep LIMIT in your query to fetch the current total records.
<code>
$total_results = @mysql_result(mysql_query("SELECT COUNT(*) as Num FROM uploads WHERE album_id = '".$_GET['galleryID']."'") LIMIT $start_limit,$max_results,0);
on every page $start_limit will update.
Regards
</code>
-
Hi,
avatar uploading is something like uploading an image and then creating a thumnail of it.If you search for script to create thumnail on fly you will get lot of free scripts on net.
;-)
Regards
-
One minor change, replace match with one space instead of nothing
Its also worth noting that technically this replace carriage returns as well. This will make everything appear on one line. Is this what you are wanting or is it simply just space characters that need replacing?
preg_replace("\s+", " ", $text);
Damien
thanks damien for correcting me
-
this can be helpful
preg_replace("\s+", "", $text);
-
hi,
I have not correctly understands you but i think you can try something like
$message=trim($_POST['message']);
it will chop off the extra spaces...
<tr><td colspan="2"><textarea cols="40" rows="6" name="message"><?php echo $message; ?>
</textarea></td></tr>
kindly revert back with steps what is happening exactly so one can help you in solving it.....
-
hi taneya,
well creating a url is not a tuff job once you are ready with your id from the database but it depends how you are expecting them to create.
suppose
you are turn with id 1,2,3,4,7,10
If they all belong to same page them its simple
$i=0;
foreach($id_arr as $id)
{
$url_arr[$i]='path/to/page/category/product/id='.$id;
$i++;
}
so $url_arr is a url array which you can use.
but if these id belongs to different pages then the static part for the url has to be defined based on some criteria like categories etc....
so kindly share how you are thinking about it.
Regards
-
trim() to chop off the extra spaces in left and right of the row
and if the spaces are part of row data then you can ue a regular expression to formalize your row data.
Regards
-
hi,
select p.itemnumber,p.name,p.description,pr.prices,pr.caseweight,pr.caseqty
from products p,prices pr
where p.itemnumber=pr.itemnumber
will help.
Regards
-
you an take help from this url......
http://www.askapache.com/htaccess/sending-post-form-data-with-php-curl.html
-
my guess would be
if($count==1){
// Register $myusername, $mypassword and redirect to file "rms.php"
$_SESSION['username']=$username;
NOTE HERE YOU ARE POPULATING THE USERNAME IN SESSION ON CONDITION OF COUNT ONE AND ONCE THE SESSION GOT FILLED YOU ARE NOT RESETTING TO SOMETHING I MEAN UNSET IT .... SO NEXT CHANCE WHEN YOU WILL REFRESH IT WILL DO JUSTICE TO THE CODE.
(uppercase is simply used to show my response in your code)
$_SESSION['userpassword']=$userpassword;
header("location:rms.php");
}
Regards
-
you again got this
<td><input type="submit" value="Register!"></td>
in your code
:-)
-
yes then instead $_POST['username'] check $_POST['loginname'] and the redirection is happening because of header() function.
-
SELECT ClientID, FirstName, LastName, CompanyName, HomePhone, WorkPhone
FROM byrnjobdb.clients
WHERE LastName=$lastname
Kindly run this in your query interface i think you have error somewhere here.
special in "FROM byrnjobdb.clients" i.e if you are keeping table aliases then byrnjobdb as clients i.e tablename as alias
hope it help to solve your query.
Gr8 day!!!
-
Can anyone give me AJAX/php code sample of validating email address , checking username exists , on client side onchange event validation .
Kindly search on google you will get the script for them .
-
Hi,
login functionality is kept for security purpose on site so that only valid user get entry in the system.So when your system sees that they don't have matching username and password combination it means either he is new user or someone is trying to get entry without credentials to your site.
Now technically on your first page
what is happening is you are given a form to enter the login info then your hit submit and then this is been POST to other page.
on second page validations are been done.
1.If some one has not given any username you don't need to check wether this user belongs to your site right ????
so if username is empty it is been redirected to your first page forcing user to give his/her correct username nad password.
$_SESSION['invalid']='invalid';
invalid is a flag to identify the invalid session.
session keeps the variable live in one to other page .Kindly reset on first page once you show the message to user
i.e
if (isset($_SESSION['invalid'])) {
Print '<br><h2>The username or password you entered was incorrect<br>Please try again<br><br></h2>';
$_SESSION['invalid']=''; }
else it will keep on showing you this message :-)
hope this much understanding will give you insight of what is going on in your code.
Have a gr8 day.
-
you can always store session data in database i mean in PHP you can handle session in db also. hope i am getting you right.
-
kindly change this line and your piece of code should work
<td><input type="submit" value="Register!"></td>
to
<td><input type="submit" value="Register!" name="submit"></td>
your if condition is not getting executed .
Hope it works!!
-
yes you can,define the general function only once and you can have two different vars.
i.e
xmlhttp=ajaxFunction();
xmlrequest=ajaxFunction();
because ajaxFunction() is responsible for creating the xmlhttprequest object then how you deal will depends on you.
Regards
-
hi,
Lot of mistakes in the code.....
var xmlHttp; ................define this above everything i.e in global space of your javascript
the do
xmlHttp=ajax();
xmlHttp.open("POST","index.php","true");
xmlHttp.send(null);
when you do POST xmlHttp.send(null); is wrong you have to send the parameters too.
i.e
parameter="name=priti";
xmlHttp.send(parameter);
now when you have a form i.e form in javascript run the loop to all form element and create a parameter string and pass in send() function.
Regards
-
you can track whether your POST request parameters are forming correctly or not .Please use firebug extension of firefox to track the request.It will be more helpful to you .
-
i hope you are aware of mysql function availabel in PHP.....
$dbconnect=mysql_connect(username,password,host);
mysql_select_db("database name");
...
then use mysql_query() to execute the query and use mysql_fetch_row or mysql_fetch_array() to get the result in the php variables. regarding md5,md5 is one way encryption method. Hence you need to do md5("text value from form"); has to be used in your query
something like
select email from user_table where username=$_SESSION['username'] and password=md5($_POST['password']);
-
which part of code you write above it work???
-
hi
http.abort();
is aborting your request and what you are facing is the problem faced by many.I always prefer to make only one ajax request and then send it over the server and get the response in mean time you can show the waiting faiure too.If there is possibility of network cogestion then the validation will behvae very differently.
so once user fills up the form create a signle ajax request and populate your error_string and show accordingly.
[SOLVED] Getting the letters of disk drives using PHP?
in PHP Coding Help
Posted
you can make use of following trick
foreach ( range( 'a', 'z' ) as $drive ) {
if ( file_exists( $drive . ':\\')) {
echo $drive . ': \ exists';
}
}