Jump to content

tcorbeil

Members
  • Posts

    122
  • Joined

  • Last visited

    Never

Everything posted by tcorbeil

  1. Is it possible to send an array variable like this? $flag['1']= "test"; $flag['2']= "me"; @header("Location: ".$_SERVER['HTTP_REFERER']?flag = $flag); would this work?
  2. Is there a way to do this: <form id="form1" name="form1" method="post" action="<? !validate(); ?>"> so that my function validate is not considered an outside link? ..i have this function defined later in the program.. Thanks. T.
  3. Hi Ken. I did exactly what you mentioned and it still does not echo.. I even tried removing the return command period.. Any other ideas?
  4. I have modified the code to this: if(eregi("/^[a-zA-Z_]+(\w+)*((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/i", $Email)) { return TRUE; echo "1";} I don't see the echo come up even though I know it is valid.. any other suggestions?
  5. Found this code on the site: On a small note to email checking: Recently it is possible to register domains like www.k�che.de This would also mean that the IsEMail() function from "php at easy2sync dot com" would report an email address like "contact@k�che.de" as false. To correct this, use the function below: function IsEMail($e) { if(eregi("^[a-zA-Z0-9]+[_a-zA-Z0-9-]* (\.[_a-z0-9-]+)*@[a-z������0-9]+ (-[a-z������0-9]+)*(\.[a-z������0-9-]+)* (\.[a-z]{2,4})$", $e)) { return TRUE; } return FALSE; } not sure if I'm implementing it correctly.. do i call as such? $Email = dsdfsf@sdsgjg.com IsEMail ($Email); out of the function above, how would I come out with a marker variable such as $verify = It's good or $verify= It's bad... Can anyone clarify? Thanks.
  6. I'm using the following code to look into a table for a duplicate value.. $query="SELECT * FROM UserName WHERE UserName = '$UserName'"; $result=mysql_query($query); $row = mysql_fetch_array($result); // got the data now $filename = $row['refdatabase']; only problem is if there are no matches, I get an error.. i just want to check for duplicate entries and come back with a variable = 1 (yes we have a duplicate) or variable = 0 (no, we don't have a match.) any help would be appreciated.. T.
  7. And another.. I use: if (!@file_get_contents($weblink)){ @header("Location: ".$_SERVER['HTTP_REFERER']); } where $weblink is equal to a website.. this is to validate a weblink.. What would I use to validate an email address? Thanks.
  8. Hello again. Just wondering.. if I have this line: <input name="UserName" type="text" id="UserName" size="45" maxlength="25" /> How do I get a php variable get the value from the HTML variable? Can I do: $var1 = 'UserName'; Any suggestions would be appreciated. T.
  9. Also, I was just recalling that yes, my index page is bare (one google add in the middle).. As I come further along, it will fill up.. please visit the categories to get a better picture of the site.. T.
  10. Thanks for the input Daniel.. to be honest, I want the site to grow using a generic page.. so anytime a category is created, the generic is copied.. as for the ads I figure, the site would be like a page in a book.. reading from left to right.. left is where all subcategories & links are, the middle is ads (hopefully for the site to pay for itself) and the right is any RSS feeds the user enters along with their click (to be honest here as well, I can't think of anything else to fill the site.. ).. Anyway, that is the idea.. I'm listening to any suggestions.. I enjoy the PHP programming along with the whole learning curve of building a website.. T.
  11. It is still being worked on but the base is there.. I am hoping the adds will become more relevant soon.. it's only been a couple of days since it has been running.. I'm new to the webmaster world so be easy on me.. Feel free to try a few things while there.. I'm always looking for improvment.. Tim. www.bookmark-a-link.com
  12. I would AndyB but i think i would confuse myself in trying to explain.. sheesh.. i didn't think this would be so difficult.. I just want to have a variable be equal to the last entry of the submit Id (auto_increment) in my table.. i don't know what else to say but if post code, it will only raise more questions I'm sure.. the only thing I can think is to ask you this: let say you have table with 5 entries in it where the primary colum is an incremtal counter which increases with every entry.. (who care what other colums are in it really...) how would you go about writing code to look at the table get the last counter value and throw that value into a variable?? T. I just want a piece of code to look at the
  13. sorry... I just want to know if someone could kindly have another review of this... T
  14. I tried this.. $submitid = $row['submitid']; echo $submitid; in the effort to get the last entry value issued in my table (If I had 5 entries in the table listed under submitid, i would expect this to be a 5) but all i have echoed to the screen is submitid.. why would this not echo a value of 5? T.
  15. to add, i do understand your post AndyB.. what I don't know how to do is get the value out of the array...
  16. thanks shocker.. i can't use the id idea as it requires me to submit into a table prior.. I need to be able to get the auto_increment id prior to any action.. AndyB, you'll have to forgive me.. I think where I get lost is here: $some_var = $row['whatever_variable_you_want']; // NOW you can run the str_replace ...{/code] you lost me.. is it some_var that gets the value out of the array?? and I also don't understand what to put in for 'whatever_variable_you_want.. would it be like this? $some_var = $row['test']; ...and then i would format the variable $test?? i just don't get it.. can you enlighten me? T.
  17. ... tried it.. got this message: Warning: mysql_insert_id(): supplied argument is not a valid MySQL-Link resource in /home/tcorbeil/public_html/Global/subpost.php on line 41 code is: $query="SELECT submitid FROM subcategories ORDER BY submitid DESC LIMIT 1"; $result=mysql_insert_id($query); $result=ereg_replace("[^[:alnum:]]", "", $result); $result= str_replace("Resourceid", "ID", $result); $mktbl = $result."_".$Subpage;
  18. Basically, all I want to do is look into a table, grab the last index number so i can then use it to make a unique variable: eg: look into table hockey and get the last entry on the idex.. Tabel hockey: submitid NHL team ------------------------------------ 1 Oilers 2 Flames 3 Flyers So in the end, I want to be able to do something like: /// code to get the last entry on of submitid... $index_id now holds the value "3" ...now lets add one to the value.. $index_id = $index_id ++; $some_var = "_Canucks"; $next_entry = $index_id.$some_var; echo $next_entry; ///// should be a value of "4_Canucks" ..I tried your code AndyB, but am not able to make it work.. T.
  19. Can someone please clarify this code? i keep getting the value Resource id#4 no matter what value submit id is.. what i need is to get the last value in the submitid column in my table.. problem is, i can't seem to get the value out of the array $result... any other suggestions? T
  20. thanks fellas. it would seem the variable $result returns something like "id #" ... i would like to get rid of the '#' symbol.. I used: $query="SELECT 'submitid' FROM `subcategories` ORDER BY 'submitid' DESC LIMIT 1"; $result=mysql_query($query); $result=str_replace("_", "#", $result); but it's not working.. what I'm after is something $result = value of id_1_oilers... any ideas?
  21. Hello again. I have this: $query="SELECT 'submitid' FROM `subcategories` ORDER BY 'submitid' DESC LIMIT 1; $result=mysql_query($query); basically, I want to get the last value of the submitid to use elswere.. the above keeps give me a T_Parse error.. Any help would be appreciated.. T.
  22. Well, basically I have a several tables in one database.. data is entered in all of the tables so what I was thinking was to have a one table receive a copy of all entries (no matter which table the entry is destined for..) and use that one table as a "most recent entries" table.. only thing is, I don't want to populate it with more entries than I need.. Any other ideas? T.
  23. Hey everyone. I'm trying to install a ticker on my site that displays the lates 30 entries from a database...how would i go about doing so? Is there a way to have a table only accept 30 entries and bump out one entry as 1 new entry is entered?? Any ideas would be much appreciated. Thanks. T.
  24. Thanks for all your help fellas! It is working like a charm! What would I do without you's! T.
×
×
  • 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.