![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
taith
Members-
Posts
1,514 -
Joined
-
Last visited
Everything posted by taith
-
[SOLVED] very quick and easy for php intermediate!
taith replied to fri3ndly's topic in PHP Coding Help
nope! as long as your url has "?page=about.txt" on it... it should work... -
[SOLVED] very quick and easy for php intermediate!
taith replied to fri3ndly's topic in PHP Coding Help
case "index2.php?page=services.txt": case "services.txt": -
[SOLVED] very quick and easy for php intermediate!
taith replied to fri3ndly's topic in PHP Coding Help
switch($_GET ){ case "about.txt": echo '<img src="images/topleftbartest.jpg" width="800" height="141"/>'; break; case "": echo '<img src="images/topleftbartest2.jpg" width="800" height="141"/>'; break; default: echo '<img src="images/topleftbartest2.jpg" width="800" height="141"/>'; break; } -
oops <? $result = mysql_query("SELECT * FROM userfield"); while ($row=mysql_fetch_assoc($result)) { echo "-- TEST --<br>"; if(!empty($row[field5])) echo "$row[field5] $row[field6]<br>"; if(!empty($row[field7])) echo "$row[field7] $row[field8]<br>"; if(!empty($row[field9])) echo "$row[field9]<br>"; if(!empty($row[field10])) echo "$row[field10]<br>"; if(!empty($row[field11])) echo "$row[field11]<br>"; if(!empty($row[field12])) echo "$row[field12]<br>"; if(!empty($row[field13])) echo "$row[field13]<br>"; echo "-- TESTEND --<br>"; echo "<br>"; } mysql_close($conn); ?>
-
<? $result = mysql_query("SELECT * FROM userfield"); while ($row=mysql_fetch_assoc($result)) { echo "-- TEST --<br>"; if(!empty($firstnames)) echo "$row[field5] $row[field6]<br>"; if(!empty($addressline1)) echo "$row[field7] $row[field8]<br>"; if(!empty($addressline2)) echo "$row[field9]<br>"; if(!empty($addressline3)) echo "$row[field10]<br>"; if(!empty($citycountry)) echo "$row[field11]<br>"; if(!empty($postcode)) echo "$row[field12]<br>"; if(!empty($country)) echo "$row[field13]<br>"; echo "-- TESTEND --<br>"; echo "<br>"; } mysql_close($conn); ?>
-
ohok... from the code you provided ontop, its tellling us that anybody could just type over that url, and get another page... not withstanding if its there or not.
-
i've ran php 4.x, 5, 5.2, and have yet to find one where <?=$var?> doesnt work... besides... most of other php upgrades have been backwards compatable... i dont see why they'd cut this... maybe its not cool enough... lol
-
<?=$var?> is just a shortform for <?php echo $var?>
-
honestly... its really down to personal preference... personally... i template everything... so all my stuff is stored in strings, untill it hits the template.php in which is 99% html code... where i <?=$var?>
-
ya they can :-) just ?><meta><? or echo it... :-) php only alters, manipulates and creates strings(arrays and integers)... basically with .html files... what you put in, is a static string... sent to the browser the same every time... with .php files... it builds that string, then sends it to the browser... so any/all html(even js) will work within a php string...
-
since headers are sent from the browser, and headers are what hold that information... instead of using header(Location: ); you'd need to either use a javascript redirect, or a meta redirect, which then resends the header, setting the buffer page, to the referrer
-
personally... with my programming style... i put all my similar tasks into the same page... thats just me tho... it fits my programs nicely... lets me coordinate all my tasks so it runs faster... although... i do keep my personalized functions seperated in seperate folder, with an index that require_once()s them automatically... speeds up debuging ALOT!
-
YAY! I WIN! *pats himself on the head* what do i win?
-
only 1 of loading pages, without changing pages... ajax... p.s. thats a VERY unsecure way of doing it
-
$sql = mysql_query("SELECT * FROM dispo_money LIMIT $from, $max_results"); if(mysql_num_rows($sql)==0){ echo 'empty!'; }else{ while($row = mysql_fetch_array($sql)) { } }
-
^[A-Z][a-z][0-9][\_]$ ^ <-- start of string $ <-- end of string [] <-- conditionals
-
your missing an ]
-
that would be a javascript issue... not php... try posting on the javascript forum...
-
what is select supposed to have? print_r($_POST); what does it have?
-
ya... the only way to store stuff onto the server, is to connect, to the server...
-
that exact error... probably the host is wrong... still your webhost would be the ones to fix it...
-
change the password to your ftp/filemanager... make longer/harder...
-
that means your mysql username/pass/host are wrong... contact your webhost, make sure their right
-
[SOLVED] Problems with redirecting pages.![HELP PLS]
taith replied to phpRoshan's topic in PHP Coding Help
in most cases... yes... break; should be used for switch()es... as this is only doing one specific task, they arnt necessary, if you exit; ...but it is good coding practice... -
[SOLVED] Problems with redirecting pages.![HELP PLS]
taith replied to phpRoshan's topic in PHP Coding Help
you need to be careful with headers, you want to "exit;" right after any/all of them...