
Philip
Staff Alumni-
Posts
4,665 -
Joined
-
Last visited
-
Days Won
20
Everything posted by Philip
-
echo date('n/j/Y', strtotime('2009-02-25 00:29:55'));
-
Offtopic: Isn't it against ICANN rules to do that though? I thought it was against the rules to hold a domain to resell at a higher value. I know people do it all the time, but I thought I read somewhere it was a no-no. (Found it: here - but it is only against trademarks and such) I think: dontationcrew.com
-
Adding variables to $_SESSION variables with FOR
Philip replied to Fabis94's topic in PHP Coding Help
Did you try: foreach($hparts as $key=>$value) { $_SESSION[$key] = $value; } <?php session_start(); $username = $_POST["username"]; $hiscores = file_get_contents('http://hiscore.runescape.com/index_lite.ws?player=' . $username); $hparts = explode(',', $hiscores); // Max $hparts should be 82 (0 is first) foreach($hparts as $key=>$value) { $_SESSION[$key] = $value; } echo $_SESSION[1]; echo '<script type="text/javascript">'; echo 'window.location="hiscores_out.php";'; echo '</script>'; ?> -
PHP Help -- Running other php scripts with variables
Philip replied to bgeorge82's topic in PHP Coding Help
You can pass them as arguments in the PHP file. Here's a good example: http://web.jaypedia.com/web/cron/how-to-pass-php-cron-job-parameters-arguments-or-variables.htm -
Adding variables to $_SESSION variables with FOR
Philip replied to Fabis94's topic in PHP Coding Help
//... session start at top foreach($hparts as $key=>$value) { $_SESSION[$key] = $value; } print_r($_SESSION); // just to print what was placed in session -
Hmm... Try: $net = $facebook->api_client->fql_query("SELECT affiliations FROM user WHERE uid ='$id' "); $network = array(); $network = $net[0]['affiliations']; foreach($network as $info){
-
Or... dirname(__FILE__);
-
Have you thought about using SimpleXML - good for smaller files Otherwise... take a look at http://www.codehelp.co.uk/php/xmlparse1.php
-
Well, if it is redirecting it means: if(siteStat() == "Basketball" && $basketReg == 0) is failing A few things I would do. Check to see if those variables are coming out to what they should - if not (which they aren't) find the source. Also, add in error_reporting(E_ALL); to the top of the script to see if something is causing a warning/error.
-
Are you using the variable $network anywhere else in the script?
-
Can you print out and call variables from foreach?
Philip replied to Kane250's topic in PHP Coding Help
$contentmarker = array('$para1exploded', '$para2exploded', '$para3exploded', '$para4exploded'); Single quotes do not execute variables and such. $contentmarker = array($para1exploded, $para2exploded, $para3exploded, $para4exploded); or $contentmarker = array("$para1exploded", "$para2exploded", "$para3exploded", "$para4exploded"); -
It most likely means you're missing a } before the end of your script. Proper indenting would make it easier to spot this
-
Yeah, well it really won't do anything except take an hour away from me being on the computer. I understand the seriousness of the situation, but what's the point of me thinking about this? What can I do? I'm not an engineer. Turn off stuff you don't need, open a window from time to time instead of running the AC, blah blah blah
-
Well, it fixed your PHP error - now we have to look at your MySQL error. After this line: $sql .= ") GROUP BY title, summary, uploadBy ORDER BY occurrences DESC"; put: echo $sql; and copy/paste what you see.
-
Missing a semicolon on that first line
-
But it's out in the open, not in a query or variable You need first connect to the database, then run a query on that. $res = mysql_connect($host, $user, $pass) or die(mysql_error()); mysql_select_db($db, $res) or die(mysql_error()); mysql_query("SELECT `page_id` AS s, `link` AS c, `vid_title`, `vid_desc`, `hidden` FROM `'.$opts['videos'].`", $res) or die(mysql_error());
-
if(!($res = mysql_query("$host", "$user", "$pass") or die(mysql_error()); mysql_select_db("$db") or die(mysql_error()); 'SELECT `page_id` AS s, `link` AS c, `vid_title`, `vid_desc`, `hidden` FROM `'.$opts['videos'].` First of all you have a query where you probably meant connect. Secondly, why is the following there? 'SELECT `page_id` AS s, `link` AS c, `vid_title`, `vid_desc`, `hidden` FROM `'.$opts['videos'].`
-
I'd image with the practically endless types of zipcodes, that would be impossible, not to mention some countries don't have postal codes. The best thing to do what have the end-user narrow it down to what country - then out of several zipcode databases, you'd pull it from one. Take a look at this page for more reasoning why it'd seem impossible: http://en.wikipedia.org/wiki/List_of_postal_codes
-
http://www.phpfreaks.com/forums/index.php/topic,208965.0.html Has UK at the end of the post I believe.
-
D'oh! this link is for corbin
-
Yeah, I love SMF because of some of the features, but it can be hard to navigate. I joined the SMF Documentation team for a little while in hopes to maybe improve their documentation (almost none on how to create a mod or theme) but my interest didn't last very long.
-
Agreed - I've probably learned more just by researching interesting problems and finding solutions to them than I have by reading or by someone trying to spoon feed me information. I freelance on the side, and this (as Maq said) helps keep me sharp. I don't really get bored on this site, there always an interesting question somewhere - even if it's not in the PHP Help section. Do I get fed up? It's rare, but yes. When the OP is stubborn and won't try anything but his way, I tend to get frustrated (as I do with my clients that do the same, although I don't show it around them ) As for steering - I try to do the same, will give them hints about what's wrong, or ask them "Do you see the difference between this and that?" But most of the time I have the code handy for when I feel they deserve it Oh - and I should ask, why do teachers become teachers? (At least here in the States it's not about the pay )
-
how to translate a php script to another language ?
Philip replied to samoi's topic in PHP Coding Help
oh my... -
Happy mother's day to everbody's mum and mother's
Philip replied to redarrow's topic in Miscellaneous
Hallmark holiday. -
<?php phpinfo(); ?> Will tell you everything you need to know about your PHP setup. Otherwise you can just call: <?php echo 'Current version is ',phpversion(); ?> Fread/fseek - again, I'm not sure about this one $fp = fopen($IP_file,"a+"); #works fine fseek($fp, 0);