|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Functions page - php, mysql
I need to have this functions.php page written. This is over my head and I don't have the time to learn how to do it myself.
All of the table names are correct in the $result lines below, pointing at the required piece of data. The rest of the code is just to give you an idea of what this functions.php page needs to do. This will give you the php hosting details, http://www.uc2.biz/phpinfo.php Price to be determined. Hoping to get this completed quickly. Thank You Tom Preferred if you email me. 'liberate (at) uc2 (dot) biz' <?php ##function.php function dbc() { //connect to mysql and choose database. mysql_connect("host","user","pw"); mysql_select_db("name"); } dbc(); function set_uid() { global $pfs; // Is ?pfs=username a valid username? If Yes - Return user1, if No - Return ?pfs=liberate $result = mysql_query("select user1 from lm_users where user1='$pfs'") or die(mysql_error()); if(mysql_num_rows($result) > 0) { $field = mysql_result($result, 0, 'user1'); return $field; }else{ return 'liberate'; } } // All data returned from db to be based // from the ?pfs=username or the default ?pfs=liberate if username not found dbc(); $uid = set_uid(); // Get username or default function getpfs($uid) { $result = mysql_query("select user1 from lm_users where user1='$uid'") or die(mysql_error()); $field = mysql_result($result, 0, 'user1'); return $field; } // The code above functions correctly, the code below still needs work. $psf = getpfs($uid) // Get ar_id or ar_id of default function ar_id($uid) { $result = mysql_query("select user2 from lm_users where user1='$uid'") or die(mysql_error()); $field = mysql_result($result, 0, 'user2'); return $field; } // Get name or name of default function printName() { global $uid; $result = mysql_query("select user4 from lm_users where user1='$uid'") or die(mysql_error()); $field = mysql_result($result, 0, 'user4'); return $field; } // Get email or email of default. // Email is added to simulated Post during formprocessing function printEmail($toggle) { global $uid; $result = mysql_query("select email from lm_users where user1='$uid'"); $field = mysql_result($result, 0, 'email'); //display email in a way that it won't be harvested... //explode email into two different parts if($toggle==1) { $expld = explode("@",$field); ?> <SCRIPT language="JavaScript" type="text/javascript"> <!-- var name = "<? print($expld[0]); ?>"; var domain = "<? print($expld[1]); ?>"; document.write('<a href=\"mailto:' + name + '@' + domain + '\">'); document.write(name + '@' + domain + '<\/a>'); // --> </SCRIPT> <? }else{ $rec_email = $field; return $rec_email; } } ?> To prevent email addresses from being harvested the email address is added to the form submission during the simulated Post of the formprocessor. Last edited by liberate : January 20th, 2004 at 08:23 PM. |
|
#2
|
|||
|
|||
|
Still Looking for someone to write php / mysql code.
Doesn't anyone want to earn a few bucks for about a half hour of work? I have a list of needed programming, I just need a person that will solve out the problems as they come up. If you keep your price reasonable, there will be other things to do beyond fixing the code of the functions page. Tom Preferred if you email me. 'liberate (at) uc2 (dot) biz' |
![]() |
| Viewing: Dev Shed Forums > Other > Project Help Wanted > Functions page - php, mysql |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|