RussellReal
-
Posts
1,773 -
Joined
-
Last visited
Posts posted by RussellReal
-
-
that I must say is pretty slick
Where there is a will there is a way. A hacked together way would be this. We're going to pretend you have a text element named 'name0'.
Set a session variable called '$count'. Every time the page is visited count should be increased by one. When the php script builds the page it should change the name of the text box to fit the pattern "name".($count+1). Then whenever the page loads have it check for the $_POST["name$count"].
Every time the page reloads the script will look for a differently named POST variable. That means that only one that was just submitted will be accepted (because the name matches what PHP is looking for), any leftovers from a browser refresh will be rendered useless.
-
<?php $Ehighnote = array('E','F','F#','G','G#','A','A#','B','C','C#','D','D#','E'); echo preg_replace("/(\d+?)/e",'\$Ehighnote["\1"]',"-1--1--3-3--3-3-3-3-3--"); ?>
-
regex
give me 2 minutes
-
you could also do
<?=$row['row_number'];?>
-
check the http_referer?
I will run a few tests.. and get back to you in a moment
ok that doesn't work.. lol
-
they are basck references
\0 will be the whole string captured inside of the pattern..
\1 would be the first capturing group
\2 wouldbe the second
\3 would be the third.. etc
capturing groups are ( )
and non-capturing groups are (?: )
-
<?php $a = "hello how ArE you?"; echo preg_replace("/\b(are)\b/ie","strtoupper('\\1')",$a); ?>
you need the /e modifyer I guess it stands for "eval" lol
-
try \0 instead of $0 but I'm going to do a few tests right now and get back to you wait like 2 mins unless sum1 smarter than me gets to it first lol
-
// config.php $var1 = "hello";
// workit.php echo $var1;
// index.php include('config.php'); include('workit.php');
that should display "hello" if it doesn't maybe reinstall php :S idk wat else to say
http://lovinglori.com/file3.php
I did the exact same thing
file1 sets $var1
file 2 echoes $var1
file3 includes both
and output is exactly how it should be..
-
WELL
1 thing I can say is..
name your file
install_settings.config.php
including a txt file does the same as including a .php, however... If a user does
yoursite.com/install_settings.config
they'd get alot of information about your site.. and thats never good.. keep it secret.. keep it .php
ALSO
// config.php $var1 = "hello";
// workit.php echo $var1;
// index.php include('config.php'); include('workit.php');
that should display "hello" if it doesn't maybe reinstall php :S idk wat else to say
-
ok..
well try this
SELECT `count`, count(`number`) FROM `cq_synattr` GROUP BY `number`
-
ok I have an object right
lets say sumfin like this:
function handleThisEvent() { // HOW do I reference this event's CALLING xmlHTTPRequest object? } function What() { a = new XMLHttpRequest(); a.open("GET","whatever.php",true); a.send(null); a.onreadystatechange = handleThisEvent; } abc = new What();
inside handleThisEvent how would I reference "a" the xmlHTTPRequest object specified in the What object..
without making a global variable equal to "a"
-
<img src="whatever.jpg" id="image" /> <script type="text/javascript"> function resizeImage(image) { vh = window.innerHeight; vw = window.innerWidth; if (""+vh+"" == "undefined") vh = document.documentElement.offsetHeight; if (""+vw+"" == "undefined") vw = document.documentElement.offsetWidth; if (image.width > image.height) { cRat = image.height / image.width; image.height = vh * cRat; image.width = vw; } else if (image.height > image.width) { cRat = image.width / image.height; image.height = vh; image.width = vh * cRat; } else { image.height = Math.min(vh,vw); image.width = Math.min(vh,vw); } } resizeImage(document.getElementById("image")); </script>
-
for the div on the page do:
<div><? echo $_GET['error']; ?></div>
-
You could make a file called
xmlnews.php
and echo like
<content>
<newsItem>
<date>10/25/08</date>
<subject>Titanic2 goes down! Rose JR. is a prostitute!</subject>
<text>Yeah, when the titanic went down it felt sooooo goood, then a voice came out of no where "Give me $50 dollars...."</text>
</newsItem>
</content>
flash has xml handlers
-
ok bro, well, you don't seem to be understanding me..
so I'll try to explain it 1 more time, not being mean or anything...
the URLLoader I linked you to in as3, is like php's file_get_contents function.. which gets the contents of the file..
now..
like you'd parse weather.com to get the weather to show up on your website.. you'd parse your own site.. or make a php file.. which outputs ALREADY PARSED information.. that way when you use the data you parse form this file in flaqsh.. its that much easier..
in flash you need to create text fields for text..
and then you put the parsed data inside the text areas..
you can't just do sumfin like
include("your file");
theres no such thing in flash (I don't think) YOu need to parse your data in flash, from 1 of your php files.. then display the data
sorry if you don't understand what I'm saying.. I hope someone else will read this and explain it better to you
-
you want the ACTUAL CODE to show up?
-
oh then do the check @ the top of the php page..
if fail
header("location: index.php?error=".urlencode($message));
then in index.php
put
$_GET['error'] inside the div
-
give me a link to the page.. and I'll check it out..
if you have msn add me:
RussellonMSN@hotmail.com
-
and my div code
index.html
<?php // this page is html not php <div> <div align="center"><?php echo $message; ?></div> </div> ?>
get rid of those <?php and ?> tags from around your divs.. and then your problem is solved..
-
ok
you don't need javascript
do this..
<?php if (your condition) { $message = "1 message"; } else { $message = "another message"; } ?> <html> <head> </head> <body> <div><?php echo $message; ?></div> </body> </html>
-
this isn't visual basic.. php uses { and } not THEN and ENDIF just FYI
-
i put a random username
and a random password
but it says invalid username lol
-
ok your query is messy..
try this.. I'm not sure it'll work.. but it looks like it should:
$sql = "SELECT *.city_id, *.max_bet, *.owner_id FROM blackjack JOIN (coinflip,keno,roulette,war,slots,bulletfactory,airport,ironworks) ON ( coinflip.city_id = keno.city_id, keno.city_id = keno.city_id, roulette.city_id = keno.city_id, war.city_id = keno.city_id, slots.city_id = keno.city_id, bulletfactory.city_id = keno.city_id, airport.city_id = keno.city_id, ironworks.city_id = keno.city_id ) WHERE keno.city_id = '{$row['id']'";
Is there any way..
in PHP Coding Help
Posted
curl and file_get_contents will bring the output of Y to X if used on X..
to REDIRECT your user to Y you could use the
header function
header("location: Y");