xwishmasterx
-
Posts
186 -
Joined
-
Last visited
Posts posted by xwishmasterx
-
-
Hello
I am in need of writting to a txt file on a remote server. When trying I get this error:
"failed to open stream: HTTP wrapper does not support writeable connections in /home....."
How can I write to a siply txt file on a remote server?
-
Hello
I am having problems setting some security to a prize page on my website.
What I need, is to make sure that a user cannot just refresh and get the price again.
The price page is loaded in a frame so redirection is no good, and that doesn't stop the user from just hitting the "back" button and then refresh.
Anyone have an idea how to do this the simple way?
-
you think? So there is nothing with the coding that looks wrong?
-
I have checked the connections and both are fine. It seems the problem running this part, when the other connection is there:
<?php $away_members = mysql_query ("SELECT name FROM vtp_members WHERE id='58106' ", $dbh1) or die(mysql_error()); $rs_away_members = mysql_fetch_array( $away_members ); $away_member = $rs_away_members['name']; echo " $away_member "; ?>
If I remove the connection to the remote server the above part works fine.
-
What I have done is this, following an example I found..
<?php $server = "xxxxxxxxxxxxxxx"; $dbname = "lxxxxxxxxxxxxxxx"; $user = "xxxxxxxxxx"; //Allowed for the ip $password = "xxxxxxxxxxxx"; $link = mysql_connect($server,$user,$password) or die(mysql_error()); mysql_select_db($dbname); ?> <?php $hostname = "localhost"; $username = "xxxxxxxxxx"; $password = "xxxxxxxxxxxxxxxx"; $dbname2 = "xxxxxxxxxx"; $dbh1 = mysql_connect($hostname, $username, $password) or die(mysql_error()); mysql_select_db($dbname2); ?>
I have tried these to queries:
<?php $home_members = mysql_query ("SELECT DISTINCT (credit_members_id) as homememberid FROM vtp_tracking WHERE action_date>date_sub(NOW(),interval 5 minute) AND credit_members_id=57983", $link) or die(mysql_error()); $rs_home_members = mysql_fetch_array( $home_members ); $home_member = $rs_home_members['homememberid']; echo " $home_member "; ?> <?php $away_members = mysql_query ("SELECT name FROM vtp_members WHERE id='58106' ", $dbh1) or die(mysql_error()); $rs_away_members = mysql_fetch_array( $away_members ); $away_member = $rs_away_members['name']; echo " $away_member "; ?>
I can get a result from the first query, but none from the other. I am certain that it is the connection that is the problem or the wrong database.
-
Hello
I have followed a few guides / ideas but I simple can't get this too work properly. I can connect to the remote server and do quries and all, but getting anything from my own server (where the script is being runned) is just not happening. Does anyone have a link or example I can look at?
-
Hello
I am looking for someone who can install ioncube on my VPS.
Files are already present.
PM me if interested or if more details are needed.
Casper
-
Hello
I have created a script, but stuck on a file. I short, I can't figure out how to update multiple rows and get the updates at the right places:)
If you want to earn a few bucks PM me, and I'll explain details and send what I already have coded.
Casper
-
After a look at this, I simply have no idea what to do with it
So here are some more info; I am trying to list some events by date. My problem is listing 2 events happening the same day where a "variable" can be 2 things.
As picture above shows team with id "21" is both attacker and defender on same date. (disregards war_ended date)
When showing the events, It should show the date, the defending team name if any, and the attacking team if any.
my query right now is:
$sql_getevent = "SELECT DATE(war_started) AS war_started, attacker_name, defender_name, won, lost FROM teamwar_info WHERE attacker=".$_GET['t']." ORDER BY DATE(war_started) DESC "; $rs_getevent = mysql_query($sql_getevent);
This will show the date the right team name of the team being attacked.
The next column should show the team name of the team ATTACKING (on picture it should be "Black Beards Crew" as this team is attacking the team with id 21.
Using above picture: Assume our team has id 21. The event list should show date: 2011-5-10, attacking (the team WE attack): Jack Sparrow, the team attacking US: Black Beards Crew.
How can I do this?
(I am sure this is confusing, so please ask and I'll try to further explain.)
-
Thanks for the suggestions. As being fairly new to this I'm getting more and more confused lol. I'll see if I can make some of this work, otherwise I'll reply with the code I have so it is more clear what I am trying to achieve (there's usually a simple answer to my questions)
-
I have tried that code, that didn't work, but it might be possible why I ma asking. The code is just to show what I am trying to achieve.
-
I am wondering if it is possible to create 2 queries, and use 1 while statement?
Something like:
while (($row = mysql_fetch_array($rs_getevent)) && ($row = mysql_fetch_array($rs_getevent2))) {
Is something like this possible?
-
I am really lost here with this date issue of mine. The below code is the last part of a query:
$defendercheck_3 = $row_checkifattacked3['atdate']; $defendercheck1_3 = strtotime("$defendercheck_3"); $defendercheck2_3 = date("D", $defendercheck1_3);
The query does not return any results as expected, but when echoing the various steps I get following:
echo "$defendercheck3"; = nothing (as expected)
echo "$defendercheck1_3"; = nothing (as expected)
echo "$defendercheck2_3"; = result! (NOT expected)
why does it return anything on "date("D", $defendercheck1_3)" when "$defendercheck1_3" is blank?
-
I am doing a simple query where more than one row could be returned. I cannot see a way for the rest of my code to work using the "while $row= ...". Is there another way to fetch more than one result?
-
I have the below code wish I wish to add 12 hours to:
$today = date('D', mktime(0,0,0,date('m'),date('d')+0,date('Y')));
anyone to show how I add 12 hours?
-
I have the code below to output a list:
while ($row = mysql_fetch_array($rs_teambydate)) { echo "<tr><td width='200'>".$row['team_name']." (".$row['members_count'].")</td><td><input type='submit' name='".$row['team_name']."' value='Plunder'/></td>"; }
This is all inside a form so I can use the following to get various includes:
<? if(isset($_POST['".$row['team_name']."'])){ include ('resources.php');} ?>
My problem is this part : $_POST['".$row['team_name']."'], as this obviously doesn't work.
Anyone know how I can add the "$row['team_name']" inside $_POST[' '] ?
-
that would be great! I can wait for the right script thanks alot.
-
I am looking for some info on creating a textfield /dropdown menu that works just like a standard browser: when you type in something in the textfield/dropdown it should show results (this is needed to quickly find a member)
eg. I type "use" and dropdown should contain members(results) starting with "use" (user1, user2 ...)
Anyone know where I can find info on this?
-
basically yes.
-
I have done a query from a table with a timestamp like so DATE(...)
I have this value as $defend_started (if I do an echo on this I get: 2011-04-30)
Can I use this variable against other dates? Perhaps even "DATE_ADD($defend_started, INTERVAL 1 DAY)" ? If not, than what are the alternatives?
-
I have created a script (single file) that works fine when testing it alone, but when included it doesn't and rest of page is blank.
What could cause this? Is this because of some "mismatch" between the queries, variables used on the included file and the existing file?
-
ok here is the code I would like to get to work first:
$sql_teamwarinfo = "SELECT count(vtp_tracking.teamid), vtp_tracking.action_date, teamwar_info.war_started FROM vtp_tracking, teamwar_info WHERE vtp_tracking.teamid=".$members_teamid." AND teamwar_info.war_started < vtp_tracking.action_date"; $rs_teamwarinfo = mysql_query( $sql_teamwarinfo ); $row_teamwarinfo = mysql_fetch_array($rs_teamwarinfo);
This part is the problem : "teamwar_info.war_started < vtp_tracking.action_date"
I want to count ONLY where the date is AFTER "teamwar_info.war_started"
(in the end I want to count the between the date of "teamwar_info.war_started" and 2 days ahead)
I tried doing as you posted earlier (DATE ...) AS atc_date, but that only returns the first date..
Any ideas?
Any ideas?
-
Thanks pikachu2000 that did the trick with just getting the date.
Unfortunately this did help me as I thought. Goin back to previous post I still need:
WHERE DATE(teamwar_info.war_started) = DATE(vtp_tracking.action_date)
Is there a way I can combine them? I am amazed how difficult it is to just compare to timestamps...
-
ok what I am trying now is to trim the to timestamps so only the date is left. How do I trim the hour,min,sec?
("*:*:*", $row_rs_wartime2['action_date'])
writing to a remote txt file
in PHP Coding Help
Posted
thanks for the answer. I am amazed that writing to a remote file is so difficult to setup.