
bltesar
Members-
Posts
109 -
Joined
-
Last visited
Never
Everything posted by bltesar
-
HELP!!!!! Passing Parameters in the URL from website to website!
bltesar replied to 420blaze's topic in PHP Coding Help
you must be getting some information from your user to determine their username/password. -
how are you setting the cookie. If you don't set the expire parameter, then the cookie will expire when the session is ended. Consequently, upon return to the site, the cookie will not exist. setcookie ( string name [, string value [, int expire [, string path [, string domain [, bool secure]]]]] ) time()+60*60*24*30 (for the expire parameter) will set the cookie to expire in 30 days. If not set, the cookie will expire at the end of the session (when the browser closes). for more info see http://us3.php.net/manual/en/function.setcookie.php
-
Javascript calendar not compatible with FireFox - embedded in PHP
bltesar replied to glenelkins's topic in PHP Coding Help
I went to the site and did not see any calendar. How do I navigate to the calendar? -
how do shtml includes work? Obviously, a only a PHP include can have PHP code and dynamically generated content, but if only static HTML is needed, perhaps the shtml include is faster and uses less server resources.
-
using the mail function, you should include the following line in your headers: 'Content-type: text/html;' then your message body will be interpreted as html and you can include a style sheet to alter the format. for more info, go to http://us3.php.net/manual/en/function.mail.php
-
replace the br's at the end of the function code with 'end of page', load the page and see if this text is displayed. If so, the problem lies in the parameters sent to the function.
-
HELP!!!!! Passing Parameters in the URL from website to website!
bltesar replied to 420blaze's topic in PHP Coding Help
you have to write the code to retrieve the username and password from your database. Then you create the URL //get username and password from db, assign these values to $user and $pass //create the URL $iframe_loc = $remote_url . "?user=" . $user . "&pass=" . $pass; //load the page into your iframe -
you can use mail() to send attachments. I've never done it, so I can't provide a quick explanation as to how it's done, but you can find what you need here: http://www.zend.com/zend/spotlight/sendmimeemailpart1.php
-
To be safe, then, it is best to not allow more than one user to login from the same browser. When a login attempt is made, I check for existing sessions, and either alert the user or logout the existing session and cleanup variables.
-
Are you sure about that? In my experience, two instances of the same browser create two separate sessions. I just tested it with I.E. However, if the second instance is opened by the first, they will share the same session.
-
you're inputs are stored in the $_POST array. You need to have an action set for your form. The action can be the same page or another page. Either way, you get your POSTed variables like this- $id=$_POST['id_'.$id]; $url-$_POST['url_'.$id]; $description=$_POST['description_'.$id]; etc. you can use the same page by creating a conditional as follows if(isset($_POST)) { //create you output page } else { //create your form page }
-
create your template in a file, say header.htm then, in your php code where you want the template to appear, place the following line: require('header.php');
-
I don't understand how you can be logged into two differnet accounts simultaneously in one browser window? If you login as test and then as admin, how can you then logout the test account? Please provide more info on how your system is set up.
-
the br's in my previous message about viewing the source code of your page were interpreted as line breaks. your function prints out some line breaks, br's, at the end. Check the source code of your blank page to see if those are there, which woul dindicate that the function is executing properly and the problem is probably that the conditions set in your if statement are not being satisfied.
-
when you view the page source, do you see the '<br /><br /><br />', which would indicate that the function is being executed properly and the conditions set in your if statement are not bieng satisfied?
-
you need to define $menu and $team before calling the function
-
Help - Wondering how to input a variable, analyze it, then output
bltesar replied to smc's topic in PHP Coding Help
define the exp values for the various levels in an array, e.g.- $level=array(0,200,400,750,...); level 1 is 0-200, level 2 is 201-400, level 3 is 401-750 then use the following code to find your level: $i=1; $exp_score; while($level[$i]<$exp_score) { $i++; } $i is the level for $exp_score -
[quote author=scottrohe link=topic=102829.msg409097#msg409097 date=1154630273] [code=php:0] <?php $q = "SELECT * FROM favorites WHERE username='$session->username' AND favid='$hl_id'"; $sqlfavc = mysql_query($q) or die("Problem with the query: $q<br>" . mysql_error()); $exists=mysql_num_rows($sqlfavc); if($exists == $hl_id) { ?> <a href="?x=delf&f=<?php echo $hl_id;?>&c=layouts&s=<?php echo $hl_subcat;?>"><img src="i/alreadyfav.gif" hsrc="i/alreadyfav2.gif" align="left" border="0"></a> <?php } else {?> <a href="?x=addf&fav=<?php echo $hl_id;?>&cat=layouts&sub=<?php echo $hl_subcat;?>"><img src="i/favicon2.gif" hsrc="i/favicon2_2.gif" align="left" border="0"></a> <?php } ?> [/code] when i print_r($exists); it shows the id "1" for both, layout 1 and 2.. like it picks out the 1st id and saves it to the variable then stops... thats why the 2nd one is getting that same output, which confuses the hell out of me since its already in a loop! thought it was right then tested and got that :( closeeeee.... [/quote] you're almost there. instead of if($exists == $hl_id), you should have if($exists). Remember, $exists is the number of rows, which should be either 1 for a macth or 0 for no match.
-
OK, I think I might have it now. It seems to me that for each thumbnail image obtained from your $sqltwo1 = mysql_query("SELECT * FROM ".TBL_LAYOUTS." ORDER BY views DESC LIMIT 3"); that you are searching through the favids of the user and creating a 'delete from favs' or an 'add to favs' icon for each favid in the table for you user instead, maybe you should use this query to get your $exists: SELECT * FROM favorites WHERE username='$session->username' AND favid='$hl_id' then $exists=mysql_num_rows($result of above query);
-
What kind of output are you seeing? Do you always get all for errors?
-
So it seems the impossible is happening: you have both conditionals for your if($exists){}else{} being executed. I know it seems unlikely, but could it be there's something wrong with the placement of your code within the HTML? Relative to the code you've shown, where is the thumbnail image and the Layout Name, etc. data?
-
the SESSION variable is only needed if the form and validation are done on different pages. I assumed that to be the case because the original question indicated that invalid data would give a 'go back' method. I sometimes use a hidden validation page that redirects the user depnding on success/failure of input. That way, data cannot be inadvertantly resubmitted by using the back button.
-
please show some of the code in if($exists) { //show delete favorite image } else { //show add favorite image }
-
I don't know of any way to do this, however, there is another option. Resize your image to the largest size possible that will fit within the constraints of your thumbnail size while keeping the original proportions. For example, lets say you want a thumbnail that is 100*200 and your original image is 600*300. thumb_width=100 thumb_height=200 thumbnail_ratio=thumb_width/thumb_height (0.5) orig_width=600 orig_height=300 original_ratio=orig_width/orig_height (2) if(original_ratio<thumbnail_ratio) new_width=(thumb_height/orig_height)*orig_width new_height=thumb_height else new_height=(thumb_width/orig_width)*orig_height new_width=thumb_width so long as you don't have images width very large or very small width/height ratios, this can work fairly well