premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
That is not a bug. You never instantiated an object by calling a method using the :: operator. This is how you should do it. <?php include("ClassOne.php"); $classOne = new ClassOne(); $classOne->function_two_in_Class_One("test"); ?> Is how you should use that function.
-
Yea, I just installed RC1, and it is a ton more responsive and better. I would not install Beta now that RC1 is out (Plus less windows updates).
-
Hmm, I may create some tests just for fun. But if you want to find if it is a bug, create a simple test. A class without all the bells and whistles and see if it is repeatable. If it is, then it may be a "bug" or may have been coded intentionally. But, if it is not repeatable with a simple class, then there is something going on with your code.
-
Do you have two classes with the same method "get_dim_img" as it seems to think that you want to call Class "Content"'s function instead of Viewer. I have the strangest feeling you omitted an important part of the code. Aside from that, what is wrong with using Viewer:: ???
-
ob_start has to be placed at the very top of the script, before the output. You do not need to worry about flushing it as when the script is down the output will automatically be flushed. But doing the output has already been sent since ob_start is not before the output. Make sense?
-
If you do not want to modify your page and put a "band-aid" on the issue. Output buffering is what you want to look into. ob_start is a good spot to start.
-
IMAP is a mail reading server. SMTP is what you need, and chances are your work's network blocks port 25, which most mail servers use to send mail out of. You may not be able to resolve this issue without an IT guy opening a port, which I doubt they would do.
-
Misundestanding. I thought, when you said @domain.com it was a reference. <?php $html = '&id="test@domain.com" some extra stuff \n test89@domain.com and id="teststst@domain.com" and id="test2@domain.com" and eve some more \n and id="test3@domain.com" stuff'; $results = array(); preg_match_all('~id="(.*?)@domain.com"~s', $html, $results); echo "<pre>"; print_r($results); die(); ?> Output: Array ( [0] => Array ( [0] => id="test@domain.com" [1] => id="teststst@domain.com" [2] => id="test2@domain.com" [3] => id="test3@domain.com" ) [1] => Array ( [0] => test [1] => teststst [2] => test2 [3] => test3 ) )
-
<?php $html = '&id="test@test.com" some extra stuff \n and id="teststst@test.com" and eve some more \n stuff'; $results = array(); preg_match_all('~id="(.*?)"~', $html, $results); echo "<pre>"; print_r($results); die(); ?> Output: Array ( [0] => Array ( [0] => id="test@test.com" [1] => id="teststst@test.com" ) [1] => Array ( [0] => test@test.com [1] => teststst@test.com ) )
-
<?php $html = "&id=test@test.com some extra stuff \n and id=teststst@test.com and eve some more \n stuff"; $results = array(); preg_match_all('~id=(.*?) ~', $html, $results); echo "<pre>"; print_r($results); die(); ?> Since you did not provide us with an example of what you want to parse, this will have to suffice, it requires that there be a space after the @domain.com to fetch the data. Output of the above: Array ( [0] => Array ( [0] => id=test@test.com [1] => id=teststst@test.com ) [1] => Array ( [0] => test@test.com [1] => teststst@test.com ) )
-
echo __CLASS__; Do that inside of a class method and it should return to you what the class is. <?php class test { function __construct() { echo __CLASS__; } } $testClass = new test(); ?>
-
You can use the rand function along with along with time inside of an md5 to create a "unique" hash each time. Those should guarantee a unique id, if you do not mind it being a hash instead of just all numbers.
-
Try using .htaccess instead. Google .htaccess 301 redirect for more information on it.
-
Why not have a separate file and store the last id in that file ??? Simple as that.
-
If the $userid directory does not exist, it cannot be moved to that directory. You need to check that it is a is_dir first if not you need to create the directory mkdir.
-
<?php session_start(); That is considered a whitespace hence output to the browser. <?php echo 'test'; session_start(); That is consider output as well, and will cause the error. <?php session_start(); echo 'test'; That is a valid session_start() given that there is nothing included above etc. You must[/m] have output being started somewhere or else you would not get that error, particularly on line 8 in sessions/index.php as that is what the error states: Your session_start code is apparently on line 10, given that error message.
-
Read the error. You already have output on line 8 of index.php. You cannot do any type of header function after output has been sent, this includes white spaces, echo's print's etc. Show us the first 15 lines of index.php and we can help you resolve the issue. As the code you have shown here does not correspond with the error you have pasted. EDIT: As a side note, HEADER ERRORS - READ HERE BEFORE POSTING THEM Sticky at the top of this forum.
-
[SOLVED] Inserting multiple rows within one query...
premiso replied to forumnz's topic in MySQL Help
That you are showing us the wrong code. I do not see assets in the code you provided anywhere. , I see "Income" where assets should be. -
I am not sure what program you are using to write this code, but if there is an option to convert spaces to tab, I would do it. As that code is a mess. I properly indented the code and commented where the errors were. <?php session_start(); $errmsg_arr = array(); $errflag = false; function clean($str) { $str = @trim($str); if(get_magic_quotes_gpc()) { $str = stripslashes($str); } return mysql_real_escape_string($str); } $userid = $_SESSION['SESS_USERID']; $albumname = clean($_POST['albumname']); $tracks = clean($_POST['tracks']); // { This is an error is it suppose to be an if statement? $qry = "INSERT INTO banddisco (userid, albumno, albumname, tracks) VALUES ('$userid', '', '$albumname', '$tracks')"; // } This is also an error $result = mysql_query($qry) or die(mysql_error()); $fields = array('albumname'); foreach($fields as $var) { if (isset($_POST[$var])) $_SESSION[$var] = $_POST[$var]; } $userid = $_SESSION['SESS_USERID']; $albumname = $_SESSION['albumname']; if (isset($_POST['submit'])) { if (isset($_FILES['new_image'])) { $file_name = $_FILES['new_image']['name']; $getExt = explode ('.', $file_name); $file_ext = $getExt[count($getExt)-1]; $allowed_ext = "|jpg|png|gif|jpeg|svg|bmp|"; if (strpos($allowed_ext, "|".strtolower($file_ext)."|")===false) die("Extension: $file_ext is not allowed!"); $imagename = "$albumname"; $source = $_FILES['new_image']['tmp_name']; $target = "C:/wamp/www/fanjunky/users/$userid/$imagename"; move_uploaded_file($source, $target); $imagepath = $imagename; $save = "C:/wamp/www/fanjunky/users/$userid/$imagepath"; $file = "C:/wamp/www/fanjunky/temp/$userid"; if($result) { header("location: ../member_home.php?disco=1"); exit(); }else { die(mysql_error()); } } // added to end the new_image if } // added to end the submit if ?>
-
It would help posting the actual error message.
-
echo $video_url_format[$type]; //this is line 6 PHP uses [ and ] for arrays not ( ) as those signify a function, like the error explains.
-
Store the data in session, and use the session variables on the form if there is a value stored in there. And please, refrain from using CAPS in titles, it is annoying as all hell and will not get you "quick" help as it signifies that you believe your post is more important than everyone elses on the forum and that you should get more attention.
-
[SOLVED] Inserting multiple rows within one query...
premiso replied to forumnz's topic in MySQL Help
Probably due to type being in art of the columns. Add this to see the error: mysql_query("INSERT INTO chart_of_accs (`hash_key`, `acc_hash`, `type`, `code`, `name`, `description`, `tax`, `show_exp_claims`, `sys_locked`) VALUES ('$demo_hash', '" . md5(rand() . rand() . rand()) . "', 'r_r', '200', 'Sales', 'Income', 'gst_n', '0', '0'), ('$demo_hash', '" . md5(rand() . rand() . rand()) . "', 'e_o', '400', 'Advertising', 'Advertising', 'gst_n', '0', '0')") or die(mysql_error()); Give that a try and see what it returns. -
$sql = "SELECT * FROM sometable WHERE some='condition'"; $result = mysql_query($sql) or die("SQL WAS: {$sql}<br />ERROR WAS: " . mysql_error()); $i=1; while ($row = mysql_fetch_assoc($result)) { echo "{$i} row: " . print_r($row, 1) . "<br />"; // note this can be changed to display certain output. $i++; } Since you failed to provide any type of code, this is the best I can give you. Hopefully that will at least get you started. If this is not what you want, perhaps post some code that you have already tried...