RussellReal
Members-
Posts
1,773 -
Joined
-
Last visited
Everything posted by RussellReal
-
it has nothing to do with php all php does is send it out, whether you output buffer, or break the string up.. think of it this way the MORE operations you use, the slower it will run, in this case anyway.. if you have the strings just echo them as you get em the less work u do to the string, the less work it will take php, the less time it will take the client to receive the contents.. also note, if you have a 200kb image, it might take quite some time to load.. I output alot larger than 200kb sometimes, and it really doesn't do nothing different.. all streams, E.G. MP3 streams, Movie streams.. they're all output, through functions quite like echo or print readfile() just outputs the data, mostly the same way echo or print would.. so its not a problem with echo at all, if anywhere, its elsewhere in the script.
-
<?php $parameter1 = $_POST["parameter1"]; $parameter2 = $_POST["parameter2"]; echo $parameter1 " - " $parameter2; echo "END"; ?> you forgot the contactinator ( . ) here try this: <?php $parameter1 = $_POST["parameter1"]; $parameter2 = $_POST["parameter2"]; echo $parameter1 ." - ". $parameter2; echo "END"; ?>
-
you need an onclick event for the image button
-
<script type="text/javascript"> function doal() { var d = document; var a = d.getElementsByTagName("input"); for (i in a) { if (a[i].name.indexOf("number") >= 0) alert(a[i].name); } } </script> <form name="rawr"> <input type="text" name="number0" /> <input type="text" name="number1" /> <input type="text" name="number2" /> <input type="text" name="number3" /> </form> <input type="button" onclick="doal()" />
-
<?php ob_start(); include("myphpfile.php"); $content = ob_get_flush(); ?>
-
in order to set a cookie you use setcookie
-
Converting this one page from asp to php/mySQL
RussellReal replied to classicTEK.org's topic in PHP Coding Help
well, if you're familiar with php, than read through your asp, and think.. hmmm what does this function do.. then look for correlating functions on php.net -
<?php header('Location: login.php'); ?>
-
well bro, you can't =\ I don't think atleast.. but I'll rephrase your question in this post and maybe a guru will be some help to you.. my friend here wants to know how, if possible, he could sort of 'create' a php tag, which automatically outputs the containing block of code, rather than evaluating it.. for example he'd have <?php+ echo "hey!": $abc = 123; echo max((ceil($abc * $abc) / .5),1); ?> and he'd want that block of code to RETURN or OUTPUT <?php echo "hey!": $abc = 123; echo max((ceil($abc * $abc) / .5),1); ?> to the command line and or web browser..
-
firstly, I remember you, and you are completely getting the wrong concept of these 'token's they are not for USE in a script they are used in DEBUGGING scripts, E.G. "Unexpected T_OPEN_TAG in whateverphpfile.php at line 17" You're looking to output php snippets inside of php, now I have recommended you use nowdoc or heredoc echoing, but you think adding the extra 2 lines is an inconvenience and makes it look 'sloppy' well, there is no other way, you NEED to echo to output, or not echo at all and close the php tag, and type out the actual code.. e.g. <?php yadayada ?><php echo "hey!"; ?><?php yadayadayada ?> I have just looked at the link I supplied, and noticed that nowdoc apparently only works in 5.2.9 which I don't quite understand, coz otherwise I really wouldn't know about it unless I looked it up b4 and don't remember.. but heredoc will 'course render any variables and such.. so thats not that great, guess you're stuck echoing it manually or go with a database and just select it out as text by default, then echoing text is not that hard
-
yes sir
-
in internet explorer, there is a few default values for a page e.g. Margin: starts at 15px so does: padding so in your css for that framed page put html, body { padding: 0; margin: 0; }
-
just use the code I supplied, and mod it to work for your purpose
-
add a space between " and Class and change "grey" to "gray"
-
Trying to duplicate a php script in an opposite manner
RussellReal replied to abcd's topic in PHP Coding Help
wow, you're going to send people into an infinate loop of browser redirects.. meanwhile that sounds pretty neat, I don't quite thing the user will approve lol.. you could however, to answer your question, change if ($_SERVER['HTTP_REFERER'] != "") to if ($_SERVER['HTTP_REFERER'] == "") lol -
ok.. try this: <?php if (isset($_GET['page'])) { $pid = (int) $_GET['page']; if ($pid) { mysql_connect("host.to.connect.to","user","password"); mysql_select_db("dbToUse"); $q = mysql_query("SELECT * FROM `forumtutorial_posts` WHERE `postid` = '$pid' LIMIT 1"); if ($a = mysql_fetch_assoc($q)) { print_r($a); } else { // post $pid does not exist.. } } else { // $pid is not a number or a positive number. } } else { // page GET VAR not set } ?> change the values according to what you're doing
-
mod_rewrite looking outside document root
RussellReal replied to vertigoalopolus's topic in PHP Coding Help
no I understand you, but what else could u do? lol -
oh yeah.. regex uses ( ) [ ] / and so forth as special characters which do stuff try putting \ before any occurance of a "special character"
-
what does your table look like? show a screenie or something if possible..
-
php gd imagecreate however there is this opensource graphing flash application which I seen my friend's company use which looked really good, but I don't usually use opensource stuff, not even JQuery (But I'm debating whether I should lol)
-
$text = ereg_replace(":\", "<img src='../simple/template/images/smiley/undecided.gif'>", $text); is where your error is you're escaping the closing quote with \ change $text = ereg_replace(":\", "<img src='../simple/template/images/smiley/undecided.gif'>", $text); to $text = ereg_replace(":\\", "<img src='../simple/template/images/smiley/undecided.gif'>", $text);
-
[SOLVED] PHP script not sending me an email for my HTML form
RussellReal replied to dkeipper's topic in PHP Coding Help
another thing, but I don't know if its allowed or not.. but I've never seen anyone do @$varToAssign = "value"; @ is just something u usualy put infront of function calls to disregard warnings otherwise, maybe your php can't send a mail? I'm not sure what else to tell ya lol -
where do you set $page?
-
$q1 = ("SELECT BcId, BtId from BookCopy WHERE BcId = $bcid and BtId =$btid"); You should quote the values for mysql $q1 = ("SELECT BcId, BtId from BookCopy WHERE BcId = '$bcid' AND BtId = '$btid'"); also, the way you set up the query, if it fails it will die, therefore there is no need for the if statement, thats just a point out. secondly, you can't INSERT a change, you do UPDATE
-
try adding: print_r($r); into the while loop, to see if you're grabbing anything.