Jump to content

tebrown

Members
  • Posts

    114
  • Joined

  • Last visited

Posts posted by tebrown

  1. I played around with it for a while but easnt working still. I then looked into this forum post:

     

    http://stackoverflow.com/questions/8585361/jquery-dialog-box-passing-variable-value-from-php-to-jquery-function

     

    So i tried out the iFrame, i got it to work and it now shoes the id for each link.

     

    But iFrame's seem to take away my css styling. I've lost all my style within the modal itself.

     

    jQuery(function ($) {
    
    
            // Load dialog on click
            $('#basic-modal .basic').click(function (e) {
            e.preventDefault();
    
            // Display an external page using an iframe
            var src = $(this).attr('href');
            $.modal('<iframe src="' + src + '" height="450" width="400" style="border:0">', {
    
                overlayClose:true
            });
    
                return false; // not sure why you're doing this
            }); // end of click handler
    
        });  // end of document.ready

     

     

  2. Sorry i didn't see that you provided the second piece of code above.

     

    Would i put it together like this:

     

    jQuery(function ($) {
    
    $(document).ready(function () {
          $('#basic-modal input.basic, #basic-modal a.basic').click(function (e) {
                  e.preventDefault();
                  var content = '#' + this.id + '-content';
                  $(content).modal();
          });
    });
    
    // Load dialog on click
    $('#basic-modal .basic').click(function (e) {
    	$.get("schedule.php?id=" + this.hash.substr(1), function (data ){
    	$('#content-one').modal({
    	overlayClose:true,
    	opacity:40
    	});
    
    	});
    	return false;
    
    
    });
    
    });

     

    When i did this, it doesn't even open up properly.

     

    Cheers

    tebrown

  3. Damn, im running on localhost.

     

    I dont think its a database problem, its defiantly something to do with the javascript.

     

    Quick rundown.

     

    The 2 links are displayed on schedule.php. They both have an id (24, 25).

     

    When the user clicks one of these links, it will open up the modal (lineup.php), which will then show the id depending on what link the user clicked.

     

     

     

     

  4. Ok sorry, i should have showed the other code. Let me show you it.

     

    schedule.php

     

    <?php
    
    
    
    $fixture = "SELECT * FROM `fixtures` WHERE `club`='".$_SESSION['club']."' AND `team`='".$_SESSION['team']."' AND `status`='1' ORDER BY time ASC";
    
    $resultfixture=mysql_query($fixture);
    
    while($rows = mysql_fetch_array($resultfixture))
    
    { 
    
    $id=$rows['id'];
    $status=$rows['status'];
    $date = $rows['time'];
    $saved=$rows['saved'];
    $date = $rows['time'];
    $fixturedate = date('M jS, g:ia', $date);
    
    ?>
    
    <div class="updates-team">
    	<div style="height: 100%; width: 3px; background-color: #85BC77;">
    		<div class="padding-team">
    			<table width="600px" cellpadding="0">
    				<tr>
    					<td width="148"><?php echo "" . $rows['home'] . " vs ". $rows['away'].""?></td>
    					<td width="120"><?php echo "" . $rows['where'] . "" ?></td>
    					<td width="120"><?php echo $fixturedate; ?></td>
    
    					<td width="100" rowspan="2">
    						<div href="#" class="small-icon-edit"><i class="icon-bar-chart"></i></div>
    						<div id='basic-modal'><a href="schedule.php?id=<? echo $rows['id']; ?>" class='basic'><div class="small-icon-edit"><i class="icon-edit"></i></div></a></div>
    						<div href="#" class="small-icon-tick-incomplete"><i class="icon-ok-sign"></i></div>
    					</td>
    
    					<tr style="font-size: 11px;color: #9B9B9B;padding-top: 5px;">
    						<td colspan="1"><a href="#" id="sample">Mostly Overcast</a></td>
    						<td colspan="1">New Plymouth</td>
    						<td colspan="3">Saturday</td>
    					</tr>
    
    
    				</table>
    			</div>
    		</div>
    	</div>
    
    	<?
    } 
    
    
    ?>

  5. I did find this forum post:

     

    http://forum.jquery.com/topic/simplemodal-parsing-variable-from-original-php-to-modal-popup

     

    I made the following changes, but it still doesn't grab the id from the specific link i click.

     

    shedule.php

     

    <a href="schedule.php?id=<? echo $rows['id']; ?>" class='basic'>Open Modal</a>

     

    Javascript

     

    jQuery(function ($) {
    
    // Load dialog on click
    $('#basic-modal .basic').click(function (e) {
    	[b]$.get("schedule.php?id=" + this.hash.substr(1), function (data ){[/b]
    	$('#content-one').modal({
    	overlayClose:true,
    	opacity:40
    	});
    
    	});
    	return false;
    
    });
    
    });
    

     

    lineup.php (grab the id and echo it out)

     

    <?
    $id=$_GET['id'];
    echo $id;
    
    ?>

     

    I still get the Notice: Undefined index: id in /Users/Tim/Sites/2012MP/modals/lineup.php on line 17

     

    Cheers Guys

     

     

  6. Thanks for you reply there,

     

    I found a similar modal which allows you to have multiple modals on one page.

     

    I'm still having trouble. I've got this below link which activates the modal box and opens it, but im trying to get the $id variable although I cant seem to get it to work.

     

    schedule.php

     

    <div id='basic-modal'><a href="lineup.php?id=<? echo $rows['id']; ?>" class='basic'>Open Modal</a></div>

     

    lineup.php

     

    <?
    $id=$_GET['id'];
    echo $id;
    ?>

     

    Here is the javascript that im using to open it:

     

    jQuery(function ($) {
    // Load dialog on page load
    //$('#basic-modal-content').modal();
    
    // Load dialog on click
    $('#basic-modal .basic').click(function (e) {
    	$('#content-one').modal({
    	overlayClose:true,
    	opacity:40
    
    
    	});
    	return false;
    
    });
    
    });

     

    Any help much appreciated.

  7. Hey Guys,

     

    Originally i had a page called fixtures.php - this page had all my fixtures for my upcoming season. Each fixture had a icon that allowed the manager to click this link and create the lineup for this fixture. It would then take them to a page called lineup.php with a php variable attached like this: lineup.php?id=45

     

    Now, i have modified my site and have changed it so that when the user clicks a specific icon to create the lineup it would open up a modal dialogue box.

     

    The link to open this modal dialogue box is as follows: <a id="go" rel="leanModal" name="modal9" href="#modal9"></a>

     

    Before it had allowed me to switch pages from fixtures.php to lineup.php where i could pass the variable within the link. Now it wont let me do that becuase the modal dialoge box opens without refreshing.

     

    So what i need to do now is somehow pass the php variale (id) to this modal dialogue box and grab it so i can then show results from the database depending on the $id variable.

     

    How could i go about doing this?

     

    Cheers

    tebrown

     

  8. Still goes to junk...

     

    $headers = "MIME-Version: 1.0".PHP_EOL; 
    $headers .= "--PHP-mixed-".$uid."".PHP_EOL;
    $headers .= "Content-Type: multipart/alternative; boundary=\"PHP-alt-".$uid."\"".PHP_EOL;
    $headers .= "--PHP-alt-".$uid."".PHP_EOL; 
    $headers .= "Content-type: text/html; charset=utf-8".PHP_EOL.PHP_EOL;
    $headers .= "Content-Transfer-Encoding: 7bit".PHP_EOL;
    $headers .= "To: \"".$name."\" <".$to.">".PHP_EOL; 
    $headers .= "From: ".$from." <".$from.">".PHP_EOL; 
    $headers .= "Reply-To: ".$name." <".$from.">".PHP_EOL; 
    $headers .= "Return-Path: ".$from." <".$from.">".PHP_EOL; 
    $headers .= "X-Priority: 3".PHP_EOL;
    $headers .= "X-Mailer: PHP". phpversion() ."".PHP_EOL;
    $headers .= "X-MSMail-Priority: High\n"; 
    $headers .= "Importance: High\n";

     

    Mate, you can go to bed, don't want to keep you up. I can wait for a response.

     

    Cheers.

  9. Hmm, yeah its still sending to junk. This is really annoying aye.

     

    Also why does it show the content within the actual message?

     

     

    <?
    
    
    
    $subject = mysql_real_escape_string($_POST["subject"]);
    $body = mysql_real_escape_string($_POST["message"]);
    
    $to = "t.e.brown@hotmail.com";
    $uid= md5(uniqid(time()));
    $name = "".$_SESSION['name']."";
    $from = "".$_SESSION['email']."";
    
    $headers = "MIME-Version: 1.0".PHP_EOL; 
    $headers .= "--PHP-mixed-".$uid."".PHP_EOL;
    $headers .= "Content-Type: multipart/alternative; boundary=\"PHP-alt-".$uid."\"".PHP_EOL;
    $headers .= "--PHP-alt-".$uid."".PHP_EOL; 
    $headers .= "Content-type: text/html; charset=utf-8".PHP_EOL.PHP_EOL;
    $headers .= "Content-Transfer-Encoding: 7bit".PHP_EOL;
    $headers .= "To: \"".$name."\" <".$to.">".PHP_EOL; 
    $headers .= "From: ".$from." <".$from.">".PHP_EOL; 
    $headers .= "Reply-To: ".$name." <".$from.">".PHP_EOL; 
    $headers .= "Return-Path: ".$from." <".$from.">".PHP_EOL; 
    $headers .= "X-Priority: 3".PHP_EOL;
    $headers .= "X-Mailer: PHP". phpversion() ."".PHP_EOL;
    
    //message headers
    
    mail($to, $subject, $body, $headers);
    
    ?>

     

  10. I just looked at my settings in my web hosting. This is what it says.

     

    Mail Server Username: info+rugbymanager.co.nz

    Incoming Mail Server: mail.rugbymanager.co.nz

    Incoming Mail Server: (SSL) mail.emailserver.co.nz

    Outgoing Mail Server: mail.rugbymanager.co.nz (server requires authentication) port 26

    Outgoing Mail Server: (SSL) mail.emailserver.co.nz (server requires authentication) port 465

    Supported Incoming Mail Protocols: POP3, POP3S (SSL/TLS), IMAP, IMAPS (SSL/TLS)

    Supported Outgoing Mail Protocols: SMTP, SMTPS (SSL/TLS)

  11. No worries, here it is. I've replaced my site name with domain. Has not been released yet that is all.

     

    $subject = mysql_real_escape_string($_REQUEST["subject"]);
    $body = mysql_real_escape_string($_REQUEST["message"]);
    
    //specify your SMTP domain
    ini_set ( "SMTP", "mail.domain.co.nz" ); 
    // Please specify an SMTP Number 25 and 8889 are valid SMTP Ports.
    ini_set("smtp_port","25");
    
    //if  password auth is required
    ini_set("username" , "info@domain.co.nz");
    ini_set("password", "********");
    
    $subject = mysql_real_escape_string($_REQUEST["subject"]);
    $body = mysql_real_escape_string($_REQUEST["message"]);
    
    $to = "t.e.brown@hotmail.com";
    
    $name = "".$_SESSION['name']."";
    $from = "".$_SESSION['email']."";
    
    $headers = "MIME-Version: 1.0".PHP_EOL; 
    $headers .= "Content-type: text/plain; charset=utf-8".PHP_EOL; 
    $headers .= "To: ".$to."".PHP_EOL; 
    $headers .= "From: ".$name." <".$from.">".PHP_EOL; 
    $headers .= "Reply-To: ".$name." <".$from.">".PHP_EOL; 
    $headers .= "Return-Path: ".$from." <".$from.">".PHP_EOL; 
    $headers .= "X-Priority: 3".PHP_EOL;
    $headers .= "X-Mailer: PHP". phpversion() ."".PHP_EOL;
    
    mail($to, $subject, $body, $headers);
    
    

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.