Jump to content

siric

Members
  • Posts

    116
  • Joined

  • Last visited

Everything posted by siric

  1. siric

    Ad Manager?

    Try OpenX http://www.openx.org/
  2. Have a look at this thread. http://www.phpfreaks.com/forums/index.php/topic,296528.msg1404407.html#msg1404407
  3. I would recommend using a Content Management System (CMS). This will give you the framework and you can build your own pages, etc to suit. Joomla is good but in my option a bit too complex esp. to the beginner. I use PHP Fusion (www.php-fusion.co.uk). Simple to learn and very flexible.
  4. You have the explode the wrong way around should be $file_name_array = explode(".", $newfile); and $final_name = $file_name_array[0].".".$file_name_array[1]; //was missing $ and correct concatenation Don't forget your semicolons at the ends of the lines
  5. A string would be easier for this method. You need to find the position of <head and </head>. You then replace all text between first and last string positions. <? $text = "<head>This is a sentence one. This is sentence two.</head>"; $headstart = stripos($text, "<head>"); $headend = stripos($text, "</head>"); $textstart = $headstart + 6; //length of <head> is added $textend = $headend; $textlength = $textend - $textstart; $replacement = "This is the replacement text"; $newtext = substr_replace($text,$replacement,$textstart,$textlength); print "newtext - $newtext"; ?> Hope this helps.
  6. I gave the script a try as well and surely enough, Cisco routers come back as down even though I can ping them.
  7. Access to the mysql database and access to your application are two totally different things. Your application should login to the database with the mysql credentials. In that database you should have a users table which authenticates users and determines if they have the authority to add and delete rows. So your user table would be something like this user_id (auto increment) username password (use md5 when encryption) privileges (0 for view only, 1 for add, 2 for add and delete, or whatever you choose) Once a user has logged in, the while they have access to the table that holds the data, they do not have access to the entire mysql database. Hope this helps.
  8. The troubleshooting method that I use to check on queries is to print them. i.e where you have $query = mysql_query("UPDATE carts Set admin_status = 5 WHERE 'cart_id' = .'$per'. 'cart_id'"); I do $query = "UPDATE carts Set admin_status = 5 WHERE 'cart_id' = .'$per'. 'cart_id'"; print $query; This allows me to (1) ensure that the query is what I think it should be and (2) run the query manually against my database and to check the results.
  9. What is the problem that you are having exactly??
  10. Run a phpinfo script to ensure that the mssql is showing up as being loaded <?php phiinfo(); ?>
  11. Have you stopped and restarted the webserver after you made the change in the php.ini file?
  12. Since we do not have your database, can you tell us what happens when you run the code?
  13. Hi, I am working on a project and have come to a point where I need to run a script that runs a database query and then displays information and I will be calling this from different scripts. Question is would this entail an include or a function? I know that with a function, I have the added capability of passing variables back and forth, but are there any other benefits/detriments to doing it one way over the other? Or do I have it completely wrong?? Thanks
  14. F1Fan, Great. Just needed to swap around the divIds but works perfectly. Much thanks. SiRiC
  15. Thanks F1Fan, Is it possible that you can show some code as I am by no means a javascript expert. thanks
  16. Hi, I want to create a form that has a conditional question, but cannot find anything anywhere to help. Basically, Do you () drive to work () use public transportation If the answer is "use public transportation", I want to display another radio button question Do you primarily use the () train () bus () other I understand that it can be done using Javascript and CSS,. Can anyone assist? Thanks SiRiC
  17. Ok, what I did was this echo "<meta http-equiv='refresh' content='5; url=".$newpage." ' />\n"; as was suggested. Because the redirect page has parameters that change, could be newpage.php?code=1234&poll=1 or newpage.php?code=32&poll=72 etc I built the variable before the meta tags (did not know that you could do this), and it works. Thanks to all.
  18. Nope that did not work. Just brought a blank screen (or stayed on the one that was there before) for 3 seconds and then went to the called (2nd) page.
  19. Hi, I have been combing forums but cannot seem to get a answer that fits my problem. I have a link that calls another page, writes to a table and redirects back to the first page. I would like to output on the screen that the transaction has been completed, pause for a couple of seconds and then redirect to the first page. I have used sleep() but all that does is to pause the calling of the second page and then call it and redirect immediately. I have tried using flush before the sleep and before the echo but nothing works. If I use header("Refresh: 5; URL=firstpage.php"); all that does is to keep on calling the page repeatedly. Any assistance would be appreciated. Thanks
  20. Hi, I am pulling a variable call business name from a table and displaying it in a text box which can be edited. My code to display it is <p>Business Name <input type="text" name="business" size="30" value=<?print $business;?>> However, if the business name contains more than one word, only the first word is displayed. If I convert the whole line to php, like <? print "<p>Business Name <input type='text' name='business' size='20' value='$business'>"; ?> the whole name is displayed. What am I doing wrong?
  21. Hi, I am inserting temporary values into a table for use on a resultset. Once I am done I want to clear the data out of the table and have used both //clear tempbiz table $sqlClearBiz = "DELETE from tempbiz"; $resClearBiz = mysql_query($sqlClearBiz); and //clear tempbiz table $sqlClearBiz = "TRUNCATE tempbiz"; $resClearBiz = mysql_query($sqlClearBiz); but neither work. However, I run the command in an SQl client, it works. What can I check??
  22. I would include print statements on $chcat[$i] and $cid before the comparision to see if there are any instances where the same. If not, then backtrack with print statement, until you find where the problem lies.
  23. You can use substr_count(string,substring,start,length) Check http://www.w3schools.com/PHP/php_ref_string.asp
×
×
  • 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.