Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by glassgorilla

  1. Thanks, Bruce. That makes me feel a little bit better. I sit in front of a computer 8 hours a day but I just always feel so awkward at the TCH forums. Keep up the great work that you guys do! Regards, Panda PS -- If I recall correctly, didn't you used to make apps for pdas or something like that? I like the server side aspect of using wireless devices, but obviously there is probably a much larger markey for downloadable things and clientside programs and I am hoping I can make a client side app in the (semi) near future.
  2. Thank you Sorry for being an annoyance -- never post in the right spot and I seem to ask dumb questions. I'll just open a ticket from now on Again, thanks and sorry, Panda
  3. The other Server 43 threads (from scsi failure) have been closed, so I'm starting a new thread here. I have a wireless device e-mail script so that e-mail can be read on the go from cell phones /pdas / whatever. Well, I uploaded an update to the script and it no longer works. PHP gives me an undefined function fatal error for the imap_* functions. What happened to them? Does this have something to do with last night or something else that I'm not aware of? The previous version(s) of course don't work either. From phpinfo() I see that there is no '--with-imap-blahblah' configure command but that one of apache's loaded modules is 'mod_imap'. Apache is.. uh.. far from my expertise so I don't know exactly what that means. So, basically, my question is where did my imap_* functions go? They were like family to me I imagine I'm just going to get told to open a help desk ticket but I thought I'd give it a shot and see if imap_* support was removed for some reason before I bothered the boys at the help desk. Thanks, Panda
  4. I absolutely refuse to use anything that I haven't completely written! But thank you. That script DID show me what I was doing wrong. The default port is 143 for IMAP and I was using '143"'. Alllll of that over one extra double quotes. I must have had it in double quotes and then decided to change it to single quotes but forgot to erase the second set of double quotes. I suppose it should be an integer anyway, not any kind of string. Anyway, thanks again.
  5. Can anyone tell me how the heck I can make my own e-mail script with PHP? You know, like squirrelmail or whatever else. I want to make my own so that I can check my mail from my cell phone. The script needs to abide by the XHTML 1.0 Strict guidelines which is why I need to make my own. Really, the only thing I can't do is connect and get a list of e-mails. Once I can do that, I will be good to go. Also, now that I'm thinking about it, is there a way that receiving an e-mail could trigger a script? It would be nice to automatically have something happen when an e-mail is received instead of doing a continuous cron job to check for new messages.
  6. I didn't give the whole template thing a deep look but it looks as though squirrelmail does use templates, but the templates are just a list of variables of colors and such, so I imagine the app code is fairly intertwined with the presentational code. I guess more properly squirrelmail seems to use themes rather than templates. I did install it, however. I don't think I would have been able to do it, but on this forum there is a very helpful (and recent I believe) tutorial on installing it. Some of the variables I never would have gotten correct in a million years, such as $imap_server_type = 'uw'.. Anyway, thanks for the helpful nudges, I would have given up a long time ago if it didn't involve letting you down I guess it's on to chopping this bad boy up so it's WAP compatible. Thanks again.
  7. I do mean things such as cell phones and PDAs. I'm not sure what you mean by "change anything in the server". All I would need to change (or at least I don't see why I would need to change anything else) is the display files for the mail, such as (making these up) inbox.php and read_message.php (I guess that's what you mean by "layout of the served pages"... you're just using smart people talk). But as you said, I can't change the one installed at the server level and I don't know the information that I would need to enter into the config file if I tried to install it myself. And for the record, I don't care if it's squirrelmail or not, but of the three that are serverinstalled, that seems to be the plainest. I think getting rid of all the unnecessary html and the formatting html and just displaying the actual text would be much easier through that. I suppose I will try to install squirrelmail. I guess it probably can't be that hard. I wrote a private messaging system for wireless devices and it is basically the same thing as e-mail except it's just short messages stored in mysql. I wrote it as an alternative to Sprint's shortmail. I figured if my text messages have to be web-based, might as well make a good webbased messaging system. But that's another story...
  8. I am trying to be able to get webmail viewable from wireless devices. Is there any way I can edit squirrelmail files to allow this? Or is this something that is shared or something and cannot be edited? I downloaded squirrelmail from sourceforge and haven't looked too deeply into it but I do recognize that is it probably out of my league to try to install it to my domain. I could write my own script (I think) because I just want a simple, simple script that can show me mails and maybe send them, but I don't have any clue as to how to use IMAP. Can anyone tell me if I can modify squirrelmail files to be wireless friendly or what imap configurations need to be done? Thanks.
  9. try changing this: >$fp = fopen( "notes/data/names.txt", "w" ); to this: >$fp = fopen( "./notes/data/names.txt", "w" );
  10. alright.. topic title may be a little misleading and i'm not exactly sure where to post this question, so here goes: does cpanel give you a way to view stats (anything, a pretty html page, a raw log, anything..) mails sent (specifically by using the mail() function in php). it doesn't have to be through cpanel, either. just any way to access this kind of information? or is this something that is not really kept track of. if there is nothing, i can write a script that will log the information i need but i was just hoping that something like that is already implemented. thanks.
  11. oh, i see. when it checks to make sure all the fields are filled in, it sets them to true. true is the same thing as '1'. the "youremail" variable is not sent through the form, never checked and set to true or false, which is why it was sending you mail instead of mail to the email address "1" so for example: >if (strlen($_POST['name']) > 0) { $name = TRUE; } else { $name = FALSE; echo '<p>You forgot to enter your name!</p>'; } this sets "$name" to true (1), which why in your email, "$name" appears as one. you will just have to use different variables at the beginning. put these four lines under the if(isset(etc...) // handle the form line. >if (isset($_POST['submit'])) { // Handle the form. $name2 = $_POST['name']; $email2 = $_POST['email']; $subject2 = $_POST['subject']; $comments2 = $_POST['comments']; and then change your mail code to this: >if ($name && $email && $subject && $comments) { // If everything's okay. // Register the user. $youremail = "kevin@lectric.com"; $subjectline = "New Comments from $name2"; $letter = "User $name2 sent you these comments:\n\n$subject2\n\n$comments2"; $headers = "From: $name2 <$email2>\n"; if(mail($youremail, $subjectline, $letter, $headers)){ echo '<p>Thanks You for your email. I will reply as soon as possible.</p>'; } else { echo '<p>There was an error sending the email.</p>'; } } else { // Something's not TRUE. echo '<p>Please go back and try again.</p>'; }
  12. the problem is not with the email part. if you echo the variables to the page, you will see this: >Thanks You for your email. I will reply as soon as possible. kevin@lectric.com, New Comments from 1, User 1 sent you these comments: 1, From: 1 <1> i'm still looking at the code to see why everything would be a 1.
  13. >if ($name && $email && $subject && $comments) { // If everything's okay. // Register the user. echo '<p>Thanks You for your email. I will reply as soon as possible.</p>'; } else { // Something's not TRUE. echo '<p>Please go back and try again.</p>'; } where it says //Register the user is where it was successful. so i'm assuming it would go there. >if ($name && $email && $subject && $comments) { // If everything's okay. // Register the user. $youremail = "youremail@******"; $subjectline = "New Comments from $name"; $letter = "User $subject sent you these comments:\n\n$comments"; $headers = "From: $name <$email>\n"; if(mail($youremail, $subjectline, $letter, $headers)){ echo '<p>Thanks You for your email. I will reply as soon as possible.</p>'; } else { echo '<p>There was an error sending the email.</p>'; } } else { // Something's not TRUE. echo '<p>Please go back and try again.</p>'; }
  14. chown changes the user. i have never gotten it to work and i don't know what php runs as on tch, i think it's usually 'nobody' though. but php might not be able to change the owner because it isn't the owner in the first place. from manual:
  15. Well, as interesting as your addiction to marijuana is, I think you should stick to talking about TCH, the wonderful web hosting company I make that typo all the time too
  16. Thanks. Initializing the posted variables worked. I may be reinventing the wheel, but I think the intent of the script is a bit different than you think it is (or it may not be). On the form, the person enters the username of someone and a message and it sends them a private message. Privatechat.php has the mysql database variables and opens the connection. string propersn (string $sn) returns $sn without spaces and all lowercase for comparative purposes, i.e. logging in as 'HaR R Y' is the same as 'h Arry'. On any given page, there is a bool newpm($sn) function that checks to see if any messages have sentto = $sn and readyet = 0, and if returned true, a link to view your private message inbox is displayed. >function sendpm($to, $msg, $from) { require ('/home/glassgo/offline/privatechat.php'); $go = time(); $to = propersn($to); $from = propersn($from); $chatquery = "insert into $dbtabl (sentfrom, sentto, sentwhen, message, readyet) values ('$from','$to','$go','$msg','0')"; $chatreturn= mysql_query($chatquery,$link); mysql_close ($link); return $chatreturn; } Anyway, thanks for your help. I hope I didn't reinvent the wheel cause it took a long time to throw all these pages together. It's especially tough to get wireless browsers to accept it! They are the most uninformative browsers ever and just about everything is improper syntax when it comes to them. One last thing, what do you think I'm reinventing? It may be useful / prettier / easier etc to kill my code and replace it with whatever already exists.
  17. well, what you entered above works for me so i can't help you there.. as for how else to hide it.. i don't really know what you're doing but it looks like some kind of e-mail form or something. if you submit the form to a php page, you could have the form be something like this: theform.html ><form method="post" action="emailme.php"> From: <input type="text" maxlength="15" name="whofrom" value="JoeSchmoe" /> <br /> Comment: <input type="text" maxlength="100" name="thecomment" value="Cool site!" /> <br /> <input type="submit" value="send" /> </form> emailme.php: ><? require('/home/username/safe/myemail.php'); if(mail($myemail, "Comment from $whofrom", "$whofrom said: \n\n $thecomment")){ echo 'Message sent!'; } else{ echo 'Error! Message not sent!'; } ?> the following would be placed somewhere not in the public_html folder (in this case, in a folder called 'safe' which is NOT in your public_html folder) so no one can access it from the web. this may be much too drastic security measures for your purposes, so you could put the one line here in place of the require line above. however, if you do it this way, no one can access it from the web, only you and your webserver can get it. myemail.php: >$myemail = 'me@mysite.com'; this way your email never shows up in any source code, not even as ascii characters or in a hidden input (which is visible in the source of the page) or where ever else. the client never receives the address. of course, like i said, i don't even know what your purposes are, but whatever it is, if it's a form, it can be done that way. and even if it's not a form, you can probably morph the code so it works how you need it to.
  18. hoping some night owl will be able to see something i can't. basically you load a page i.e. page.php, it brings in the code from pmform.php (below) via a require call. when you submit it goes to page.php?step=1 here is the relevant part of page.php. this is where step=1, i.e. they have just submitted the form. >$bad = "true"; if($message == '' || $sendto == '') { echo 'No fields may be left blank.'; } else { if(!checkexist($sendto)) { echo 'That user does not exist. Check the name and try again.'; } else { if (sendpm($sendto, $message, $username)) { echo 'Message has been delivered!'; $bad = "false"; } else { echo 'An error occurred. Message not sent. Please try again in a few minutes.'; } } } if($bad == "true") { echo '<br/>'; require('pmform.php'); } here is pmform.php: ><form method="post" action="url/page.php?step=1"> To: <input title="To" size="10" maxlength="10" name="sendto" value="<?=$sendto?>" /> <br /> Message: <input title="Message" maxlength="255" value="<?=$message?>" name="message" /> <br /> <input type="submit" value="Send" /> </form> $sendto and $message are not necessarily set, so when they aren't, it's just a blank form. however if $bad = true, i.e. something went wrong, it loads the form into the page again but $message and $sendto ARE set because the user just submitted it, it just had something wrong with it. my problem is that no matter what, $sendto is always blank. $message is coming through fine but i am getting the "No fields may be blank" error every time and the form fills out the sendto field as blank and the message field with the message. When i took out the blankfield check, it came up with that the user did not exist. this was working fine a bit ago and i must have changed something cause now it won't work. can anyone see something i can't?
  19. yes, the manual does have lots of errors. i actually just posted a note tonight on one of the pages that has an error. actually, it happens to be an array function too.. maybe the array guy was hammered when he wrote all those pages
  20. I don't know if it specifically works about the random html generator, but it can be easily done in php with ease.. 1. rename whatever file this is happening on to have a .php extension (i.e. index.html -> index.php) 2. put this where you want the image map to appear: ><? include ('randommap.php'); ?> 3. create a text file called randommap.php 4. make the text of the file this: ><? $imgmap = rand(1,3); if($imgmap == 1) { ?> //the code of your first map here <img src="http://lightsphere.com/dev/ismaps/cube.gif" alt="" usemap="#cube"> <map name="cube"> <area shape="rect" coords="1,1,37,37" href="http://www.google.com"> <area shape="rect" coords="37,1,74,37" href="http://www.yahoo.com"> <area shape="rect" coords="1,37,37,74" href="http://www.nfl.com"> <area shape="rect" coords="37,37,74,74" href="http://www.totalchoicehosting.com"> </map> <? } if($imgmap == 2) { ?> //the code of your second map here <? } if($imgmap == 3) { ?> //the code to your third map here <? } ?> 5. upload it to the same directory... now you could have the above in the file you want this map to appear, but it may get a little messy to look at which is why i would put it in the randommap.php file 6. if this map appears on several pages, all you have to do is put the first snippet (the include('randommap.php') snippet) on any page at the place you want the map to appear. 7. the rand(1,3) line can be changed so you can add as many maps as you have. this example would have three...
  21. Well, don't break the internet and blame me , but mine is this: >domain.ext: domain.ext sub.domain.ext: sub2.domain.ext: sub3.domain.ext: subetc.domain.ext: basically what you said minus the mail in front. but i don't know if this is applicable to all domains, or what, but that's how mine is.
  22. If you are getting the same message for line 25 and also a mysql_fetch_array error towards the bottom of admin.php (above the footer), and the message when you login says something like "You have a total of members, of which are approved" (instead of having numbers, i.e. "You have a total of 50 members, 30 of which are approved"), then your table was probably never created, or the table you did create does not match the name given in config.php That's all phpfanbase v 2.1, if you have a different version then this may not apply..
  23. .wbmp files do not show properly. I can't find any method of getting them to show. Code I wrote that I used at another host that used to work (and show .wbmp images) no longer do. I (think) I read somewhere that if Apache is older than 1.3.9(?.. whatever it was, according to phpinfo(), TCH's version is older than what I read said it had to be), you must add the MIME to the srm.conf file. I was just wondering if TCH has these types added and I'm doing something wrong, or if they don't need to be added, or whatever the case may be. The types: AddType text/vnd.wap.wml .wml AddType image/vnd.wap.wbmp .wbmp AddType application/vnd.wap.wmlc .wmlc AddType text/vnd.wap.wmlscript .wmls AddType application/vnd.wap.wmlscriptc .wmlsc I fooled around with sending headers via php first to see if it had any effect, but it didn't. I also tried messing around with the .htaccess, but I thought that if the type didn't exist in srm.conf that htaccess wouldn't do anything to change the situation. If anyone knows a way to get .wbmp images to show on a WAP browser, please let me know. HTTP Server MIME Types This is the site where I got what to add in the addtype section, but it's not the same site that mentioned that apache's version matters.
  • Create New...