interpim
Members-
Posts
303 -
Joined
-
Last visited
Never
Everything posted by interpim
-
OK... i think i figured it out... the code may be ugly now LOL, but at least it looks the same in Firefox and IE...
-
Ok... I use Firefox, and the page I have looks like I want it to in Firefox... my problem is, it looks like crap in IE... can anyone please tell me how to fix this so it will work in both Firefox and IE without having issues. I am a CSS noob. The site I am testing is http://interpim.com/parser and this is what I came up with so far for the CSS... html, body{ margin:5; padding:5; } #header{ position:relative; height:95px; background-color:#FFFFFF; width:100%; } #maincol{background-color: #FFFFFF; float: none; position: relative; width:100%; } #rightcol{ position: absolute; top:430px; left:450px; width: 550px; #footer{ background-color:#FFFFFF; position: absolute; top:430px; left:10px; width: 430px; }
-
try assigning your values from POST to variables and echo those out to see what they contain to help with the troubleshooting. There is a difference between "2" and your checking if the value in your post is less than "2" not the numerical 2.
-
I would imagine you should be able to use FTP... http://us2.php.net/ftp
-
if you want php to create it, then you could create the file by writing it as strings maybe a foreach statement fill the data in w/ your variables and save it to your xml file
-
are you closing the if ($time) and for loops?...
-
dynamically create new image addresses to prevent bandwidth theft
interpim replied to interpim's topic in PHP Coding Help
it's 3 pages of about 20 small images per page -
dynamically create new image addresses to prevent bandwidth theft
interpim replied to interpim's topic in PHP Coding Help
no I can't... But they do say they are working on allowing their users to use CRON. I use yahoo webhosting, and have been for about 6 or 7 years and haven't had any downtime so I like to stick with them -
[SOLVED] OMG! mysql_fetch_array won't work...
interpim replied to TutorMe's topic in PHP Coding Help
are you selecting your database in your code? Usually that error occurs when you have the connection to the database but haven't selected it. do it with this code... mysql_select_db($database); -
bah... i always get those 2 mixed up LOL
-
Change your foreach to this and see if it helps foreach($_POST['$interests'] as $value) { echo '<li>$value</li>\n'; }
-
Hi all... Here is my problem... I have a page that I wrote years ago in pure html, basically a bunch of pictures. I decided to download my server log and see what people were looking at, and it turns out that almost everyone on the internet is borrowing my bandwidth by hot-linking the pictures on that site. I want to make the images addresses to not be static to prevent this. Does anyone know a way of doing this? Or am I going about this the wrong way? P.S. I don't have access to my web servers .htaccess file and they will not let me upload any.
-
OK... i guess I was stressing myself out over nothing, I guess PHP automagically converts the text to integers when you pull them out of the string. If anyone is interested in how I did it, I exploded each line and pulled the number from the created array and then just added them to a variable. To easy I always expect to write 100 lines of code to do simple stuff ROFL.
-
11 is most likely your unique ID number assigned by your Database...
-
I would start by googling "PHP WYSIWYG editor" and see where that leads
-
your mixing html and php without echoing it... rewrite your code to this <?php $game_pic = stripslashes($row['game_picture_url']); if (strlen($game_pic) > 0) { echo "<IMG SRC="gamepic/"; echo stripslashes($row['game_picture_url']). " ' WIDTH='150' HEIGHT='110' BORDER='0' ALT= 'free online (THIS IS LINE 61) games, free flash games">"; } ?>
-
why not use a foreach statement to cycle through your email addresses sending the email to each of the addresses in your database?
-
Here is the code I have so far... Still can't figure out how to count the numbers in each line... <?php $target_path="uploads/"; $target_path = $target_path . basename($_FILES['userfile']['name']); if(move_uploaded_file($_FILES['userfile']['tmp_name'],$target_path)){ echo "The file " . basename($_FILES['userfile']['name'])." has been uploaded<br>"; }else{ echo "There was an error uploading the file, please try again!<br>"; } $filename = "uploads/" . basename($_FILES['userfile']['name']); $handle = fopen($filename ,'r'); $hits = 0; $crits = 0; if ($handle){ while(!feof($handle)){ $buffer = fgets($handle,4096); if (preg_match("/You hit.*/", $buffer,$matches)){ $hits = $hits+1; } if (preg_match("/You critical hit.*/", $buffer, $matches )){ $crits = $crits+1; } } fclose($handle); echo "You hit " . $hits . " times.<br>You critted ". $crits . " times."; } ?>
-
Hey guys... I've never been good at regular expressions, (I have no clue LOL) What I am trying to do is parse a log file from a video game. So far I have gotten to the point of counting the amount of lines that have the text "You Hit" in it, and echoing that to the output. What I am trying to do now, is pull the actual number from that line (this number varies in length) and get an average from all of those numbers. Can anyone explain to me how to do this? or point me in the direction of a tutorial I can follow to get the info I need? Here is a sample of the text file I am parsing. [15:16:13] You hit Crush for 611 damage! [15:16:13] You critical hit for an additional 458 damage! [15:16:15] You begin casting a Greater Rune of Shadow spell! [15:16:15] You are already casting a spell! You prepare this spell as a followup! [15:16:16] You hit Crush for 760 (+379) damage! my code so far counts the first and last lines but I want to add the 611 and 760 and get the average. Thanks in advance for any help offered
-
This will call the function stuff() 10 times. $x=0; while($x<10){ stuff(); $x+1; }
-
are you going to change this dynamically? if not, why not just make a function call it stuff() function stuff(){ echo' <SELECT id="name" name="name[ ]" style="WIDTH: 160px" value ="'; if (isset($_POST['name[ ]'])) echo $_POST['name[ ]']; echo '" />'; if(mysql_num_rows($result)) { // we have at least one user, so show all users as options in select form while($row=mysql_fetch_assoc($result)){ echo '<option value="',$row['memberName'],'">',$row['memberName'],'</option>'; } } ++$x; }} Then where you want that particular piece to go. call the function <?php stuff(); ?>
-
so... does the string "Newline" always appear exactly as you have it in your if statement... maybe you could remove one of the = signs. !="Newline" instead of !=="Newline" not identical versus not equal. Im really not sure what your going for though http://www.php.net/manual/en/language.operators.comparison.php I am horrible with strings though
-
Hrmmm... I am getting this error now Warning: imagecolorallocate(): supplied argument is not a valid Image resource in E:\wamp\www\IMG_RESIZE\crop-resize-gd\last_step.php on line 64 Warning: imagestring(): supplied argument is not a valid Image resource in E:\wamp\www\IMG_RESIZE\crop-resize-gd\last_step.php on line 65 <div id="completedImage"> <?php echo "<img src=\"" . $destinationFile . "\" id=\"theImage\" alt=\"Final Image\" />"; ?> </div> <!-- completedImage --> <!-- my crap added here --> <?php $string == "TEST STRING"; $color == imagecolorallocate($destinationFile,0,0,255); imagestring($destinationFile,5,0,0,$string,$color); ?> <!-- end of my crap --> <?php } else { ?> <div class="info"> <h1>Error</h1> <p>There was an error.</p> </div>
-
Thanks for the redirect
-
<?php $phpbb_root_path = './forums/'; define('IN_PHPBB', true); // // phpBB related files // include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.' . $phpEx); include($phpbb_root_path . 'includes/bbcode.' . $phpEx); // // start session management // $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); if($userdata['session_logged_in']) { $db = mysql_connect(DB_SERVER, DB_USER, DB_PASS); mysql_select_db(DB_NAME,$db); $session->startSession(); $session->userinfo = $database->getUserInfo($userdata['username']); $session->logged_in = 1; $session->username = $_SESSION['username'] = $userdata['username']; $session->userid = $_SESSION['userid'] = $session->userinfo['userid']; $session->userlevel = $session->userinfo['userlevel']; $session->sessionid = $userdata['session_id']; $session->time = $userdata['session_start']; $database->updateUserField($session->username, "userid", $session->userid); $database->addActiveUser($session->username, $session->time); $database->removeActiveGuest($_SERVER['REMOTE_ADDR']); } $db = mysql_connect(DB_SERVER, DB_USER, DB_PASS); mysql_select_db(DB_NAME,$db); ?>