Jump to content

JackJack

Members
  • Posts

    38
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

JackJack's Achievements

Member

Member (2/5)

0

Reputation

  1. My friend is making a site with internet radio and has asked me to make a script for the 'Radio Stats' Like "Current DJ, current song, current listeners and last 3 songs". I'm been scratching my head but don't klnow how I could display this kind of data? I'm open to any suggestions, ty. Ps. He is using Sam Broadcasting software if that helps =)
  2. <?php $page = "Company View"; include("header.php"); $Company = mysql_fetch_array(mysql_query("SELECT * FROM BETA_COMPANY WHERE id=$view")); $Owner = mysql_fetch_array(mysql_query("SELECT * FROM BETA_PLAYER WHERE id=$Company[owner]")); $CoOwner = mysql_fetch_array(mysql_query("SELECT * FROM BETA_PLAYER WHERE id=$Company[coowner]")); $Members = mysql_num_rows(mysql_query("SELECT `company` FROM BETA_PLAYER WHERE company=$view")); echo "<table><tr><td width=50%> <div align=left><b>Company Name:</b> $Company[name]<br><br> <b>Company Owner:</b> $Owner[display_name]<br><br> <b>Company Co-Owner:</b> $CoOwner[display_name]<br><br> <b>Number of Members:</b> $Members </td>"; echo "<td width=50%> <br><b>Company Name:</b> $Company[name]<br><br> <b>Company Owner:</b> $Owner[display_name]<br><br> <b>Company Co-Owner:</b> $CoOwner[display_name]<br><br> <b>Number of Members:</b> $Members<br><br> </td></tr></table>"; include("footer.php"); ?> I basically want 2 sets of information on the page, one of the left and starting half way in the page. Please help! Ty =)
  3. How can i check how long a word is??? My code is [code]}elseif(empty($_POST['username']) <= 3) {   echo '     <font color="#FF0000" size="2" face="Verdana, Arial, Helvetica, sans-serif">          • Invalid username: must be between 3 - 15 characters     </font>';   $show_form = 1; }[/code] But its defently wrong [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /] Ty
  4. I wish it were that simple. Heres the chunk of php im using. [code]}elseif(preg_match("/^[_a-zA-Z0-9-]+$/", $_POST['username'])) {   echo '     <font color="#FF0000" size="2" face="Verdana, Arial, Helvetica, sans-serif">          • Invalid username: a-Z 0-9 -_ characters only     </font>';   $show_form = 1; }[/code] $username = "test" would display error $username = "$}~##" wont display error :S
  5. Thank you for all your help but how can i make it doesnt have one of those letters in it will come up with an error???? Ty
  6. How do i get it to say"invalid username" if it contains symbol which isnt "a-Z 0-9 -_"? thank you
  7. I want to create a form (sounds easy). When there is an error like [code]<? if($username){ echo "Please type a username"; } ?> [/code] But i want this to appear on the top of the signup page not the next page. Please help JJ
  8. [!--quoteo(post=372747:date=May 9 2006, 03:41 PM:name=jeremywesselman)--][div class=\'quotetop\']QUOTE(jeremywesselman @ May 9 2006, 03:41 PM) [snapback]372747[/snapback][/div][div class=\'quotemain\'][!--quotec--] If you are running this on your own computer and not on a server you will get this result. [/quote] Thank you JJ
  9. I want to show the users IP on the page but the result for me is 127.0.0.1 (but infact it is something else). The code i have used is : [code]     <center>         <font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">             Your IP is being logged as: <?php echo $_SERVER['REMOTE_ADDR']; ?>         </font>     </center> [/code] Thank you JJ
  10. I have a php which you can update the name of your company. It works fine except one problem, It shows the old name is the text box and at the bottom it says "Your in the company 'old name'." Until you refresh it. If i have a refresh it i wont be able to see You have successfully updayed your company name. Please Help [code] <? include ("header.php"); ?> <? $name = $_POST['name']; $tim = time(); ?> <?php     $companys = mysql_fetch_array(mysql_query("SELECT * FROM `companys` WHERE `name`='$stat[company_name]'")); ?> <? if($stat[company_status] == 0){ ?> Your not in a company at the moment.<br> Click <a href="district" target="_self">here</a> to join or create a company. <? }else{ ?> <? if($companys[owner] == $stat[display_name]){ ?> <center>   <h2><u>Change Your Companys Settings</u></h2> </center><br> <form name="updatename" method="post" action="company.php?update=name"> <table width="29%" border="2" cellspacing="1" cellpadding="1">   <tr>     <th width="53%" bgcolor="#CCCCCC" scope="row">Company Name : </th>     <td width="47%">       <div align="center">         <input name="name" type="text" value="<? echo $companys['name']; ?>" size="20" maxlength="15">         </div></td>   </tr> </table> <table width="30%" border="0" cellspacing="0" cellpadding="0">   <tr>     <th height="12" scope="row"><input type="submit" name="Submit2" value="Update"></th>   </tr> </table> </form><br> <? if($update == 'name'){ ?> <?php     $dupe0 = mysql_num_rows(mysql_query("select * from companys where name='$name'"));     if ($dupe0 > 0) { ?> There is already a company with that name. <? }else{ ?> <? mysql_query("UPDATE `company_news` SET `company`='$name' WHERE `owner`='$stat[display_name]'"); mysql_query("UPDATE `companys` SET `name`='$name' WHERE `owner`='$stat[display_name]'"); mysql_query("UPDATE `company_news` SET `company`='$name' WHERE `company`='$company[name]'"); mysql_query("UPDATE `players` SET `company_name`='$name' WHERE `id`='$stat[id]'"); mysql_query("INSERT INTO `company_news` (sender, title, message, company, owner) VALUES ('Updater','Company Name Updated','Your companys name has been updated to $name.','$name','$stat[display_name]')") or die(mysql_error()); echo "You successfully changed your companys name to <b>$name</b>."; } } ?>   <? }else{ ?> <center>   <h2><u>View Your Companys Settings</u></h2> </center> Your a member. <? } ?> <br> Your in the company <b><? echo $stat[company_name]; ?></b>. <? } ?> [/code] Thank you Ps. I know my codings terebaly untidy. Ill sort it out myself when im finished though.
  11. When i insert a new table in mysql i put the date as $date. [code] mysql_query("INSERT INTO `company_news` (date, sender, title, message, company) VALUES ('$date', 'Updater', 'Company Name Updated', 'Your companys name has been updated to $name.', '$name')"); [/code] When i look at what has been added the date is always "0000-00-00 00:00:00". Please help JJ
  12. This says "unexpected t_else on line 26" but i don't know whats wrong because it was just working before. [code] <? include ("header.php"); ?> <?php if ($stat[company_status] == 1){ ?>     <p>Your already in a company.</p>   <? }else{ ?>   <?php if($join > 0){ ?>     <?php     $companyssel = mysql_query("SELECT * FROM `companys` WHERE `id`=$join ");     while ($companys = mysql_fetch_array($companyssel)) {     ?>     <p>Are you sure you want to join <b><?php echo $companys['name']; ?></b>?</p>              <table width="25%" height="39" border="0" cellpadding="0" cellspacing="0">           <tr>             <th scope="row"><form method="post" action="join.php?join=<?php echo $companys[id]; ?>">             <input type="submit" value="Yes" />             </form>             <form method="post" action="district.php">               <input type="submit" value="No" />               </form>               </th>           </tr>         </table> <? }else{ ?>       <p>Error occurred. If this problem persists, please contact a developer.</p>   <? } ?>   <? } ?>   <? } ?> <p align="right">   <input name="button2" type="button" onclick="history.back()" value="Back"> </p> [/code] Thank You JJ
  13. The actual text i type in shows but the MySql code i type doesn't work. Here is a screeny and a the code. Please Help [img src=\"http://img96.imageshack.us/img96/1569/screeny6yg.png\" border=\"0\" alt=\"IPB Image\" /] [code] <? include ("header.php"); ?> <?php if($view > 0){ ?>     <?php     $companyssel = mysql_query("SELECT * FROM companys where id=$view");     while ($companys = mysql_fetch_array($companyssel)) {     ?>     <center>       <p><img src="<?php echo '$companys[avatar]'; ?>" alt="Companys Avatar" height="150" width="150" /><br />       <br /></p>     </center>       <table width="37%" height="110" border="2" cellpadding="1">         <tr>           <th width="51%" height="22" bgcolor="#CCCCCC" scope="row"><div align="center">Company Name: </div></th>           <td width="49%"><div align="center"><?php echo '$companys[name]'; ?></div></td>         </tr>         <tr>           <th height="22" bgcolor="#CCCCCC" scope="row"><div align="center">Company Owner: </div></th>           <td><div align="center"><?php echo '$companys[owner]'; ?></div></td>         </tr>         <tr>           <th height="22" bgcolor="#CCCCCC" scope="row"><div align="center">Number of Members: </div></th>           <td><div align="center"><?php echo '$companys[members]'; ?></div></td>         </tr>         <tr>           <th height="22" bgcolor="#CCCCCC" scope="row"><div align="center">Profile : </div></th>           <td><textarea name="textarea" cols="20" rows="3"><?php echo '$companys[profile]'; ?></textarea>           </td>         </tr>         <tr>           <th height="22" bgcolor="#CCCCCC" scope="row">Currently Recruiting:           <div align="center"></div></th>           <td><div align="center"><?php echo '$companys[recruiting]'; ?></div></td>         </tr>     </table>       <?php       if($companys[recruting] == 'Yes'){       ?>       <a href="join.php?join=<?php echo "$companys[id]"; ?>" target="mainframe"><u>Join</u></a>         <?php }?>         <?php }?>         <?php }else{ ?>         </div>       </p>       <h1 align="center" class="style2"><u>Company District</u> </h1> <p align="left" class="right">Welcome to the company district.<br> Here you can join or create a company.</p><br> <center>   <table width="66%" border="2" cellpadding="1">     <tr>       <td width="24%" bgcolor="#CCCCCC"><div align="center"><strong>Name</strong></div></td>       <td width="20%" bgcolor="#CCCCCC"><div align="center"><strong>Owner</strong></div></td>       <td width="16%" bgcolor="#CCCCCC"><div align="center"><strong>Type</strong></div></td>       <td width="20%" bgcolor="#CCCCCC"><div align="center"><strong>Members </strong></div></td>       <td width="20%" bgcolor="#CCCCCC"><div align="center"><strong>Recruiting</strong></div></td>     </tr>     <?php     $companyssel = mysql_query("SELECT * FROM `companys` order by `id` asc");     while ($companys = mysql_fetch_array($companyssel)) {     ?>     <tr>       <td><div align="center"><a href=district.php?view=<?php echo"$companys[id]"; ?> target="mainframe"><?php echo "$companys[name]"; ?></a></div></td>       <td><div align="center"><?php echo "$companys[owner]"; ?></div></td>       <td><div align="center"><?php echo "$companys[type]"; ?></div></td>       <td><div align="center"><?php echo "$companys[members]"; ?></div></td>       <td><div align="center"><?php echo "$companys[recruiting]"; ?></div></td>     </tr>     <?php }?>   </table> </center>   <p>     <?php   if($stat[company_status] == 1){   ?>     <br>   </p>   <p>  Your currently in the company <?php echo "$stat[company_name]"; ?>. </p>       <br><br>   <?php } ?>   <?php if($stat[company_status] == 0){ ?> <p>  Your currently not in company.<br><br>   To join a company click on its name or <br>   Click <a href="create.php" target="mainframe"">here to create one. </a> </p> <?php } ?> <?php } ?> [/code] Thank you JJ Ps. Sorry about the large chunk of code i don't know which bit is wrong.
  14. [!--quoteo(post=364962:date=Apr 14 2006, 08:01 PM:name=cartert)--][div class=\'quotetop\']QUOTE(cartert @ Apr 14 2006, 08:01 PM) [snapback]364962[/snapback][/div][div class=\'quotemain\'][!--quotec--] I have very little kowledge of php...but I have some. I am creating a web page for my sisters high school reunion and she wants people to be able to e-mail her directly from the page. I purchased a domain name from godaddy. I have tried using forms to go, but I keep getting an error, and I have copied php script from a site and have gotten the same error message... HTTP 405. If anyone knows how to get a form sent to your e-mail address I would love the help! thanks [/quote] This webpage might help you [a href=\"http://www.phpfreaks.com/quickcode/E-mail-Script/299.php\" target=\"_blank\"]http://www.phpfreaks.com/quickcode/E-mail-Script/299.php[/a] Hope it Helps
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.