Jump to content

StormTheGates

Members
  • Posts

    170
  • Joined

  • Last visited

Everything posted by StormTheGates

  1. Hey there. I recently started my new job and one of the first things the boss wants me to do is install PHP on their Redhat server. There is already a copy of Apache installed, as well as a Tomcat installation. It is Apache 2.0.12 I believe. Anyway there is no apxs compiled in and I am at loathe to reinstall apache for fear of messing up any of their configuration settings. So my question is, is there any way to update the config of apache without reinstalling it OR is there a way to install php 5 without apxs? Thanks for any help.
  2. $q1{$questions[0]}++; Would that work? Whats drawn from the database is question answers 1-5. So I have variables like $q11 $q12 $q13 $q14 $q15 and I want to just be able to easily increment one without the use of if statements. So I was hoping to do $q1$answer to incrent say $q12 if the answer is 2.
  3. Hello there. I need to do something like this: $question1$answer++; Basically an example of the output would be like $question12++; How do I do this? I remember having to do something with globals a while back.
  4. Thanks . I solved it by making the mysql a bigint.
  5. Seems kinda brutal on the mysql. Heres what my code looks like: $end = $money*2; mysql_query("UPDATE users set money='$end' WHERE username='$username'"); Cant get past 2,147,483,647 The money field on the database is an int.
  6. I run a game and one of the features is Russian Roulette. The problem Ive been having is that when a user wins they get 2x their money. However if that value exceeds the max of a 32bit integer, 2.147 billion or so they loose the extra money they should have won. How can I rectify this? Thanks.
  7. Hello I have a conundrum on my hands. I am searching for a way to turn a url like this: www.ny-mafia.com/city.php?city=Baltimore Into this: www.ny-mafia.com/Baltimore Do you guys have any idea how I could do this? Can it be done with mod_rewrite? Thanks for any help.
  8. Means its on, and couldnt be set otherwise. Unless Ive got it all wrong, I am watching Waterworld right now so I am kind of distracted.
  9. Try this: $set = 1000; $set = set_magic_quotes_runtime (0); echo "$set"; And report back what it says.
  10. magic quotes doesn't stop SQL injection. Aright well not completely, but it does help, essentially addslashes() to every GET POST and COOKIE
  11. Uhm for blogging you could try bBlog: http://www.bblog.com/download.php For a forum just phpBB?
  12. Might depend on your hoster, I think that some do not allow the INI to be changed from within the code. If you really dont want them then you can use stripslashes();
  13. Magic quotes sanitize all data inputs. It allows lazy coders to just enable it and not have to worry about mysql injection.
  14. Doing so causes an extra operation for the processor as it checks to see if there is a constant named SITENAME before trying with the string "SITENAME". It's better practice to use quotes around your array keys. My preferred method is the same as phpsensei. Well Ill be damned, learn something new everyday.
  15. Ah I fixed my own problem, didnt close the iframe
  16. The problem is your dual quote thingies Remove them from this: {$_GET['SITENAME']} Turn it into this: {$_GET[sITENAME]}
  17. Hey everyone, I am working on a website for a client that includes a bookmarking system. They gave me their entire site done in HTML / JS and want me to write it so everytime the user goes to a new page it bookmarks their page. Now Ive done systems like this before, infact I have one already designed for the White House and several large medical groups for their online tutorials, but in each of those I simply added this to the layout scheme: var place = location.href; document.write('<IFRAME ID=IFrame1 FRAMEBORDER=0 SCROLLING=NO SRC="http://tribal.golearnportal.org/bookmark.php?newplace=' + place + '"'); Which passes on the page to the bookmark script which updates the database. Thing is it was always at the end of the code. With the site they gave me there is no central layout system, its a bunch of HTML pages. What I tried to do was include this code in one of the javascript files that is always included in the header of each page, to save me from having to edit each page. However this causes a blank screen to be displayed, or not completely blank but it dosnt include anything below the included javascript file. Any ideas?
  18. Try this <?php if (isset($_POST['AddToCart'])) { $qty = 1; foreach ($_POST["Component_ID"] as $type => $component) { // mysql_select_db($database_DM_database, $DM_database) or die(mysql_error()); mysql_query("INSERT INTO tblshoppingcart (`Cookie_ID`, `Product_ID`, `Component_ID`, `qty`) VALUES (" . GetCartId() . ", " . intval($ProductID) . ", " . intval($component) . ", " . $qty . ")") or die (mysql_error()); } //header("Location: cart.php"); $ihateyou = $_POST['AddToCart']; } else { } ?>
  19. HTML: <table width=400 cellspacing=1 cellpadding=1 border=0 bordercolor=black class=black3 align=center> <tr align=center> <td class=header colspan=3><b>User profile:</b></td></tr> <tr class=text> <td width=100>Name:</td> <td><a href=sliced.php?page=smartysite/messaging/send&person=$user>$user</a></td> <td width=301 rowspan=$rowspan><img src=$img name=profile_image width=300 height=300> </tr> <tr class=text> <td>Status:</td> <td><span>$status</span></td> </tr> <tr class=text> <td>Culture:</td> <td>$culture</td> </tr> <tr class=text><td>Rank:</td> <td >$rank2</td> </tr> <tr class=text><td>Rank Position:</td> <td >$rank</td> </tr> <tr class=text><td>Gender:</td> <td >$gender</td> </tr> <tr class=text> <td>Wealth:</td> <td >$wealth</td> </tr>"; if($parent != 'none'){ echo "<tr class=text><td>Parent:</td><td><a href=sliced.php?page=view&user=$pid>$parent</a></td></tr>"; } echo " <tr class=text> <td>Family: </td> <td>"; if($family != 'none'){ echo "<a href=sliced.php?page=viewfam&fam=$famid>$family</a>"; } else { echo"$family"; } echo"</td> </tr> <tr class=text> <td>Start date:</td> <td>$start</td> </tr>"; if($timenow < $safetime){ echo " <tr class=text> <td>Safety:</td> <td><font color=blue>Safety</font></td> </tr>"; } echo " <tr class=text> <td>Messages:</td> <td>$ttm</td> <td><img src=$fampic width=300 height=50></td> </tr> <tr class=text><td height=10>Quote:</td> <td colspan=2 rowspan=2>"; echo nl2br(str_replace('\\', "", "$row_Recordset1[text]")); echo "</td> </tr> <tr class=text> <td> </td> </tr> </table> <object classid=clsid: D27CDB6E-AE6D-11cf-96B8-444553540000 width=0 height=0> <param name=movie value=$music> <param name=play value=true> <param name=loop value=true> <param name=quality value=high> <embed src=$music width=0 height=0 play=true loop=true quality=high> </embed> </object> CSS for the black3: table.black3 { margin-top : 15px; margin-bottom : 15px; font-size: 11px; font-family: verdana; color: black; border-collapse:collapse; width: 500px; }
  20. Try using `s For example: `Cookie_ID`, `Product_ID`, `Component_ID`, `qty`
  21. Images are not stored on the server, they are hosted off image shack. After that the tag is [img*]link[/img*] which I just replace with <img src=> on runtime.
  22. This isnt necessarily a PHP question, but it only seems to effect my PHP pages so I was wondering if anyone has encountered anything like this before. I have several things pulled from a DB and put on a table. However, sometimes the borders on the table go crazy. Heres an image of said problem: The weird thing is is that its not predictable, it just happens sometimes. When you refresh sometimes it is fine, and sometimes its fucked up again. I was wondering if anyone has encountered anything like this? I can paste my CSS code and HTML code if people are interested in helping me and need more specifics.
  23. Ah but thats such a pain in the ass in terms of database load
×
×
  • 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.