bigbamboom Posted March 31, 2021 Share Posted March 31, 2021 (edited) Hello I am working with Autoit...and I need an output to change Currently I have this script $sTemplate &= 'header( "refresh:5;url=http://golfsettlers.com/' & $_sHoleth & '-hole-group-2" ); ' & @CRLF Which outputs a line - and in that line I need it to be 'refresh:5: etc...then after the group-2' not " When I try and insert ' instead of " I get an error code. Can someone help me expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here Global $g_aHoles[19][2] = [[18, ""]] $g_aHoles[1][0] = "H1" $g_aHoles[1][1] = "2nd" $g_aHoles[2][0] = "H2" $g_aHoles[2][1] = "3rd" $g_aHoles[3][0] = "H3" $g_aHoles[3][1] = "4th" $g_aHoles[4][0] = "H4" $g_aHoles[4][1] = "5th" $g_aHoles[5][0] = "H5" $g_aHoles[5][1] = "6th" $g_aHoles[6][0] = "H6" $g_aHoles[6][1] = "7th" $g_aHoles[7][0] = "H7" $g_aHoles[7][1] = "8th" $g_aHoles[8][0] = "H8" $g_aHoles[8][1] = "9th" $g_aHoles[9][0] = "H9" $g_aHoles[9][1] = "10th" $g_aHoles[10][0] = "H10" $g_aHoles[10][1] = "11th" $g_aHoles[11][0] = "H11" $g_aHoles[11][1] = "12th" $g_aHoles[12][0] = "H12" $g_aHoles[12][1] = "13th" $g_aHoles[13][0] = "H13" $g_aHoles[13][1] = "14th" $g_aHoles[14][0] = "H14" $g_aHoles[14][1] = "15th" $g_aHoles[15][0] = "H15" $g_aHoles[15][1] = "16th" $g_aHoles[16][0] = "H16" $g_aHoles[16][1] = "17th" $g_aHoles[17][0] = "H17" $g_aHoles[17][1] = "18th" $g_aHoles[18][0] = "H18" $g_aHoles[18][1] = "1st" For $i = 2 To 2 ;~ This loop is for game count i.e. G1 For $j = 1 To $g_aHoles[0][0] ;~ This loops through our array above _WritePHPFile("G" & $i, $g_aHoles[$j][0], $g_aHoles[$j][1], $j) Next Next Func _WritePHPFile($_sGame = "G1", $_sHole = "H1", $_sHoleth = "1st", $_sScoreCard = 1) Local $sTemplate = "" $sTemplate &= '<?php /* Template Name: Skins_' & $_sGame & '_' & $_sHole & 'SGML2_09242020 */ ' & @CRLF $sTemplate &= '' & @CRLF $sTemplate &= ' ?>' & @CRLF $sTemplate &= '' & @CRLF $sTemplate &= '' & @CRLF $sTemplate &= "<?php require_once 'connection.php';?>" & @CRLF $sTemplate &= '' & @CRLF $sTemplate &= '<?php' & @CRLF $sTemplate &= 'header( "refresh:5;url=http://golfsettlers.com/' & $_sHoleth & '-hole-group-2" ); ' & @CRLF $sTemplate &= '' & @CRLF $sTemplate &= " $gross_player = $connection->prepare('SELECT players.name AS player_name, leagues.name AS League, groups.name AS GroupName, teams.name AS Teams, (scorecard.net_" & $_sScoreCard & " ) Gross_Score FROM groups INNER JOIN scorecard ON groups.id = scorecard.group_id INNER JOIN teams ON teams.id = scorecard.team_id INNER JOIN leagues ON leagues.id = scorecard.league_id INNER JOIN players ON players.id = scorecard.player_id WHERE leagues.id = 1 AND net_" & $_sScoreCard & " > 0 AND scorecard.date_played = ""09/24/2020"" AND players.skins = 2 Order by Gross_Score ASC LIMIT 15');" & @CRLF $sTemplate &= ' $gross_player->execute();' & @CRLF $sTemplate &= ' $gross_players = $gross_player->fetchAll();' & @CRLF $sTemplate &= '' & @CRLF $sTemplate &= '?>' & @CRLF $sTemplate &= '' & @CRLF $sTemplate &= '' & @CRLF $sTemplate &= '' & @CRLF $sTemplate &= '<!DOCTYPE html>' & @CRLF $sTemplate &= '<html>' & @CRLF $sTemplate &= '<head>' & @CRLF $sTemplate &= ' <title></title>' & @CRLF $sTemplate &= '</head>' & @CRLF $sTemplate &= '<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">' & @CRLF $sTemplate &= '<style type="text/css">' & @CRLF $sTemplate &= ' body{' & @CRLF $sTemplate &= " background: url('https://i.imgur.com/68OTd6q.jpg');" & @CRLF $sTemplate &= ' background-size: cover;' & @CRLF $sTemplate &= ' background-repeat: no-repeat;' & @CRLF $sTemplate &= ' }' & @CRLF $sTemplate &= '</style>' & @CRLF $sTemplate &= '<body>' & @CRLF $sTemplate &= '' & @CRLF $sTemplate &= '' & @CRLF $sTemplate &= '' & @CRLF $sTemplate &= '' & @CRLF $sTemplate &= '' & @CRLF $sTemplate &= ' <!-- Right Panel and content Area -->' & @CRLF $sTemplate &= ' <div class="container">' & @CRLF $sTemplate &= '' & @CRLF $sTemplate &= ' <div class="content mt-3">' & @CRLF $sTemplate &= ' <div class="row">' & @CRLF $sTemplate &= ' <div class="col-md-12">' & @CRLF $sTemplate &= ' <div class="card">' & @CRLF $sTemplate &= ' <div style="background: #547a01;color: #fff;" class="card-header">' & @CRLF $sTemplate &= ' <strong style="width:30%;" class="card-title">' & "<?php get_template_part( 'content', 'page' ); ?></strong>" & @CRLF $sTemplate &= ' </div>' & @CRLF $sTemplate &= ' <div class="card-body">' & @CRLF $sTemplate &= ' <table class="table table-bordered table-striped">' & @CRLF $sTemplate &= ' <thead>' & @CRLF $sTemplate &= ' <tr style="color:#547a01;" bgcolor="#fffff2">' & @CRLF $sTemplate &= ' <th width="80%" scope="col">Name</th>' & @CRLF $sTemplate &= ' <th align="center" scope="col">Gross score</th>' & @CRLF $sTemplate &= ' </tr>' & @CRLF $sTemplate &= ' </thead>' & @CRLF $sTemplate &= ' <tbody>' & @CRLF $sTemplate &= ' <?php foreach($gross_players as $player){?>' & @CRLF $sTemplate &= ' <tr>' & @CRLF $sTemplate &= ' <td class="p-1 pl-2" width="80%" scope="row">' & "<?php echo $player['player_name']?></td>" & @CRLF $sTemplate &= ' <td class="p-1" align="center">' & "<?php echo $player['Gross_Score']?></td>" & @CRLF $sTemplate &= ' </tr>' & @CRLF $sTemplate &= ' <?php } ?>' & @CRLF $sTemplate &= ' </tbody>' & @CRLF $sTemplate &= ' </table>' & @CRLF $sTemplate &= ' </div>' & @CRLF $sTemplate &= ' </div>' & @CRLF $sTemplate &= ' </div>' & @CRLF $sTemplate &= '' & @CRLF $sTemplate &= '' & @CRLF $sTemplate &= '' & @CRLF $sTemplate &= ' ' & @CRLF $sTemplate &= ' </div> <!-- .content -->' & @CRLF $sTemplate &= ' </div><!-- /#right-panel -->' & @CRLF $sTemplate &= ' <!-- Right Panel -->' & @CRLF $sTemplate &= '</body>' & @CRLF $sTemplate &= '</html> Edited March 31, 2021 by Jos added codebox... please use <> next time. Link to comment Share on other sites More sharing options...
JockoDundee Posted March 31, 2021 Share Posted March 31, 2021 Sorry, but as a matter of principle, I refuse to work with aHoles[] Exit and Musashi 2 Code hard, but don’t hard code... Link to comment Share on other sites More sharing options...
Developers Jos Posted March 31, 2021 Developers Share Posted March 31, 2021 (edited) Reverted the locking of the thread after understanding what this is about. To answer the Question: $test = ' this will have a quote now '' andthis will too'' and end the string now' Jos Edited March 31, 2021 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now