Jump to content

FirstBorn

Members
  • Posts

    12
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

FirstBorn's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. How to Search Records in Table and Replace Characters? Hi, Thank you Very Much for your help! How do I search records in a table for specific quote character and replace it with a different quote character. (Windows / Website Compatible Font?) I know the basic SQL commands; SELECT * FROM `table` WHERE `body` ... blah blah blah, But how do I search inside the text record for: “ and replace them with this: " AND ” replace with: " AND ’ replace with: ' ? Thank You VERY MUCH for Your Help! FirstBorn
  2. Hi, Thank you for your help. I have a script that I'm running that is supposed to generate a random 16 character number (can be changed,) but the results when going to print it display nothing. <?php function generate_passwd($length = 16) { static $chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ23456789'; $chars_len = strlen($chars); for ($i = 0; $i < $length; $i++) $password .= $chars[mt_rand(0, $chars_len - 1)]; return $password; } ?> What am I missing here? Thank you very much for your help. Thanks, FirstBorn
  3. Hi Mchl, Thanks for your help. I actually did a phpinfo(); and noticed that 4.xx was running for some reason... I went into the CPanel into the php configuration, and changed it BACK to 5 and that fixed the issue... I have no clue as to why it swapped backwards to 4 and the webhost said that nobody has touched the server in 14 days... Weird, VERY Weird, but it's currently fixed... Again, thank you VERY much for your help! Thanks, FirstBorn
  4. Hi Mchl, Thanks for explaining. k, I have My php.ini file from the webhost and the .dll file is commented out... Of course, 'cause it's on a linux server. So, I've looked through the document that you provided and can't find anything else that might be conflicting. But, then again, I'm no php.ini "expert" :-\ Any Ideas? Thanks, FirstBorn
  5. Hi Mchl, Thank you for your reply. k, I'll go through the comments on that page, but why is the script all of a sudden just crapping out and not working after it HAS been working for over a month? Any ideas? Thanks, FirstBorn
  6. Hi, Thanks for reading. I have been using an rss-feed reader script for quite a while now, but all of a sudden, it started crapping out on Me... I made NO changes to this script and have not even changed anything to the code that accesses this script, so I have no clue as to why this is happening. Any ideas as to why this is happening all of a sudden and how to fix it? I'll include the code below. Thank you VERY MUCH for your help! Thanks, FirstBorn Here is the Error: ******************************* ----------------------- rsslib.php ----------------------- <?php /* RSS Extractor and Displayer (c) 2007 Scriptol.com - Licence Mozilla 1.1. rsslib.php Requirements: - PHP 5. - A RSS feed. Using the library: Insert this code into the page that displays the RSS feed: <?php require_once("rsslib.php"); echo RSS_Display("http://www.xul.fr/rss.xml", 25); ?> */ $RSS_Content = array(); function RSS_Tags($item, $type) { $y = array(); $tnl = $item->getElementsByTagName("title"); $tnl = $tnl->item(0); $title = $tnl->firstChild->data; $tnl = $item->getElementsByTagName("link"); $tnl = $tnl->item(0); $link = $tnl->firstChild->data; $tnl = $item->getElementsByTagName("description"); $tnl = $tnl->item(0); $description = $tnl->firstChild->data; $y["title"] = $title; $y["link"] = $link; $y["description"] = $description; $y["type"] = $type; return $y; } function RSS_Channel($channel) { global $RSS_Content; $items = $channel->getElementsByTagName("item"); // Processing channel $y = RSS_Tags($channel, 0); // get description of channel, type 0 array_push($RSS_Content, $y); // Processing articles foreach($items as $item) { $y = RSS_Tags($item, 1); // get description of article, type 1 array_push($RSS_Content, $y); } } function RSS_Retrieve($url) { global $RSS_Content; $doc = new DOMDocument(); $doc->load($url); $channels = $doc->getElementsByTagName("channel"); $RSS_Content = array(); foreach($channels as $channel) { RSS_Channel($channel); } } function RSS_RetrieveLinks($url) { global $RSS_Content; $doc = new DOMDocument(); $doc->load($url); $channels = $doc->getElementsByTagName("channel"); $RSS_Content = array(); foreach($channels as $channel) { $items = $channel->getElementsByTagName("item"); foreach($items as $item) { $y = RSS_Tags($item, 1); // get description of article, type 1 array_push($RSS_Content, $y); } } } function RSS_Links($url, $size) { global $RSS_Content; $page = "<ul>"; RSS_RetrieveLinks($url); if($size > 0) $recents = array_slice($RSS_Content, 0, $size); foreach($recents as $article) { $type = $article["type"]; if($type == 0) continue; $title = $article["title"]; $link = $article["link"]; $page .= "<li><a href=\"$link\">$title</a></li>\n"; } $page .="</ul>\n"; return $page; } function RSS_Display($url, $size) { global $RSS_Content; $opened = false; $page = ""; RSS_Retrieve($url); if($size > 0) $recents = array_slice($RSS_Content, 0, $size); foreach($recents as $article) { $type = $article["type"]; if($type == 0) { if($opened == true) { $page .="</ul>\n"; $opened = false; } $page .="<b>"; } else { if($opened == false) { $page .= "<ul>\n"; $opened = true; } } $title = $article["title"]; $link = $article["link"]; $description = $article["description"]; // $page .= "<li><a href=\"$link\">$title</a>"; $page .= "<li><a href=\"$link\" target=\"_blank\">$title</a>"; if($description != false) { $page .= "<br>$description"; } $page .= "</li>\n"; if($type==0) { $page .="</b><br />"; } } if($opened == true) { $page .="</ul>\n"; } return $page."\n"; } ?>
  7. Hello Everyone! Thank you ALL for replying. First, Why was this moved to AJAX? I want to use php and html... I'm not familiar with AJAX... k, basically, to try to make this less confusing, the form action code needs to go to a different script on a different server to collect the name and email address to add the visitor to an "announcement list." Problem is, I want to be able to grab that info (the name and email address) and send it to MY inbox BEFORE the info is sent to the other server's script. That means, basically the goal: 1. Data is collected (name and email) 2. Data sent to My Inbox 3. Data then sent to script on different server 4. Procedure complete... So, I guess that I would have to collect the data, send it to My Inbox and, I guess, resubmit the form (with the form's data) via code to the script on different server. How would I go about doing this? Thanks, Christopher
  8. Hi, Thank you for reading and for helping. Can a 'form action' code execute more than one action? Here's what I'm looking to do; A form on one of My sites has a spot where someone enters their name and email address. This info goes to the Email List Software script. I would also like for that data to be sent to My email inbox. I know the mailto: code and how to collect the info ex. <?php if(isset($_post["submit"])) { $name = $_post['name']; $email = $_post['email']; $mailto = "me@mysite.com"; $mailsubj = "New Form Submission"; $mailbody = "$name has submitted info on your form with $email as their email address"; $mailhead = "Headers Go Here!"; mail($mailto, $mailsubj, $mailbody, $mailhead); } Else { ?> <?php // All code of page goes above if not submitted form, // else, execute this the php code at the top and end // here! } ?> The issue here is that the form action code goes to a different server on a different script, so I am able to collect the info on My site, but can't execute it to a script on MY site on the same form action code. Or can I? Here's an example of what I have: <form method="post" action="http://scripts.webhost.com/add_list.cgi"> <input type="hidden" name="list" value="FromEmailAddress" /> <input type="hidden" name="domain" value="DomainName" /> <input type="hidden" name="url" value="SubscribedURL" /> <input type="hidden" name="unsuburl" value="UnsubscribedURL" /> <input type="hidden" name="alreadyonurl" value="AlreadyOnURL" /> <input type="hidden" name="notonurl" value="NotOnURL" /> <input type="hidden" name="invalidurl" value="InvalidURL" /> <input type="hidden" name="emailconfirmurl" value="EmailConfirmURL" /> <input type="hidden" name="emailit" value="1" /> Name: <input name="name" /> E-mail: <input name="email" /><br /> <input type="submit" name="submit" value="Join Our Announcement List" /> <input type="submit" name="unsub" value="Unsubscribe" /> </form> Any ideas to be able to submit the code to the other server AND also collect the data and send it to MY inbox via MY script? Thank you VERY MUCH in advance for your help! Thanks, Christopher
  9. Hi Aaron, Found it, Thanks... Was on the bottom of the page and nearly out of sight... Have an Excellent New Year! Thanks, Christopher
  10. Dear Aaron, Thank you VERY MUCH!!! That worked! How do I get this Thread marked as 'resolved?' Thanks, Christopher
  11. Hi, Thank you for reading. I have a php script that I'm using that has been used before on a different site, but now, when attempting to use the following code, it is not displaying the data that I expect for it to. <?php // connecttodb($servername,$dbname,$dbuser,$dbpassword) $query="SELECT * FROM directory WHERE active='1' AND location='L' AND type='paid' ORDER BY sortorder ASC"; $result = mysql_query ($query) or die(mysql_error()); $num=mysql_num_rows($result); // mysql_close(); $id=mysql_result($result,$i,"id"); $title=mysql_result($result,$i,"title"); $url=mysql_result($result,$i,"url"); $sortorder=mysql_result($result,$i,"sortorder"); $type=mysql_result($result,$i,"type"); $location=mysql_result($result,$i,"location"); $class=mysql_result($result,$i,"class"); $active=mysql_result($result,$i,"active"); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "<b>$class<br><a href=\"$url\">$title</a><hr>"; } mysql_free_result($result); mysql_close(); ?> The above displays 1 record when there should be 2. The code below displays 12 rows of the same record when there should be 12 different records displayed: <p><h3>Available</h3><hr> <?php connecttodb($servername,$dbname,$dbuser,$dbpassword); $query="SELECT * FROM directory WHERE active='1' AND location='L' AND type='order' ORDER BY sortorder ASC"; // $result=mysql_query($query); $result = mysql_query ($query) or die(mysql_error()); $num=mysql_num_rows($result); $id=mysql_result($result,$i,"id"); $title=mysql_result($result,$i,"title"); $url=mysql_result($result,$i,"url"); $sortorder=mysql_result($result,$i,"sortorder"); $type=mysql_result($result,$i,"type"); $location=mysql_result($result,$i,"location"); $class=mysql_result($result,$i,"class"); $active=mysql_result($result,$i,"active"); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "<b>$class<br><a href=\"$url\">$title</a><br>"; } mysql_close(); ?> So, I'm guessing that either: a. The "while" statement is in the wrong place (of which, I don't think so because this is how it is used on a different site) OR b. There is nothing to count and then display the next record, but, again, (I don't think so because this is how it is used on a different site) So, what am I missing here? Any Ideas? Thank you in advance for your help. Thanks, FirstBorn MySQL Ver: 5.0.51a-community phpMyAdmin: 2.11.9.1 MySQL client version: 4.1.22
  12. Hi, Thank you for reading. I'm using the form submit code Code: <?php print $_SERVER["PHP_SELF"]; ?> and it does not work for some reason... Here is sample code for what I'm using: <?php if($_POST["submit"]) { echo "Submit!"; } else { ?> <html> <head><title>Test Submit</title> </head> <body> <form action="<?php print $_SERVER["PHP_SELF"]; ?>" method="post"> <INPUT TYPE="submit" value="submit"> <input type="reset" value="Reset"> </FORM> <!-- form code ends here! --> </body> </html> <?php } ?> Why is this not working? What I mean by 'not working' is that when you press the button, it seems to reload the page and doesn't seem to count the button click as a 'submit' at all... Any Ideas? Thank you for your help! Thanks, FirstBorn PS. I've used two different webservers / hosts to test this out on, and this script works on NEITHER of them. (Dreamhost and HostGator Servers...) Thanks.
×
×
  • 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.