-
Posts
1,686 -
Joined
-
Last visited
Never
Everything posted by Lamez
-
so in order to take it out of the array, well poop, how do I take it out of the array?
-
Also, where should I put the explode function?
-
How to send sensitive info from one page to another
Lamez replied to mukunthan's topic in PHP Coding Help
Session Variables! -
Could I just use a space in the explode function?
-
sounds like you need to contact Drupal
-
ok in your query take out the {} and replace them with ' ' so like this: $sql="SELECT * FROM `invoices` WHERE `day`= '$day'";
-
when in doubt echo out! echo out $day!
-
wow I might wanna start using require.
-
what is the difference between include and require?
-
I have this script, which madTechie help write. What it does is find the a url in a blob of text, then it checks the database for the link, if it exist it pulls the encrypted link as the id, and makes a link to my ELC. If it does not it makes a new id which is the encrypted link, and it stores it in the DB, and makes a link to the ELC. Well if I post a link beside each other, it comes out as one link. Why? here is a test page: http://links.krazypicks.com/test.php try putting in a single link such as: www.phpfreaks.com. then try putting in multiple links beside each other, such as: www.phpfreaks.com www.google.com Here is the code, can you guys please explain the problem to me? <?php $HTML = $_POST['html']; $result = preg_replace_callback('%\b((?:www\.|http://www\.|http://).*)\b%si', 'UpdateDB', $HTML); echo "<br>Final Output<br>"; echo $result; function UpdateDB($Add) { $id = md5($Add[1]); $url = $Add[1]; //DB Connection... $sql = mysql_query("SELECT * FROM `url_list` WHERE `url`='".$url."'"); if (!mysql_num_rows($sql) >= 1){ mysql_query("INSERT INTO url_list (ID, URL) values ('$id','$url')"); }else{ $r = mysql_fetch_array($sql); $id = $r['id']; } return "<a href=\"http://links.krazypicks.com?url=$id\">Link</a> "; } ?>
-
change <?php $sql="SELECT * FROM `invoices` WHERE `day`={$day}"; while ($req=mysql_fetch_array($query)) { ?> to <?php $sql=mysql_query("SELECT * FROM `invoices` WHERE `day`={$day}"); while ($req=mysql_fetch_array($sql)) { ?>
-
www.servage.net
-
so, what is the problem?
-
no use xampp!
-
use a database, and a custom function. store the id's in the DB, then in the function check for the id, if the same run it again!
-
what do you mean move tables? Like move the data in the database?
-
PHP is server side, in order to view the file on your local machine, you must have php installed. You could upload it to your webserver.
-
TYVM
-
man you are truly a php god!
-
So I used the fix, now in the DB it inserts www., and also out puts phpfreaks.com, why? I am not sure on any of this, or else I would fix it on my own. code: <?php $HTML = $_POST['html']; $result = preg_replace_callback('%\b((?:www\.|http://www\.|http://).*?)\s?%si', 'UpdateDB', $HTML); echo "<br>Final Output<br>"; echo $result; function UpdateDB($Add) { $id = md5($Add[1]); $url = $Add[1]; //DB Con... $sql = mysql_query("SELECT * FROM `url_list` WHERE `url`='".$url."'"); if (!mysql_num_rows($sql) >= 1){ mysql_query("INSERT INTO url_list (ID, URL) values ('$id','$url')"); }else{ $r = mysql_fetch_array($sql); $id = $r['id']; } return "<a href=\"http://links.krazypicks.com?url=$id\">Link</a> "; } ?>
-
omg, I forgot to add the mysql_query, I have no idea why I forgot that. I am having a bit of trouble finding the link in the blob of text. say I put in www.phpfreaks.com it does not pick it up at all, I have to have text before, and after the link. here is the current code: <?php $HTML = $_POST['html']; $result = preg_replace_callback('%\b((?:www\.|http://www\.|http://).*?)\s%si', 'UpdateDB', $HTML); echo "<br>Final Output<br>"; echo $result; function UpdateDB($Add) { $id = md5($Add[1]); $url = $Add[1]; //DB connection $sql = mysql_query("SELECT * FROM `url_log` WHERE `url`='".$url."'"); if (!mysql_num_rows($sql) >= 1){ mysql_query("INSERT INTO url_list (ID, URL) values ('$id','$url')"); } return "<a href=\"http://links.krazypicks.com?url=$id\">KP Link</a> "; } ?> test: http://links.krazypicks.com/test.php
-
try using <?php instead of <?
-
Session Variables!\Cookies! set a session variable once the page is loaded, then check to see if it set, and if it is do not reset the conneciton.
-
no the link to the website that looks at the code for ya!
-
Well I did use that bit of code, but nothing is inserted into the database, and I did add the connection, and changed the table name.