Jump to content

jrg70

Members
  • Posts

    14
  • Joined

  • Last visited

jrg70's Achievements

Apprentice

Apprentice (3/14)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. I'm sorry, how do I also set up the cookie. I thought a session automatically sent a cookie that expired after the browser was closed. the small code that I posted above is basically what I've got with other bells and whistles. BTW this does this in IE or Firefox, so it doesn't appear to be the browser accepting the session cookie.
  2. I'm a little new to PHP, so forgive my ignorance. How would I enable/disable transparent-ids?
  3. Thanks for all the help. That was what I was looking for. I didn't realize that $_GET was an assoc array. Thanks!
  4. I’m having an odd problem that I hope someone can help with. I’m using PHP to display pages. I’m also incorporating a session using the session_start() function. Whenever I go to the site for the first time (create a new session) all the hotlinks on the page are appended with “PHPSESSID=0fdc5fb9c9f45337309b22dc0bc846fc”. Once the page is refreshed or you load another page, it goes away and all the links are “normal”. I’m not doing anything that I have not done before, without this problem. I created a small test page to see if other code was causing this and the problem remained. ><script language="php"> session_start(); echo "<a href=\"index.php\">Home Page</a>"; </script> the link ends up being "index.php?PHPSESSID=0fdc5fb9c9f45337309b22dc0bc846fc" This leads me to believe there is some sort of server setting I need to adjust. All the links are still functional, it is just messy and I'd like to get rid of it. Any help is appreciated. Thanks.
  5. Thanks for another reply. I think that may work, but how do I actually get the url from the page I'm working on. Meaning. The url will be dynamicaly generated by what the user may select from the page before. I need to get the url that is currently being displayed. I hope you understand what I'm asking, or am I talking in circles.
  6. The problem with $_GET[varname] is that you have to know the varname you're looking for. Is there no way of actually getting the information that is in the url box on the browser?
  7. I’m writing page hits to a log file and I need to know the variables that are passed along with the actual php page or the results written to log file are useless. $_SERVER['PHP_SELF'] gives me the name of the file executing the script (index.php or this_page.php), but not the accompanying variables. Is there a way to give me the variables passed through the url as well? (For example: www.example.com/index.php?var=test) I would like to get the “?var=test” information.
  8. Hello all. I would like to know if there is a way to get the auto increment number from a row that is just created. Here's the senario: I'm using PHP to display a page and have the user input some information. Then I have the PHP code 'INSERT' that data into a new row that is created dynamically. Each row that is created is given a unique id number by auto increment. The number is placed into the field 'id'. What I want to get is after the information is inputted into the database, have the newly created "id number" returned so I can have the page show the inputted data. Do you understand my question, or did I ramble? Anyway, if you do understand and can help, I sure would appreciate it. Thank you.
  9. Thanks for all the responses and help. I'm just starting out and this all helps. Thanks
  10. Thank you! That is exactly what I'm looking for. I didn't realize that you had to make the $var_03 global. I can now see the light. It looks like you put the comment on the code //Why is this here?. I put that there just to test if $var_03 had a value from within the function, which it did. Seriously, thank you. I knew this had to be something basic.
  11. Thanks for the reply. But what I am not understanding is just what the "return" statement in front of the variable is doing. I would think that by placing that there it tells PHP to return that value to the caller and exit the function. It does exit the function, but the value does not seem to be returned. This is obviously just a test function. I would like to create functions that would be very useful in my scripts, that would return values.
  12. Hello all, I'm new to PHP scripting and I have a pretty basic question about returning a variable from within a user defined funciton. My question is: How do I do it? I've read through the PHP manual about returning values, but I can't seem to figure it out. As I said, I'm not a very knowledgable programmer, so I can't figure this out. Here is a basic script I've written with a funciton. ><script language="php"> // declare the function function test_function($var_01, $var_02) { $var_03 = $var_01 + $var_02; echo "$var_01 + $var_02 = $var_03 <br>"; return $var_03; } // declare starting variables $var_01=5; $var_02=6; // run the function test_function($var_01, $var_02); // this will output: 5 + 6 = 11 // output variable values echo "var_01 is: $var_01 <br>"; echo "var_02 is: $var_02 <br>"; echo "var_03 is: $var_03 <br>"; // this does not get output // Why is this variable not returned from the function? </script> How do I run the function and then have it return the value of $var_03? $var_03 is a valid variable from within the funciton, as it's value is output as 11. What am I doing wrong? Thanks, and please go easy on me
  13. Thanks for the replies. Since I already have the email account set up and in use, I guess I will just delete it. I can always create it again if I need to. There is a vast amount on these forums. Thanks again!
  14. I've set up an email forwarder. It works fine, and all the mail being sent to the original is now also delivered to my gmail account. The question I have is: Can I set up for the forwarded email to not go to the original email also, and only the forwarded? mail sent to me@mydomain is delivered to me@mydomain and me@gmail.com. I want mail sent to me@mydomain to go to me@gmail.com only. Not to the mydomain address. The reason for this is so when I forward mail I don't have to sort through it twice. Thank you. I'm new to the forum, I hope I've put this question in the right place.
×
×
  • Create New...