Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Php 5 problem with a join.php file I have
Old 02-26-2008, 02:42 PM Php 5 problem with a join.php file I have
Novice Talker

Posts: 8
Trades: 0
I have a reminder script and I can't get the join.phP file to work no mater what I try. I clikc on agree on step 1 and click NEXT STEP and it does nothing. This happens in paid or no pay modes.

Please help my provider is switching to 5 soon.

Thanks


Code

PHP Code:
<?
 
include("include/common.php");
 include(
"include/header.php");
?>
<?
# if(!$submit1)$submit1=1;
 
if($submit1 == "1") {
  if(
$requirepaid) {
?>
   <h3>Signup for a New Account Step 1</h3><form method=post>
   <?=$table2?>
   <tr align=center>
    <td colspan=3>Select a Username. A password will be generated and emailed to you at the end of the signup process.<p></td>
   </tr>
<?   include("include/paidsignupform.php"); ?>
   </table>
   </form> 
<?
  
}
  if(!
$requirepaid) {
?>
   <h3>Signup for a New Account Step 1</h3><form method=post>
   <?=$table2?>
   <tr align=center>
    <td colspan=2>Fill out the form below. A password will be generated and emailed to you.<p></td>
   </tr>
<?   include("include/nopaidsignupform.php"); ?>
   </table></form>
<?
  
}
 }else if(
$submit1 == "2") {
?>
  <h3>Signup for a New Account</h3>
  <?=$table2?>
  <tr align=center>
   <td colspan=2>Press your browser's 'Back' key and click 'I Agree' to our terms and conditions to continue the signup process.<p></td>
  </tr> 
</table>
<?
 
}else if($submit2) {
  if(!
ereg("^[A-Za-z0-9_]{1,16}$",$susername)) {
   
$serror="Invalid username! Use no more than 15 characters and only letters, numbers, and underscores.<br>"
  }
  
$this->c=@mysql_query("select username from users where username='$susername'");
  
$this->d=mysql_fetch_object($this->c);
  if(
is_object($this->d)) { $serror="Username is already in use<br>"; }
  
$this->c=@mysql_query("select username from pending where username='$susername'");
  
$this->d=mysql_fetch_object($this->c);
  if(
is_object($this->d)) { $serror="Username is already in use<br>"; }
  echo 
"<h3>Signup for a New Account Step 3</h3>";
  if (!
$serror) {
   
$nowtime time();
   
mysql_query("insert into pending (username,since) values ('$susername','$nowtime')"); 
?>
   <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
   <?="$table2";?>
   <tr>
    <td align=center>
     Click the button below to signup for our <?=$paypal_sub?> subscription through PayPal. 
     The first 7 days are free, and you can cancel anytime before the 7 days are up 
     and be charged nothing.<p>
     <input type="hidden" name="cmd" value="_xclick-subscriptions">
     <input type="hidden" name="no_shipping" value="1">
     <input type="hidden" name="no_note" value="1">
     <input type="hidden" name="p3" value="1">
     <input type="hidden" name="t3" value="<?=$paypal_subcode?>">
     <input type="hidden" name="a1" value="0.00">
     <input type="hidden" name="src" value="1">
     <input type="hidden" name="sra" value="1">
     <input type="hidden" name="business" value="<?="$paypal_email";?>">
     <input type="hidden" name="item_name" value="<?="$paypal_item";?>">
     <input type="hidden" name="item_number" value="<?="$paypal_item_number";?>">
     <input type="hidden" name="a3" value="<?="$paypal_price";?>">
     <input type="hidden" name="notify_url" value="<?="$paypal_ipn";?>">
     <input type="hidden" name="cancel_return" value="<?="$paypal_cancel_return";?>">
     <input type="hidden" name="return" value="<?="$paypal_return";?>">
     <input type="hidden" name="os0" value="<?="$susername";?>">
     <input type="hidden" name="on0" value="Username">
     <input type="submit" value="Subscribe now">
    </td>
   </tr>
   </table></form>
<? 
  
}
  if (
$serror) {
?>
   <form method=post>
   <?=$table2?>
   <tr align=center>
    <td colspan=3><font color=red><?=$serror?></font><p></td>
   </tr>
<?   include("include/paidsignupform.php"); ?>
   </table></form>
<?
  
}
 }else if(
$submit3) {
  if(!
ereg("^[A-Za-z0-9_]{1,16}$",$susername)) {
   
$serror="Invalid username! Use no more than 15 characters and only letters, numbers, and underscores.<br>"
  }
  
$this->c=@mysql_query("select username from users where username='$susername'");
  
$this->d=mysql_fetch_object($this->c);
  if(
is_object($this->d)) { $serror="Username is already in use<br>"; }
  
$this->c=@mysql_query("select username from pending where username='$susername'");
  
$this->d=mysql_fetch_object($this->c);
  if(
is_object($this->d)) { $serror="Username is already in use<br>"; }
  if (!
$serror) {
   
mt_srand((double)microtime()*1000000^getmypid());
   
$pass_length mt_rand($this->min_pass_length,$this->max_pass_length);
   while(
strlen($spassword)<$pass_length) {
    
$spassword.=substr($this->chars,(mt_rand()%strlen($this->chars)),1); 
   }
   include(
"include/emails.php");
   
$signupmessage=str_replace("<username>","$susername",$signupmessage);
   
$signupmessage=str_replace("<password>","$spassword",$signupmessage);
   
$signupmessage=str_replace("<first_name>","$sfirst_name",$signupmessage);
   
$signupmessage=str_replace("<last_name>","$slast_name",$signupmessage);
   
$signupmessage=str_replace("<login_url>","$login_url",$signupmessage);
   
$subject "$signupsubject";
   
$message "$signupmessage";
   
mail($semail,$subject,$message,"From: $adminemail");
   
$adminsignupmessage str_replace("<username>","$susername",$adminsignupmessage);
   
$adminsignupmessage str_replace("<password>","$spassword",$adminsignupmessage);
   
$adminsignupmessage str_replace("<first_name>","$sfirst_name",$adminsignupmessage);
   
$adminsignupmessage str_replace("<last_name>","$slast_name",$adminsignupmessage);
   
$adminsignupmessage str_replace("<member_email>","$semail",$adminsignupmessage);
   
$subject "$adminsignupsubject";
   
$message "$adminsignupmessage";
   
mail($adminemail,$subject,$message,"From: $adminemail"); 
   
$nowdate date("M d, Y");
   
mysql_query("insert into users (
       uid, username, password, first_name, 
       last_name, street, city, state, zip, 
       country, email, telephone, last_paid, 
       signup_date
      ) values (
       '','
$susername', '$spassword', '$sfirst_name', 
       '
$slast_name', '$sstreet', '$scity', '$sstate', 
       '
$szip', '$scountry', '$semail', '$stelephone', 
       'free', '
$nowdate'
      )"
) or die( mysql_error() );
  }
  if (
$serror) {
?>
   <h3>Signup for a New Account Step 3</h3>
   <form method=post>
   <?=$table2?>
   <tr align=center>
    <td colspan=3><font color=red><?=$serror?></font><p></td>
   </tr>
<?   include("include/nopaidsignupform.php"); ?>
   </table></form>
<?
  
}else{
   echo 
"<h3>Signup for a New Account Complete</h3>$table2
    <tr><td align=center>Thank you for signing up 
$susername. We have sent you a 
    welcome email to <b>
$semail</b> with your password.</table>"
  }
 }else {
?>
  <h3>Signup for a New Account Step 1</h3>
  <?=$table2?>
  <tr>
   <td align=center>
    Please read through our terms and conditions below and click 'I Agree' to continue with the signup process.<p>
    <font size=3><b>Terms and Conditions</b></font><p>
    <form method=post><textarea name=textfield cols=60 rows=15 wrap=virtual>
<?  include "include/terms.php"?>
    </textarea><p><input type=radio name=submit1 value=1> I Agree<br><input type=radio name=submit1 value=2> I Disagree<p><input type=submit value='Next Step -->'></form>
   </td>
  </tr>
  </table>
<?
 
}
 include(
"include/footer.php");
?>
teamcro is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-26-2008, 03:30 PM Re: Php 5 problem with a join.php file I have
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
99.999 % chances are that your script relies on REGISTER_GLOBALS to be on, and it's off by default in PHP5.

Try to add this on top of every pages which don't work:
PHP Code:
ini_set('register_globals',true); 
This is strongly discouraged, but should let your script work.
By the way, I strongly suggest you to either look into it and update it (plain easy if you have a little PHP experience) or to upgrade/hire a freelancer to upgrade the script.
And know that this will definitively deprecated on PHP6.
http://www.php.net/manual/en/security.globals.php
Quote:
This feature is DEPRECATED and REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-26-2008, 04:52 PM Re: Php 5 problem with a join.php file I have
Novice Talker

Posts: 8
Trades: 0
that worked what you said how do I fix this to be secure? is it a lot of work to change that code?

Thanks
teamcro is offline
Reply With Quote
View Public Profile
 
Old 02-26-2008, 04:59 PM Re: Php 5 problem with a join.php file I have
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
is it a lot of work to change that code?
No, not really...

PHP4 had for default that any variables passed in a form was directly available in the script.
For example, if you had a field "email" in your form, when you posted it, a variable $email was instantiated by PHP.

Now, it's no more the case.
You have to go find the variable in a super global array.
More easily put, if your form was submitted with a POST, you will find it in $_POST['email'].
If the form was submitted with a GET, you will find it in $_GET['email'].

So, the modification is just to find every fields in the form, and to add their declaration at the beginning of the script:
PHP Code:
<?php
include("include/common.php");
include(
"include/header.php");
$email=$_GET['email'];
$user=$_GET['user'];

//and then your code like before....
?>
So the script will have the values of these variables.
See, plain easy.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-26-2008, 05:08 PM Re: Php 5 problem with a join.php file I have
Novice Talker

Posts: 8
Trades: 0
Thanks that worked.

I need to learn php any suggestions where to start..

Thanks again.
teamcro is offline
Reply With Quote
View Public Profile
 
Old 02-26-2008, 05:30 PM Re: Php 5 problem with a join.php file I have
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Sorry, but for that question, I won't have much clues...

It all depend your level already...
I'd say to make some google searches, and try some.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-26-2008, 05:57 PM Re: Php 5 problem with a join.php file I have
Novice Talker

Posts: 8
Trades: 0
Here is a strange one. The leap year works in php 4 but when I have it on php 5 I get this error. Tried many things but can't get that error to go away and show it correctly as it does in php 4.

I wish there was software to convert these things.

Thanks


Fatal error: Call to a member function isLeapYear() on a non-object in /home/public_html/remind1blue/include/common.php on line 247

PHP Code:
<?
 session_start
();
 include(
"config.php");
 
$edu_level['1']='High School degree';
 
$edu_level['2']='Undergraduate degree';
 
$edu_level['3']='Bachelor\'s degree';
 
$edu_level['4']='Master\'s degree';
 
$edu_level['5']='Doctoral degree';
 
$edu_level['6']='Post-doctoral degree';
 
$edu_level['7']='Training';
 
$edu_level['8']='Other';

 
$paypal_item $sitename." Service Monthly Subscription";
 
$paypal_item_number $sitename;
 
$mainipn $siteurl."/ipn.php";
 
$paypal_ipn $siteurl."/site_ipn.php";
 
$paypal_cancel_return $siteurl."/cancel.php";
 
$paypal_return $siteurl."/thanks.php";
 
$this->min_pass_length=8;
 
$this->max_pass_length=12;
 
$this->chars='abcdefghijklmnopqrstuvwxyz0123456789';
 
$logfile "logfile.txt";
 
$postmode 1;
 
$invalidcode "<table bgcolor=#ffffff cellpadding=4 width=170><tr><td align=center><font size=2><b>Invalid Button Code!</b><p>Run Your Own PayPal Donation Campaigns at <a href=$siteurl/join.php>$sitename</a></font></table>";
 
$table1 "<TABLE class=design bgColor=#ffffff cellPadding=3 cellSpacing=0 width=100% border='1' BORDERCOLOR='#C0C0C0' STYLE='border-collapse: collapse'>";
 
$table2 "<TABLE class=design bgColor=#ffffff cellPadding=3 cellSpacing=0 width=100% border='1' BORDERCOLOR='#C0C0C0' STYLE='border-collapse: collapse'>";
 
$table3 "<TABLE class=design bgColor=#ffffff cellPadding=3 cellSpacing=0 width=100% border='1' BORDERCOLOR='#C0C0C0' STYLE='border-collapse: collapse'>";
 @
mysql_connect($dbServer$dbUser$dbPass) or die("Couldn't connect to database server: " mysql_error());
 @
mysql_select_db($dbName) or die("Couldn't connect to database: " mysql_error());
 
 function 
errform($msg$var ''){ 
  global 
$posterr$_POST
  
$posterr 1
  echo 
"<div style='color: #FF0000;'>$msg</div>";
  if (
$var$_POST[$var] = '';
 }
 
 function 
buildDateBox($type,$name,$sel){
  
$months = Array(
    
"1"=>"January",
    
"2"=>"February",
    
"3"=>"March",
    
"4"=>"April",
    
"5"=>"May",
    
"6"=>"June",
    
"7"=>"July",
    
"8"=>"August",
    
"9"=>"September",
    
"10"=>"October",
    
"11"=>"November",
    
"12"=>"December");
?>
  <SELECT NAME="<?=$name?>">
<?
  
switch($type){
   case 
"d":
    echo 
"<option value=''>-----";
    for(
$i 1;$i <= 31;$i++){
     
$arlist[$i] = $i;
    }
    break;
   case 
"y":
    echo 
"<option value=''>-----";
    
$year = (date("Y")+10);
    for(
$i $year;$i >= 2004;$i--){
     
$arlist[$i] = $i;
    }
    break;
   case 
"m":
   default:
    echo 
"<option value=''>-----";
    
$arlist $months;
    break;
  }
  while( list(
$i,$val) = each($arlist) ){
   if(
$sel == $i){
    echo 
"<OPTION VALUE=\"$i\" SELECTED>$val</OPTION>\n"
   }else{
    echo 
"<OPTION VALUE=\"$i\">$val</OPTION>\n"
   }
  }
?>
  </select>
<?
 
}
 function 
buildTimeBox($type,$name,$sel){
   
$types = Array(
     
"0"=>"AM",
     
"1"=>"PM"
    
);
?>
  <SELECT NAME="<?=$name?>">
<?
  
switch($type){
   case 
"m":
    echo 
"<option value=''>-----";
    for(
$i 0;$i <= 55;$i++){
     
$arlist[$i] = $i;
    }
    break;
   case 
"t":
    echo 
"<option value=''>-----";
    
$arlist $types;
    break;
   case 
"h":
   default:
    echo 
"<option value=''>-----";
    for(
$i 1;$i <= 12;$i++){
     
$arlist[$i] = $i;
    }
    break;
  }
  while( list(
$i,$val) = each($arlist) ){
   if(
$sel == $i){
    echo 
"<OPTION VALUE=\"$i\" SELECTED>$val</OPTION>\n"
   }else{
    echo 
"<OPTION VALUE=\"$i\">$val</OPTION>\n"
   }
  }
?>
  </select>
<?
 
}

 function 
edulevel($name,$sel){
  global 
$edu_level;
  
reset($edu_level);
  echo 
"<select name='$name'>";
  while( list(
$i,$val) = each($edu_level) ){
   if(
$sel == $i){
    echo 
"<OPTION VALUE=\"$i\" SELECTED>$val</OPTION>\n"
   }else{
    echo 
"<OPTION VALUE=\"$i\">$val</OPTION>\n"
   }
  }
  echo 
"</select>";
 }
 function 
myround($amt,$dec="3"){
  
ob_start();
  if(
$dec == 2){
   
printf("%6.2f",$amt);
  }else{
   
printf("%6.3f",$amt);
  }
  
$amount ob_get_contents();
  
ob_end_clean(); 
  
$amount str_replace(" ","",$amount);
  return 
$amount;
 }
 class 
fptime{
  function 
fptime(){
   return 
1;
  }
  function 
mytime($stamp="",$format="m/d/Y"){
   return 
date$format,($stamp $stamp time()) );
  }
  function 
stamp($mm,$dd,$yy,$hh=0,$min=0,$sec=0){
   return 
mktime($hh,$min,$sec,$mm,$dd,$yy);
  }
  function 
subhours($interval,$mm,$dd,$yy,$hh,$m,$s){
   return 
$this->stamp$mm,$dd,$yy,($hh-$interval),$m,$s );
  }
  function 
addhours($interval,$mm,$dd,$yy,$hh,$m,$s){
   return 
$this->stamp$mm,$dd,$yy,($hh+$interval),$m,$s );
  }
  function 
subdays($interval,$mm,$dd,$yy){
   return 
$this->stamp($mm,($dd-$interval),$yy);
  }
  function 
adddays($interval,$mm,$dd,$yy,$hh=0,$min=0,$sec=0){
   return 
$this->stamp($mm,($dd+$interval),$yy,$hh,$min,$sec);
  }
  function 
submonths($interval,$mm,$dd,$yy){
   return 
$this->stamp( ($mm-$interval),$dd,$yy );
  }
  function 
addmonths($interval,$mm,$dd,$yy){
   return 
$this->stamp( ($mm+$interval),$dd,$yy );
  }
  function 
subyears($interval,$mm,$dd,$yy){
   return 
$this->stamp$mm,$dd,($yy-$interval) );
  }
  function 
addyears($interval,$mm,$dd,$yy){
   return 
$this->stamp$mm,$dd,($yy+$interval) );
  }
  function 
DateDiff ($interval$date1,$date2) {
   
// get the number of seconds between the two dates
   
$timedifference =  $date2 $date1;
   switch (
$interval) {
    case 
"w":
     
$retval $timedifference/604800;
     
$retval floor($retval);
     break;
    case 
"d":
     
$retval $timedifference/86400;
     
$retval floor($retval);
     break;
    case 
"h":
     
$retval $timedifference/3600;
     
$retval floor($retval);
     break;
    case 
"n":
     
$retval $timedifference/60;
     
$retval floor($retval);
     break;
    case 
"s":
     
$retval  floor($timedifference);
     break;
   }
   return 
$retval;
  }
  function 
dateNow($format="%Y%m%d"){
   return(
strftime($format,time()));
  }
  function 
dateToday(){
   
$ndate time();
   return( 
$ndate );
  }
  function 
daysInMonth($month="",$year=""){
   if(empty(
$year)) {
    
$year $this->dateNow("%Y");
   }
   if(empty(
$month)) {
    
$month $this->dateNow("%m");
   }
   if(
$month == 2) {
    if(
$this->isLeapYear($year)) {
     return 
29;
    } else {
     return 
28;
    }
   } elseif(
$month == or $month == or $month == or $month == 11) {
    return 
30;
   } else {
    return 
31;
   }
  }
  function 
isLeapYear($year=""){
   if(empty(
$year)) {
    
$year $this->dateNow("%Y");
   }
   if(
strlen($year) != 4) {
    return 
false;
   }
   if(
preg_match("/\D/",$year)) {
    return 
false;
   }
   return ((
$year == && $year 100 != 0) || $year 400 == 0);
  }
 }
?>
teamcro is offline
Reply With Quote
View Public Profile
 
Old 02-26-2008, 06:29 PM Re: Php 5 problem with a join.php file I have
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
at the end of the file, replace
PHP Code:
if($this->isLeapYear($year)) { 
with
PHP Code:
if(isLeapYear($year)) { 
This should resolve your issue.
Changes in the obect orientd model in PHP5 caused that error.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-26-2008, 06:43 PM Re: Php 5 problem with a join.php file I have
Novice Talker

Posts: 8
Trades: 0
Tried that and I get

Fatal error: Call to undefined function isLeapYear() in /home/username/public_html/businesses/remind1blue/include/common.php on line 247

But the url line reads this (I set reminders on the 26 and 29 and that is why the line below shows the 29)Strange it works on PHP4 and gets it right.

http://www.domainname.com/businesses...h=2&currDay=29

Here is both codes

Calendar.php code

PHP Code:
<?
 
include("include/common.php");
 if(!
$loggedin){
  
ob_start();
  
header("Location: login.php");
 }
 include(
"include/header.php");
 include(
"include/accmenu.php");
 
$query "SELECT * FROM users WHERE uid='$myuid'";
 
$result mysql_query($query) or die ("Error in query: $query. " mysql_error());
 if ( (
$result) && (mysql_num_rows($result) > 0) ){
  
$row mysql_fetch_object($result);
 }
?>
<?
 
// list of names for days and months
 
$days = array("Sunday""Monday""Tuesday""Wednesday""Thursday""Friday""Saturday");
 
$months = array("""January""February""March""April""May""June""July""August""September""October""November""December");
 
// number of days in each month
 
$totalDays = array(0312831303130313130313031);
 
// set up some variables to identify the month, date and year to display
 
if(!$currYear) { $currYear date("Y"); }
 if(!
$currMonth) { $currMonth date("n"); }
 if(!
$currDay) { $currDay date("j"); }
 
// if leap year, modify $totaldays array appropriately
 
if (date("L"mktime(0,0,0,$currMonth,1,$currYear))){
  
$totalDays[2] = 29
 }
?>
 <table border="0" cellpadding="10" cellspacing="1" width="100%" style='border: 1px solid #000000;background-color:#ffffff;'>
 <tr>
  <td valign=top align=left>
   <? include("dayview.php"); ?>
  </td>
  <td valign=top align=right width=100>
   <? include("monthview.php"); ?>
  </td>
 </tr>
 </table>
 </font></p>
<?
 
include("include/footer.php");
?>
common.php Code

PHP Code:
<?
 session_start
();
 include(
"config.php");
 
$edu_level['1']='High School degree';
 
$edu_level['2']='Undergraduate degree';
 
$edu_level['3']='Bachelor\'s degree';
 
$edu_level['4']='Master\'s degree';
 
$edu_level['5']='Doctoral degree';
 
$edu_level['6']='Post-doctoral degree';
 
$edu_level['7']='Training';
 
$edu_level['8']='Other';

 
$paypal_item $sitename." Service Monthly Subscription";
 
$paypal_item_number $sitename;
 
$mainipn $siteurl."/ipn.php";
 
$paypal_ipn $siteurl."/site_ipn.php";
 
$paypal_cancel_return $siteurl."/cancel.php";
 
$paypal_return $siteurl."/thanks.php";
 
$that->min_pass_length=8;
 
$that->max_pass_length=12;
 
$that->chars='abcdefghijklmnopqrstuvwxyz0123456789';
 
$logfile "logfile.txt";
 
$postmode 1;
 
$invalidcode "<table bgcolor=#ffffff cellpadding=4 width=170><tr><td align=center><font size=2><b>Invalid Button Code!</b><p>Run Your Own PayPal Donation Campaigns at <a href=$siteurl/join.php>$sitename</a></font></table>";
 
$table1 "<TABLE class=design bgColor=#ffffff cellPadding=3 cellSpacing=0 width=100% border='1' BORDERCOLOR='#C0C0C0' STYLE='border-collapse: collapse'>";
 
$table2 "<TABLE class=design bgColor=#ffffff cellPadding=3 cellSpacing=0 width=100% border='1' BORDERCOLOR='#C0C0C0' STYLE='border-collapse: collapse'>";
 
$table3 "<TABLE class=design bgColor=#ffffff cellPadding=3 cellSpacing=0 width=100% border='1' BORDERCOLOR='#C0C0C0' STYLE='border-collapse: collapse'>";
 @
mysql_connect($dbServer$dbUser$dbPass) or die("Couldn't connect to database server: " mysql_error());
 @
mysql_select_db($dbName) or die("Couldn't connect to database: " mysql_error());
 
 function 
errform($msg$var ''){ 
  global 
$posterr$_POST
  
$posterr 1
  echo 
"<div style='color: #FF0000;'>$msg</div>";
  if (
$var$_POST[$var] = '';
 }
 
 function 
buildDateBox($type,$name,$sel){
  
$months = Array(
    
"1"=>"January",
    
"2"=>"February",
    
"3"=>"March",
    
"4"=>"April",
    
"5"=>"May",
    
"6"=>"June",
    
"7"=>"July",
    
"8"=>"August",
    
"9"=>"September",
    
"10"=>"October",
    
"11"=>"November",
    
"12"=>"December");
?>
  <SELECT NAME="<?=$name?>">
<?
  
switch($type){
   case 
"d":
    echo 
"<option value=''>-----";
    for(
$i 1;$i <= 31;$i++){
     
$arlist[$i] = $i;
    }
    break;
   case 
"y":
    echo 
"<option value=''>-----";
    
$year = (date("Y")+10);
    for(
$i $year;$i >= 2004;$i--){
     
$arlist[$i] = $i;
    }
    break;
   case 
"m":
   default:
    echo 
"<option value=''>-----";
    
$arlist $months;
    break;
  }
  while( list(
$i,$val) = each($arlist) ){
   if(
$sel == $i){
    echo 
"<OPTION VALUE=\"$i\" SELECTED>$val</OPTION>\n"
   }else{
    echo 
"<OPTION VALUE=\"$i\">$val</OPTION>\n"
   }
  }
?>
  </select>
<?
 
}
 function 
buildTimeBox($type,$name,$sel){
   
$types = Array(
     
"0"=>"AM",
     
"1"=>"PM"
    
);
?>
  <SELECT NAME="<?=$name?>">
<?
  
switch($type){
   case 
"m":
    echo 
"<option value=''>-----";
    for(
$i 0;$i <= 55;$i++){
     
$arlist[$i] = $i;
    }
    break;
   case 
"t":
    echo 
"<option value=''>-----";
    
$arlist $types;
    break;
   case 
"h":
   default:
    echo 
"<option value=''>-----";
    for(
$i 1;$i <= 12;$i++){
     
$arlist[$i] = $i;
    }
    break;
  }
  while( list(
$i,$val) = each($arlist) ){
   if(
$sel == $i){
    echo 
"<OPTION VALUE=\"$i\" SELECTED>$val</OPTION>\n"
   }else{
    echo 
"<OPTION VALUE=\"$i\">$val</OPTION>\n"
   }
  }
?>
  </select>
<?
 
}

 function 
edulevel($name,$sel){
  global 
$edu_level;
  
reset($edu_level);
  echo 
"<select name='$name'>";
  while( list(
$i,$val) = each($edu_level) ){
   if(
$sel == $i){
    echo 
"<OPTION VALUE=\"$i\" SELECTED>$val</OPTION>\n"
   }else{
    echo 
"<OPTION VALUE=\"$i\">$val</OPTION>\n"
   }
  }
  echo 
"</select>";
 }
 function 
myround($amt,$dec="3"){
  
ob_start();
  if(
$dec == 2){
   
printf("%6.2f",$amt);
  }else{
   
printf("%6.3f",$amt);
  }
  
$amount ob_get_contents();
  
ob_end_clean(); 
  
$amount str_replace(" ","",$amount);
  return 
$amount;
 }
 class 
fptime{
  function 
fptime(){
   return 
1;
  }
  function 
mytime($stamp="",$format="m/d/Y"){
   return 
date$format,($stamp $stamp time()) );
  }
  function 
stamp($mm,$dd,$yy,$hh=0,$min=0,$sec=0){
   return 
mktime($hh,$min,$sec,$mm,$dd,$yy);
  }
  function 
subhours($interval,$mm,$dd,$yy,$hh,$m,$s){
   return 
$that->stamp$mm,$dd,$yy,($hh-$interval),$m,$s );
  }
  function 
addhours($interval,$mm,$dd,$yy,$hh,$m,$s){
   return 
$that->stamp$mm,$dd,$yy,($hh+$interval),$m,$s );
  }
  function 
subdays($interval,$mm,$dd,$yy){
   return 
$that->stamp($mm,($dd-$interval),$yy);
  }
  function 
adddays($interval,$mm,$dd,$yy,$hh=0,$min=0,$sec=0){
   return 
$that->stamp($mm,($dd+$interval),$yy,$hh,$min,$sec);
  }
  function 
submonths($interval,$mm,$dd,$yy){
   return 
$that->stamp( ($mm-$interval),$dd,$yy );
  }
  function 
addmonths($interval,$mm,$dd,$yy){
   return 
$that->stamp( ($mm+$interval),$dd,$yy );
  }
  function 
subyears($interval,$mm,$dd,$yy){
   return 
$that->stamp$mm,$dd,($yy-$interval) );
  }
  function 
addyears($interval,$mm,$dd,$yy){
   return 
$that->stamp$mm,$dd,($yy+$interval) );
  }
  function 
DateDiff ($interval$date1,$date2) {
   
// get the number of seconds between the two dates
   
$timedifference =  $date2 $date1;
   switch (
$interval) {
    case 
"w":
     
$retval $timedifference/604800;
     
$retval floor($retval);
     break;
    case 
"d":
     
$retval $timedifference/86400;
     
$retval floor($retval);
     break;
    case 
"h":
     
$retval $timedifference/3600;
     
$retval floor($retval);
     break;
    case 
"n":
     
$retval $timedifference/60;
     
$retval floor($retval);
     break;
    case 
"s":
     
$retval  floor($timedifference);
     break;
   }
   return 
$retval;
  }
  function 
dateNow($format="%Y%m%d"){
   return(
strftime($format,time()));
  }
  function 
dateToday(){
   
$ndate time();
   return( 
$ndate );
  }
  function 
daysInMonth($month="",$year=""){
   if(empty(
$year)) {
    
$year $that->dateNow("%Y");
   }
   if(empty(
$month)) {
    
$month $that->dateNow("%m");
   }
   if(
$month == 2) {
    if(
isLeapYear($year)) {  
     return 
29;
    } else {
     return 
28;
    }
   } elseif(
$month == or $month == or $month == or $month == 11) {
    return 
30;
   } else {
    return 
31;
   }
  }
  function 
isLeapYear($year=""){
   if(empty(
$year)) {
    
$year $that->dateNow("%Y");
   }
   if(
strlen($year) != 4) {
    return 
false;
   }
   if(
preg_match("/\D/",$year)) {
    return 
false;
   }
   return ((
$year == && $year 100 != 0) || $year 400 == 0);
  }
 }
?>
teamcro is offline
Reply With Quote
View Public Profile
 
Old 02-26-2008, 06:49 PM Re: Php 5 problem with a join.php file I have
Novice Talker

Posts: 8
Trades: 0
Got it to work.

Thanks that is strange.

I'm using the updated code for php 5 on php 4 as it works and there will be no errors when they transfer the accounts to php 5

Thanks again. I'm going to learn this PHP 5 as I was going to start with 4 but why start on something that is at the end of the line in August 2008

Last edited by teamcro; 02-26-2008 at 07:05 PM..
teamcro is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Php 5 problem with a join.php file I have
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.45544 seconds with 12 queries