Jump to content

widox

Members
  • Posts

    38
  • Joined

  • Last visited

    Never

Everything posted by widox

  1. It would help if you posted your code.
  2. You could always hard code the IP for the subdomain in your hosts file. In /etc/hosts 2.2.2.2 sub.domain.net sub Try that out. Other then that, you're going to have to edit your DNS/Firewall to allow that access. HTH
  3. Yes, that is where the Notice error is coming from. You're checking a variable $tmp_name but that variable doesn't exist. Do you have something on your form asking for a file name or something? If so then do something like if(!empty($_POST['file_name']) { $tmp_name = $_POST['file_name']; else $tmp_name = ''; Then you won't get that Notice message and your page will re-direct like you want it to.
  4. haha. I don't understand your line of though how fixing the undefined variable problem wouldn't allow it to be re-directed... The Notice Warning: Cannot modify header information - headers already sent by comes AFTER the Notice: Undefined variable: tmp_name in the same file. Because you can't issue a header(s) after there has been output. lander, declare the $tmp_name variable and you'll be set. Try it.
  5. You also need to learn how to use the text editor.. I think you've got a bit to many [ code ] bits in there. Anyway, just wrap the * in an element. <? if($missing && $_POST['City'] == '') print "<em>*</em>" ?></td> </tr> Then use CSS to target that element (em). Such as .style5 em { color: red; } HTH
  6. True, but the reason that it's not redirecting is because that Notice of an undefined variable.
  7. Well, what exactly does $desired_num represent and how does the user/code pick it? Best bet would be to use that as criteria in your SQL statement. Such as SELECT * FROM NamesTbl WHERE id = SOMEID or somesuch where clause. Then you'll only need to retrieve 1 record instead of ALL records. Then you can simply display the results of your query and be done.
  8. That's not really fixing the problem thesaleboat. You need to figure what $tmp_name is supposed to be. You are using it here if (file_exists($tmp_name)){ but I don't see it being set anywhere. Fix that and the notice will go away and it should then redirect.
  9. Looks to me like your FTP server path isn't correct. Are you on a shared host? The paths are usually something different then what you think. Try creating an empty PHP script and echo out $_SERVER['SCRIPT_FILENAME'] and see what it says. Oh, put it in the folder your trying to access and put that path in your FTP script and test again.
  10. Do some searching on API's, in particular REST (Representational State Transfer) http://en.wikipedia.org/wiki/Representational_State_Transfer. It's a simple architecture for communicating services. Also, check out oAuth for authentication. This could potentially be a pretty large project. On the other hand, you could just create a couple PHP scripts on your server(s) and call them with cURL and parse the response as needed. Depends on how far you wanna go. HTH
  11. You should read up on that http://us2.php.net/manual/en/features.file-upload.php Essentially after the file(s) have been uploaded, you can access the file info with the $_FILES global. $_FILES['userfile']['name'] is the name of the file So you can just add that name to the string of your email body and send it along.
  12. Check out the mail() function. http://us3.php.net/manual/en/function.mail.php
  13. Ok, that makes it easy to approach. while($row = mysql_fetch_array($result)){ if(strpos($row['link'], 'lakesideca.com') === false) { $linkTarget = '_blank'; } else { $linkTarget = 'container'; } echo "<font color= maroon><font size=2>"; echo $row['event']; echo "</font>"; echo "<font color= black><font size=2>"; echo $row['article']; echo "</font>"; echo "<a target=\"$linkTarget\" href='$row[link]'> Go there[/url]"; echo "</font>"; echo ""; echo ""; } The if statement simply checks if the string "lakesideca.com" (internal links) is in the link field, and if so sets $linkTarget to "container", otherwise it must be external so it get set to _blank. That should get you on your way. caution: quick off-the-cuff untested code
  14. OK. What is the format of your $row['link']? Are they absolute URL's or relative? If the former, you can simply check for your domain. For the latter, external URL's must begin with http:// so you could check if that exists. Then you just alter the link HTML accordingly.
  15. haha, well that's why your script won't run! They must have it setup differently for web scripts. You'd need to contact your hosting company. First try enabling that PHP5 option and see what happens!
  16. Well, how are you recognizing which links are targeting container and which are targeting blank? Do you already have something in your DB that identifies links as internal or external? Some more code and an example link would be helpful.
  17. Do your other pages (check.php, credit.php, history.php) call session_start(); at the top of them? Do those pages also POST to login.php? The way it's written says to always set $_SESSION['username'] to $user which is a POST variable. So, if your just using a plain HTML link, the session variable won't be set to anything because $_POST['user'] doesn't exist. You need to add a check in there to only set $_SESSION vars when say your login form is submitted to it. Something like this: if($_POST['loginFormSubmitted']) { $user=$_POST['user']; $pass=$_POST['pass']; $_SESSION['username'] = "$user"; } else { print_r($_SESSION); } So now when any of your other pages link to this page it will not try and set the $_SESSION var, but instead just display them. Try it out. BTW You should also be doing some sanitizing of those variables before you use them in queries!!
  18. Check out the parse_url() function http://us2.php.net/function.parse-url
  19. You may also need to modify 'memory_limit' in php.ini. Trying to work with that large of files will probably max out the default setting... HTH
  20. Just a shot in the dark, but are you absolutely sure you're running PHP5 on the cli? See what this reports: echo phpversion();
  21. Ok, isn't that what you wanted? The session variables are cleared.
  22. Where are you using session variables? if you do print_r($_SESSION); what happens?
  23. How about it's a logic error. What do the rows in your DB look like? Need more info.
  24. widox

    Block Help!

    I like to start with a functional and tested layout and build off of that. Check out http://blog.html.it/layoutgala/. They have some good basic structures to build from.
  25. The most basic way would to have something like function doSomething($param = 'default value') { // function body } so if you just call doSomething() $param would be 'default value', but if you called doSomething('no use this'); $param would be 'no use this' instead. Is that what your looking for?
×
×
  • 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.