Brian W
-
Posts
867 -
Joined
-
Last visited
Posts posted by Brian W
-
-
I you want to make sure the email address actually even looks like an email address, Try this tutorial, its came in very handy to me when writing regex. Check the Matching Patterns section for the email validation code.
If you want to validate their email address, once they enter the address you'd create a random string
(something like md5(rand()."salt string")) and save the string, and there email address in a table with 2 other fields, a unique id and a field determining whether or not the email has been validated. Use the random string in a url like www.domain.com/validate.php?key=flhdi7fgi3hkjnfp92u2hl9f3 and email that to them... they click on the link and when they get there the table is updated to say that that email address has been validated.
-
Possibly there is a better way, but you could use
$block = wordwrap($string, 500);//500 characters long $array = explode("\n", $block);//break up the block on newlines
-
if you use the code tags around your php or even html snippets, you will likely get more help
[ code ]Like this but without the spaces in the tags[ /code ]
would be
Like this but without the spaces in the tags
anyways, you can't call a php function w/in the array. As is, as far as php is concerned 'include("random.php")' is a string. You could use eval, but that is very insecure. So what I suggest is use a if statement inside the function put_image_here() that looks to see if the 'default_image' is == "RANDOM" and if so include random.php else use the image URL specified.
-
This kind of seems to be a repost of http://www.phpfreaks.com/forums/index.php/topic,245664.0.html...
-
Try this tutorial, it has been a lot of help to me when writing regexp.
-
the variable $newname seems to be what you'll want to save as the path.
-
you'll be using a INSERT query to add the images to a table, you'll use a SELECT query to grab the image paths from the table, and you'll do some looping to output them. Help? I'm sure not because I'm as vague as your question.
-
I'm not sure where to find what you are looking for. It seems to me that first of all $form is at no point declared any sort of object. What I think you are looking for is essentially $_POST['user'], so i'm not sure where the object comes in.
Secondly, you appear to be using a third party script. That means this topic is in the wrong place, but I could care less because I've already started helping you out. But, what that does mean is that it seems to me you cut something that was needed for the code you received. Do you have a link to where you got it from?
-
Sorry, I'm not to huge on classes and objects (I'm that kind of a programmer that doesn't use if I don't need it, learn it when I do).
Some how you need to get that function or a new function to lookup the user's info based on a parameter like their unique id. I'd just write a query inside your loop to pull their last_active info.
-
Is it that $player->last_active used your info (as in the person executing the script)?
Modify it to accept a perimeter to specify the user to look up.
-
<?php $dir="./Photos/LA/"; $handle = opendir ($dir); echo '<div align="left">'; while (false !== ($file = readdir($handle))) { $filepath = $dir.$file; if($file == "info.txt") { $array = file($filepath); echo '<strong><font color="#5A91AB" size="2" face="Arial, Helvetica, sans-serif">'.$array[0].'</font></strong><br>'; echo '<font color="#FFFFFF" size="1" face="Arial, Helvetica, sans-serif">'.$array[1].'</font><p>'; } if($file != "." && $file != ".." && $file != "TITLE.jpg" && $file != "TITLE.jpg" && $file != "info.txt") { $filepath = $dir.$file; #echo $filepath; echo ' <a href="Photobucket.php?dir='.$dir.'" target="_blank"><img src="'.$filepath.'" width="138" height="104" border="0"></a> '; } } ?>
then in the page Photobucket.php, use $_GET['dir'] to find out what directory you'll need to get images from.
-
Corbin, you have opened my eyes to something I had not known. Why does it allow me to tell it to accept longer numbers such as 16 digits? Numbers over 10 digits long must use float? 16 was just a number I pulled out that I knew should be large enough for the timestamp.
-
use two fields in your table, join_date and last_filed (use date or int(16) with unix time stamp).
When they join, set both fields to the date and time they are registering. Then use the several functions out there to determin the difference in days between the current date and those two fields. A few if statements later and you have code that will execute when they try logging in or something.
Or, you'll need to write a chron job which I don't know anything about but that will allow you to have this done automatically without user/admin interaction.
Either way, when you making those fields, I'd use the unix time stamp... its easier to handle imo.
I didn't read corbin's post... hope I don't step on toes
-
do you plan to continue using php prior to getting the login to work? If not, consider the freelance board for this project.
-
so everything but the "Call to a member function value() on a non-object in /home/myveeco/public_html/index.php on line 54" is solved?
Please share the code for the class that $form is using where value() is a member.
-
then js would be the best bet. If you post in the JS board and don't get replies w/in a reasonably amount of time, PM me and I'll go help you out (I don't hang around the JS board often)
-
relative, this means if you are not in the root, you use ".." to go up a folder.
To link to it if you are in http://www.myvee.co.uk/admin/ you will need to use the relative path
"../include/session.php"
-
lonewolf, and then use ajax to built the checkbox or use simple js to change the style.display of the element? Either would work, but this isn't the board for JS.
Kabucek, this seems to be a good time to use js, but if you want to go pure html and php, here is what you can do.
They will need to select from the drop down then submit the form. interchange $_GET for $_POST if you are using form method = post
<option value='code1'>event 1,IL</option> <option value='code2' <?php if($_GET['selectedProd'] == "code2"){ echo "selected"; } ?>>event 2, IL</option> </select> <?php if($_GET['selectedProd'] == 'code1'){ echo "Box here <input type='checkbox' name='check' value='1'>"; } ?>
you'll probably need to make several adjustments, but essentially that is what you could do.
-
are you using the function mysql_query() to execute the mysql query? if so, post your code and I'll help you out on the debuging
-
Do you want this with or without the page loading.
If you are okay with the page loading, we can help on this board. If you don't want the page to reload, jump over to the JS board.
-
are you using mysql_error() to debug mysql_query()?
-
use a relative path to include/session.php rather than that absolute path. In the INI file, the use of URLs for the include function looks to be disabled.
-
In the future, please use code tags around your code.
Currently it outputs an image that links to the image when it is clicked on, correct?
You want it to take you to your gallery page and have the gallery page know which folder to grab images from, correct?
It appears you are only grabbing images from one subdirectory using this code, the LA folder. So what is the point?
-
http://www.tizag.com/mysqlTutorial/mysqlsum.php
or you can use code to group them and add up to find out how many visits.
PHP Valid Email
in PHP Coding Help
Posted
Looks like it would work