laffin
Members-
Posts
1,200 -
Joined
-
Last visited
Everything posted by laffin
-
How to deal with autologon feature in a given link by email?
laffin replied to lopes_andre's topic in PHP Coding Help
If this is a mailing list (mass mail), there isnt a convienent way of saying 5 users of 20 get a specific email. (reasion its mass mail, everyone gets the same piece of mail). First ya have to learn/code, how to seperate the members from the guests. than mass mail the guests, and send the members specific emails. as with others I wuouldnt automatically do this, I wud make this optional at user request. -
code may be different, but that for loop will work its not the php code that is the problem, but the queries themselves. I think u should visualize what data and how ya want the data either single or multiple array. a layout shud be able to descibe a lot better than wut that code did.
-
why not break it down into seperate queries than once that works work on combining them into 1 query
-
it wasnt the braces that solved the error. it was the single quotes around the variable. mysql must know that what you are trying to find isnt another field, so ya must enclose the text within quotes. WHERE username = lisa will look for a field name lisa WHERE username = 'lisa' will look for lisa in the username column the braces help seperating yer variables from the string. and ya shud pass any strings through mysql_real_escape_string to avoid some nasty mysql injections. good luck
-
Need a little Tutoring - How to turn and idea into script...
laffin replied to Andress's topic in PHP Coding Help
Myself, I begin with layout / data first. Making a simple html form or outline helps a lot. This will also help in u visualizing what data u will need. Such as a registration forms, blog outlines. with the data i need, i decide on how to store that data db/flatfile/outside source. with just that, i begin coding, as the data gives a good direction to how to handle the data (input validation/error handling) than finally the core processing code, whut the heck we do with all that data. it may take some time, but giving yerself an outline of the finish product is a great way to start. Anyways good luck -
Like I said, if ya stuck with the code I gave ya initially, its not hard getting just the days which are open <?php // Get Todays Date list($m,$d,$y)=explode('/','10/17/2008'); //Generate random days schedule $sch=array(); for($counter=intval(floor($d/2));$counter>0;$counter--) { do { $sd = rand(1,$d); } while (array_search($sd,$sch)!=false); $sch[]=$sd; } //Initialize our array $dim=array_fill(1,$d,false); // Fill in our Schedule foreach ($sch as $val) $dim[$val]=true; // Show our Schedule foreach ($dim as $day) echo date('m/d/Y',mktime(0,0,0,$m,$day,$y)). '-' . ($day?'Closed':'Open') ."<BR>\n"; is the initial code I gave if ya look at the last routine, which is show the schedule, a simple modification, ya can have it build an array of days that are open. $opendates = array() foreach ($dim as $day) if(!$day) $opendates[]=$day; now $opendates has a list of days that is open. I did say, I hope ya understand the code. cuz if ya understood it, it wudn have been difficult to make those modifications. Good Luck
-
U can generate a password a number of ways. lets try a simple one eh function generatepw($length = 6) { $allowed = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-+="; $password=''; for($i=0;$i<$length;$i++) $password .= substr($allowed,rand(0,strlen($allowed)-1),1); return $password; } very simple method
-
I wud take it to a site that is geared for torrent trackers. There are too many scripts / functions for a person to go over and understand it all. Whereas a forum geared for tracker scripts, ya will find a number of users who have successfully installed and modded such script, as well as give ya a pros/cons to that script. take a look over at bvlist they may be able to help u as they try and support some of these unsupoorted torrent tracker projects
-
CheckBoxes either return the value or dun so ya can use isset to determine the value $checkbox = isset($_GET['mycheckbox'])?1:0; 1 if it was checked 0 if it wasnt
-
U grab stuff between the & tags (preg_match) apply the hightlighting apply codes that wont interfere with the bbcode/smilie parser reinsert this block back into the message the message can be stored in its bbcoded state. for special codes ya can look here Special HTML Codes by replacing the '[' with the special code, ya avoid the bbcode parser alltogether, than it comes to any smilies that may be in the code.
-
Yes, but under windows ya needs a third party application. which generally creates a virtual nic for yer machine. A few years ago, I used Sygate Office Networking. which made my pc into a router for the other 2 pcs. Under Linux, ya can assign more than 1 ip per nic
-
Now if this is web based, ya can take a huge shortcut. and google Google Site Search as for a custom made one as u define will be very slow if the search has to do this everytime. yer best bet is to use mysql or similar db (ya might get away with sqlite v3) and use text matching for the searches, this is after u strip out the html tags. If the pages are located in the same dir, ya can do a checksum of the pages and their content as well. Anyways good luck
-
Ya shudda stuck with the code I gave ya. and just added the routine ya needed ya wudda been done a lot sooner
-
I see a javascript displaying a pic depending on which menu item is highlighted. dun see many more images on that page
-
I take it ya missed the part about using various static info. one of them being IP. there was a reason for using a db for these keys as well. but ya have to read the whole post in order to get a hint of what can be done. and I did say that was a simple form. using md5, and 5 pieces of info from the user profile/details. I have helped a friend make a 96 character key, 3 md5's checksums tied together. these keys have a lifespan of 2 weeks. so all in all not a bad system.
-
Careful with that, ya might get a divide by zero $rating = round(($points && $totalvotes)?($points / $totalvotes):0); is all u need, cuz ya only have 1 - 5 as a scale so dividing the total points by total votes will still give u a range of 1 - 5 using the round function well makes shure yer at a whole number switch($ratiing) { case 1: // 1 star break; . . default: // no stars } or use if/ifelse/else structure
-
using md5 with various bits of info $link="http://my.site.com/qlogin.php&key=". md5($username . $password) wud be the simplest form, of course ya want more static info in there. but ya can save the key into the db, and create these keys with other non static info, if done with a db, ya can also throw in all sorts of info. Such as IPs allowed Date restrictions Expirations and so forth
-
that depends on how u store yer card values. I wud think, ya wud want to store them by numerical and suit weight. that way ya can pull pairs quckly.
-
[SOLVED] Insert Multiple Phone Number Fields into Database
laffin replied to hoopplaya4's topic in PHP Coding Help
Hope it all makes sense now Good luck -
From switch ($imgUrl) To switch ($domain) Repetitive, just follow the pattern From case 1: if($domain=="http://webdesign.pmcsravenstone.com"){ $imgUrl="web.png"; break; To case "http://webdesign.pmcsravenstone.com": $imgUrl="web.png"; break;
-
Yes, its possible. ya wud never use yer login info in yer link. Usually such links are ip based, meaning, ya wud make a link for each location ya plan on. and possibly temp links (links good for only a few logins or a period of time) but the options are pretty much endless
-
Not too shure about an OS tutorial, especially on Linux. With the different types of distros out there, ya will find a tutorial concentrating on one distribution. As such its installation procedures. And Believe me some installations of Linux itself can painful. (Not to mention if the network connectivity isnt set up, how to get help). ya may consider using a small linux distro (DSL) or a virtual PC (VirtualBox) to get ya started in linux, cuz a simple setup and accessibility to help is no doubt a requirement for new users.
-
[SOLVED] Insert Multiple Phone Number Fields into Database
laffin replied to hoopplaya4's topic in PHP Coding Help
<?php $phones = $_POST['phone']; // Get The Form Values $new = ""; // Initialize our string $x = 1; // Initialize a counter $c = count($phones); // How many items did we get from the form foreach($phones AS $phone){ // loop through each item from form $pipe = ($x == $c) ? "" : "|"; // is it last item? Yes - add Blank, No - add | to our string $new .= $phone . $pipe; // add to our string the current item and optional | $x++; // prepare for next item } ?> -
doesnt it do you head in when u cant see such a minor error
laffin replied to newbreed65's topic in PHP Coding Help
movietype_name = '" . $_POST['movie_name'] . "', did u try removing that comma at the end? -
[SOLVED] Insert Multiple Phone Number Fields into Database
laffin replied to hoopplaya4's topic in PHP Coding Help
why not just use implode, yer function does the same thing as implode <?php $phones = $_POST['phone']; $new =implode('|',$phones); ?>