Jump to content

Heero

Members
  • Posts

    50
  • Joined

  • Last visited

    Never

Everything posted by Heero

  1. Hey all, This seems to simple, but I can't seem to figure out how to do it. Say for sample I have this code: $string = "\"Dr\"" Now if I echoed that I would get "Dr". Now say that I want that exact same variable set to that value, but now I want it to print just Dr. Is there a function I can apply which will remove the doubles quotes?
  2. I am not sure what you really want... You had asked how to make a link to the activation...so you already know how to do that? Now you want to make a script that actually activates an account?
  3. Anyone have any ideas?
  4. I finally figured out what was wrong...really dumb. PHP 5.0.2 has the short tag configuration on the php.ini turned off by default. So in my phpinfo.php file I had the following code: <? phpinfo(); ?> It was not running this code, thus I automatically assumed that the Apache sever was not reading php files. Stupid me.
  5. There is a program called Dataface which you can setup as a CMS. It uses tables. Here is the link: http://fas.sfu.ca/dataface
  6. The third parameter of the mail function is where you specify your message body. Just include html code in that message body. So if you want to like have an activation link, you have should some code like: <a href="activation.php">Click here to activate</a>
  7. WHy don't you just have an http link from your message? Also store your message body in a variable. That is hard to read.
  8. Well you could sent up a form that your user submits and your program will receive all the form input and do it's thing to update the website.
  9. Hi all, I was using the preg_match function like this: echo preg_match("//i", "\"Yes\""); And this turns out to return 1 indicating that there is a match...but it's not what I want. If the string is empty then it shouldn't be returning true for a match with the string Yes.. I was wondering whether there were any other modifiers like the /i modifier that could solve this problem? I could use an if statement to first check if the string was empty, but that seems pointless. Any suggestions?
  10. AHh I am using Windows...that's why it wouldn't work. I'll have to specify a partition for it. thanks!
  11. Hi, Currently my session.save_path in my php.ini file is set to: /tmp I was just wondering what exactly is it relative to? Because I can't seem to find the file.
  12. Ok yeah...php can't find the .ini file because it it saying C:\WINDOWS... But as soon as I put my php.ini file in there, it causes apache to not read php pages anymore...am I putting it in the wrong location or something?
  13. Hi, I am really bummed on this one issue with my php.ini file. When I place a php.ini file in the C:/windows directory it causes my apache server to be unable to read php files...however as soon as I remove the php.ini file the apache server can again read php files. I am completely shocked with what is going on...additionally running the code phpinfo() when the php.ini file does not exist in the directory results in it saying that the Configuration File (php.ini) Path is C:\WINDOWS...even though the file doesn't even exist! Can anyone help me here?
  14. You form method is set to post and you are using the global variables GET which has nothing them. Either set the form method to post, or use the POST global variables.
  15. Hi all, I am having troubling understanding something with the tempnam function. Given this code: <?php $tmpfname = tempnam("/tmp", "FOO"); $handle = fopen($tmpfname, "w"); fwrite($handle, "writing to tempfile"); fclose($handle); // do here something unlink($tmpfname); ?> I expected the code to create an unique file name in the /tmp directory (this directory already exists) of the current location of my file running it. However, the code produced a file in the location C:\WINDOWS\FOOB5.tmp. Which is apparently where my "system's temporary directory" is...I was looking at the phpinfo() results and I couldn't find any reference to this system temporary directory. Could someone enlighten me on why it is placing the unique file in the system temporary directory and not the /tmp directory?
  16. And cookies can be turned off by the client which efficiently makes it impossible to stay logged in since the cookie would never exist. What spamoom said about sessions is probably your best bet, but you'll have to check that sessions are enabled (which they should be by default anyways). When using sessions always remember to have the session_start() at the top of each page that uses the session or else you won't be able to call any session variables. People always forget this.
  17. And was I wrong about what I said? PHP works on the server not the client side so to do something with it you have to send and retrieve data from the server. If want it to refresh immediately and not sent something to the server then PHP is not your choice. What you were seeing everywhere else was probably AJAX. Is that a BETTER answer for you?
  18. PHP actually comes with a bunch of functions to modify dates. You shouldn't have to do any splitting into array. You might want to refer to the PHP manual about date.
  19. Hello, I am not entirely sure what you are trying to do, but you want to be able to sort a list of items based on the chosen value? If that is the case, you can't do it instantly because you would have to resubmit the form (at least that's what I think...I haven't touched PHP in like 2 years).
  20. Hi, Been a while since I've touched PHP, but I was looking some code and I don't understand this one line and I can't seem to find any references on it: $qty = $_POST['qty_'.$i] ? $_POST['qty_'.$i] : 0; What is the ? and : do
  21. I think you are misreading my post....
  22. Hi All, I am making some BBcode for my CMS and I've run into an interesting issue. I allow the users to make lists and stuff and when they click on the list button, basically it prompts them for list items and they keep entering until they press cancel. And then the list BBcode apears in the textarea. I've used the javascript code "\n" to make the list items appear on different rows. So an example would be: [CODE] [*list] [*]item 1 [*]item 2 /*list] [/CODE] Note: I've added the * because the BBcode on this form converts it to a <ul> tag. All fine and dandy. The problem is I use the PHP code nl2br to convert \n into <br> so that when users are typing in content we may allow them to keep paragraphs. So the problem becomes clear now. When outputting the list code, I get this code: [CODE] <ul><br /> <li>item 1</li><br /> <li>item 2</li><br /> </ul> [/CODE] Which is not what I want....any suggestions on how to avoid this?
  23. Hi all, I've noticed when I run the htmlentities function on chinese text it causes it to come out all jumbled out.  Is there a way to avoid this? Thanks
  24. Oh okay...just curious...why would I even set a folder to full permissions if I won't anything in it?
×
×
  • 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.